| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <algorithm> | 5 #include <algorithm> |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/json/json_writer.h" | 8 #include "base/json/json_writer.h" |
| 9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
| (...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 570 SkColor color_tab_text = | 570 SkColor color_tab_text = |
| 571 tp->GetColor(ThemeService::COLOR_BOOKMARK_TEXT); | 571 tp->GetColor(ThemeService::COLOR_BOOKMARK_TEXT); |
| 572 std::string command = StringPrintf( | 572 std::string command = StringPrintf( |
| 573 "InspectorFrontendAPI.setToolbarColors(\"%s\", \"%s\")", | 573 "InspectorFrontendAPI.setToolbarColors(\"%s\", \"%s\")", |
| 574 SkColorToRGBAString(color_toolbar).c_str(), | 574 SkColorToRGBAString(color_toolbar).c_str(), |
| 575 SkColorToRGBAString(color_tab_text).c_str()); | 575 SkColorToRGBAString(color_tab_text).c_str()); |
| 576 tab_contents_->web_contents()->GetRenderViewHost()-> | 576 tab_contents_->web_contents()->GetRenderViewHost()-> |
| 577 ExecuteJavascriptInWebFrame(string16(), UTF8ToUTF16(command)); | 577 ExecuteJavascriptInWebFrame(string16(), UTF8ToUTF16(command)); |
| 578 } | 578 } |
| 579 | 579 |
| 580 void DevToolsWindow::AddNewContents(WebContents* source, | 580 bool DevToolsWindow::AddNewContents(WebContents* source, |
| 581 WebContents* new_contents, | 581 WebContents* new_contents, |
| 582 WindowOpenDisposition disposition, | 582 WindowOpenDisposition disposition, |
| 583 const gfx::Rect& initial_pos, | 583 const gfx::Rect& initial_pos, |
| 584 bool user_gesture) { | 584 bool user_gesture) { |
| 585 if (inspected_tab_) { | 585 if (inspected_tab_) { |
| 586 inspected_tab_->web_contents()->GetDelegate()->AddNewContents( | 586 return inspected_tab_->web_contents()->GetDelegate()->AddNewContents( |
| 587 source, new_contents, disposition, initial_pos, user_gesture); | 587 source, new_contents, disposition, initial_pos, user_gesture); |
| 588 } | 588 } |
| 589 return true; |
| 589 } | 590 } |
| 590 | 591 |
| 591 bool DevToolsWindow::PreHandleKeyboardEvent( | 592 bool DevToolsWindow::PreHandleKeyboardEvent( |
| 592 content::WebContents* source, | 593 content::WebContents* source, |
| 593 const NativeWebKeyboardEvent& event, bool* is_keyboard_shortcut) { | 594 const NativeWebKeyboardEvent& event, bool* is_keyboard_shortcut) { |
| 594 if (docked_) { | 595 if (docked_) { |
| 595 BrowserWindow* inspected_window = GetInspectedBrowserWindow(); | 596 BrowserWindow* inspected_window = GetInspectedBrowserWindow(); |
| 596 if (inspected_window) | 597 if (inspected_window) |
| 597 return inspected_window->PreHandleKeyboardEvent( | 598 return inspected_window->PreHandleKeyboardEvent( |
| 598 event, is_keyboard_shortcut); | 599 event, is_keyboard_shortcut); |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 765 FileSelectHelper::RunFileChooser(web_contents, params); | 766 FileSelectHelper::RunFileChooser(web_contents, params); |
| 766 } | 767 } |
| 767 | 768 |
| 768 void DevToolsWindow::UpdateBrowserToolbar() { | 769 void DevToolsWindow::UpdateBrowserToolbar() { |
| 769 if (!inspected_tab_) | 770 if (!inspected_tab_) |
| 770 return; | 771 return; |
| 771 BrowserWindow* inspected_window = GetInspectedBrowserWindow(); | 772 BrowserWindow* inspected_window = GetInspectedBrowserWindow(); |
| 772 if (inspected_window) | 773 if (inspected_window) |
| 773 inspected_window->UpdateToolbar(inspected_tab_, false); | 774 inspected_window->UpdateToolbar(inspected_tab_, false); |
| 774 } | 775 } |
| OLD | NEW |