| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "config.h" | 5 #include "config.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "Document.h" | 9 #include "Document.h" |
| 10 #include "DOMWindow.h" | 10 #include "DOMWindow.h" |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 dev_tools_host_->AddProtoFunction( | 169 dev_tools_host_->AddProtoFunction( |
| 170 "closeWindow", | 170 "closeWindow", |
| 171 WebDevToolsFrontendImpl::JsCloseWindow); | 171 WebDevToolsFrontendImpl::JsCloseWindow); |
| 172 dev_tools_host_->AddProtoFunction( | 172 dev_tools_host_->AddProtoFunction( |
| 173 "dockWindow", | 173 "dockWindow", |
| 174 WebDevToolsFrontendImpl::JsDockWindow); | 174 WebDevToolsFrontendImpl::JsDockWindow); |
| 175 dev_tools_host_->AddProtoFunction( | 175 dev_tools_host_->AddProtoFunction( |
| 176 "undockWindow", | 176 "undockWindow", |
| 177 WebDevToolsFrontendImpl::JsUndockWindow); | 177 WebDevToolsFrontendImpl::JsUndockWindow); |
| 178 dev_tools_host_->AddProtoFunction( | 178 dev_tools_host_->AddProtoFunction( |
| 179 "toggleInspectElementMode", | |
| 180 WebDevToolsFrontendImpl::JsToggleInspectElementMode); | |
| 181 dev_tools_host_->AddProtoFunction( | |
| 182 "getApplicationLocale", | 179 "getApplicationLocale", |
| 183 WebDevToolsFrontendImpl::JsGetApplicationLocale); | 180 WebDevToolsFrontendImpl::JsGetApplicationLocale); |
| 184 dev_tools_host_->AddProtoFunction( | 181 dev_tools_host_->AddProtoFunction( |
| 185 "hiddenPanels", | 182 "hiddenPanels", |
| 186 WebDevToolsFrontendImpl::JsHiddenPanels); | 183 WebDevToolsFrontendImpl::JsHiddenPanels); |
| 187 dev_tools_host_->Build(); | 184 dev_tools_host_->Build(); |
| 188 } | 185 } |
| 189 | 186 |
| 190 WebDevToolsFrontendImpl::~WebDevToolsFrontendImpl() { | 187 WebDevToolsFrontendImpl::~WebDevToolsFrontendImpl() { |
| 191 } | 188 } |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 // static | 379 // static |
| 383 v8::Handle<v8::Value> WebDevToolsFrontendImpl::JsUndockWindow( | 380 v8::Handle<v8::Value> WebDevToolsFrontendImpl::JsUndockWindow( |
| 384 const v8::Arguments& args) { | 381 const v8::Arguments& args) { |
| 385 WebDevToolsFrontendImpl* frontend = static_cast<WebDevToolsFrontendImpl*>( | 382 WebDevToolsFrontendImpl* frontend = static_cast<WebDevToolsFrontendImpl*>( |
| 386 v8::External::Cast(*args.Data())->Value()); | 383 v8::External::Cast(*args.Data())->Value()); |
| 387 frontend->client_->undockWindow(); | 384 frontend->client_->undockWindow(); |
| 388 return v8::Undefined(); | 385 return v8::Undefined(); |
| 389 } | 386 } |
| 390 | 387 |
| 391 // static | 388 // static |
| 392 v8::Handle<v8::Value> WebDevToolsFrontendImpl::JsToggleInspectElementMode( | |
| 393 const v8::Arguments& args) { | |
| 394 WebDevToolsFrontendImpl* frontend = static_cast<WebDevToolsFrontendImpl*>( | |
| 395 v8::External::Cast(*args.Data())->Value()); | |
| 396 int enabled = static_cast<int>(args[0]->BooleanValue()); | |
| 397 frontend->client_->toggleInspectElementMode(enabled); | |
| 398 return v8::Undefined(); | |
| 399 } | |
| 400 | |
| 401 // static | |
| 402 v8::Handle<v8::Value> WebDevToolsFrontendImpl::JsGetApplicationLocale( | 389 v8::Handle<v8::Value> WebDevToolsFrontendImpl::JsGetApplicationLocale( |
| 403 const v8::Arguments& args) { | 390 const v8::Arguments& args) { |
| 404 WebDevToolsFrontendImpl* frontend = static_cast<WebDevToolsFrontendImpl*>( | 391 WebDevToolsFrontendImpl* frontend = static_cast<WebDevToolsFrontendImpl*>( |
| 405 v8::External::Cast(*args.Data())->Value()); | 392 v8::External::Cast(*args.Data())->Value()); |
| 406 return v8String(frontend->application_locale_); | 393 return v8String(frontend->application_locale_); |
| 407 } | 394 } |
| 408 | 395 |
| 409 // static | 396 // static |
| 410 v8::Handle<v8::Value> WebDevToolsFrontendImpl::JsHiddenPanels( | 397 v8::Handle<v8::Value> WebDevToolsFrontendImpl::JsHiddenPanels( |
| 411 const v8::Arguments& args) { | 398 const v8::Arguments& args) { |
| 412 Page* page = V8Proxy::retrieveFrameForEnteredContext()->page(); | 399 Page* page = V8Proxy::retrieveFrameForEnteredContext()->page(); |
| 413 return v8String(page->settings()->databasesEnabled() ? "" : "databases"); | 400 return v8String(page->settings()->databasesEnabled() ? "" : "databases"); |
| 414 } | 401 } |
| 415 | 402 |
| 416 // static | 403 // static |
| 417 v8::Handle<v8::Value> WebDevToolsFrontendImpl::JsDebuggerCommand( | 404 v8::Handle<v8::Value> WebDevToolsFrontendImpl::JsDebuggerCommand( |
| 418 const v8::Arguments& args) { | 405 const v8::Arguments& args) { |
| 419 WebDevToolsFrontendImpl* frontend = static_cast<WebDevToolsFrontendImpl*>( | 406 WebDevToolsFrontendImpl* frontend = static_cast<WebDevToolsFrontendImpl*>( |
| 420 v8::External::Cast(*args.Data())->Value()); | 407 v8::External::Cast(*args.Data())->Value()); |
| 421 String command = WebCore::toWebCoreStringWithNullCheck(args[0]); | 408 String command = WebCore::toWebCoreStringWithNullCheck(args[0]); |
| 422 WebString std_command = webkit_glue::StringToWebString(command); | 409 WebString std_command = webkit_glue::StringToWebString(command); |
| 423 frontend->client_->sendDebuggerCommandToAgent(std_command); | 410 frontend->client_->sendDebuggerCommandToAgent(std_command); |
| 424 return v8::Undefined(); | 411 return v8::Undefined(); |
| 425 } | 412 } |
| OLD | NEW |