MCPcopy Create free account
hub / github.com/breach/thrust / CallLocalMethod

Method CallLocalMethod

src/api/thrust_window_binding.cc:85–193  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83
84
85void
86ThrustWindowBinding::CallLocalMethod(
87 const std::string& method,
88 scoped_ptr<base::DictionaryValue> args,
89 const API::MethodCallback& callback)
90{
91 std::string err = std::string("");
92 base::DictionaryValue* res = new base::DictionaryValue;
93
94 LOG(INFO) << "ThrustWindow call [" << method << "]";
95
96 /* Methods */
97 if(method.compare("show") == 0) {
98 window_->Show();
99 }
100 else if(method.compare("focus") == 0) {
101 bool focus = true;
102 args->GetBoolean("focus", &focus);
103 window_->Focus(focus);
104 }
105 else if(method.compare("maximize") == 0) {
106 window_->Maximize();
107 }
108 else if(method.compare("unmaximize") == 0) {
109 window_->UnMaximize();
110 }
111 else if(method.compare("minimize") == 0) {
112 window_->Minimize();
113 }
114 else if(method.compare("restore") == 0) {
115 window_->Restore();
116 }
117 else if(method.compare("set_title") == 0) {
118 std::string title = "";
119 args->GetString("title", &title);
120 window_->SetTitle(title);
121 }
122 else if(method.compare("set_fullscreen") == 0) {
123 bool fullscreen;
124 args->GetBoolean("fullscreen", &fullscreen);
125 window_->SetFullscreen(fullscreen);
126 }
127 else if(method.compare("set_kiosk") == 0) {
128 bool kiosk;
129 args->GetBoolean("kiosk", &kiosk);
130 window_->SetKiosk(kiosk);
131 }
132 else if(method.compare("open_devtools") == 0) {
133 window_->OpenDevTools();
134 }
135 else if(method.compare("close_devtools") == 0) {
136 window_->CloseDevTools();
137 }
138 else if(method.compare("move") == 0) {
139 int x, y;
140 args->GetInteger("x", &x);
141 args->GetInteger("y", &y);
142

Callers

nothing calls this directly

Calls 15

FocusMethod · 0.80
MaximizeMethod · 0.80
UnMaximizeMethod · 0.80
MinimizeMethod · 0.80
RestoreMethod · 0.80
GetStringMethod · 0.80
SetTitleMethod · 0.80
SetFullscreenMethod · 0.80
SetKioskMethod · 0.80
MoveMethod · 0.80
ResizeMethod · 0.80
CloseMethod · 0.80

Tested by

no test coverage detected