OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/json/json_writer.h" | 6 #include "base/json/json_writer.h" |
7 #include "base/string_number_conversions.h" | 7 #include "base/string_number_conversions.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 if (is_loaded_) | 349 if (is_loaded_) |
350 DoAction(); | 350 DoAction(); |
351 } | 351 } |
352 | 352 |
353 void DevToolsWindow::DoAction() { | 353 void DevToolsWindow::DoAction() { |
354 UpdateFrontendAttachedState(); | 354 UpdateFrontendAttachedState(); |
355 // TODO: these messages should be pushed through the WebKit API instead. | 355 // TODO: these messages should be pushed through the WebKit API instead. |
356 switch (action_on_load_) { | 356 switch (action_on_load_) { |
357 case DEVTOOLS_TOGGLE_ACTION_SHOW_CONSOLE: | 357 case DEVTOOLS_TOGGLE_ACTION_SHOW_CONSOLE: |
358 tab_contents_->render_view_host()->ExecuteJavascriptInWebFrame( | 358 tab_contents_->render_view_host()->ExecuteJavascriptInWebFrame( |
359 string16(), ASCIIToUTF16("WebInspector.showConsole();")); | 359 string16(), ASCIIToUTF16("WebInspector.toggleConsole();")); |
360 break; | 360 break; |
361 case DEVTOOLS_TOGGLE_ACTION_INSPECT: | 361 case DEVTOOLS_TOGGLE_ACTION_INSPECT: |
362 tab_contents_->render_view_host()->ExecuteJavascriptInWebFrame( | 362 tab_contents_->render_view_host()->ExecuteJavascriptInWebFrame( |
363 string16(), ASCIIToUTF16("WebInspector.toggleSearchingForNode();")); | 363 string16(), ASCIIToUTF16("WebInspector.toggleSearchingForNode();")); |
364 case DEVTOOLS_TOGGLE_ACTION_NONE: | 364 case DEVTOOLS_TOGGLE_ACTION_NONE: |
365 // Do nothing. | 365 // Do nothing. |
366 break; | 366 break; |
367 default: | 367 default: |
368 NOTREACHED(); | 368 NOTREACHED(); |
369 } | 369 } |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
439 return false; | 439 return false; |
440 } | 440 } |
441 | 441 |
442 void DevToolsWindow::HandleKeyboardEvent(const NativeWebKeyboardEvent& event) { | 442 void DevToolsWindow::HandleKeyboardEvent(const NativeWebKeyboardEvent& event) { |
443 if (docked_) { | 443 if (docked_) { |
444 BrowserWindow* inspected_window = GetInspectedBrowserWindow(); | 444 BrowserWindow* inspected_window = GetInspectedBrowserWindow(); |
445 if (inspected_window) | 445 if (inspected_window) |
446 inspected_window->HandleKeyboardEvent(event); | 446 inspected_window->HandleKeyboardEvent(event); |
447 } | 447 } |
448 } | 448 } |
OLD | NEW |