| 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/stringprintf.h" | 10 #include "base/stringprintf.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "chrome/browser/prefs/scoped_user_pref_update.h" | 21 #include "chrome/browser/prefs/scoped_user_pref_update.h" |
| 22 #include "chrome/browser/profiles/profile.h" | 22 #include "chrome/browser/profiles/profile.h" |
| 23 #include "chrome/browser/sessions/session_tab_helper.h" | 23 #include "chrome/browser/sessions/session_tab_helper.h" |
| 24 #include "chrome/browser/themes/theme_properties.h" | 24 #include "chrome/browser/themes/theme_properties.h" |
| 25 #include "chrome/browser/themes/theme_service.h" | 25 #include "chrome/browser/themes/theme_service.h" |
| 26 #include "chrome/browser/themes/theme_service_factory.h" | 26 #include "chrome/browser/themes/theme_service_factory.h" |
| 27 #include "chrome/browser/ui/browser.h" | 27 #include "chrome/browser/ui/browser.h" |
| 28 #include "chrome/browser/ui/browser_iterator.h" | 28 #include "chrome/browser/ui/browser_iterator.h" |
| 29 #include "chrome/browser/ui/browser_list.h" | 29 #include "chrome/browser/ui/browser_list.h" |
| 30 #include "chrome/browser/ui/browser_window.h" | 30 #include "chrome/browser/ui/browser_window.h" |
| 31 #include "chrome/browser/ui/color_chooser.h" |
| 31 #include "chrome/browser/ui/host_desktop.h" | 32 #include "chrome/browser/ui/host_desktop.h" |
| 32 #include "chrome/browser/ui/prefs/prefs_tab_helper.h" | 33 #include "chrome/browser/ui/prefs/prefs_tab_helper.h" |
| 33 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 34 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 34 #include "chrome/browser/ui/webui/devtools_ui.h" | 35 #include "chrome/browser/ui/webui/devtools_ui.h" |
| 35 #include "chrome/common/chrome_notification_types.h" | 36 #include "chrome/common/chrome_notification_types.h" |
| 36 #include "chrome/common/chrome_switches.h" | 37 #include "chrome/common/chrome_switches.h" |
| 37 #include "chrome/common/extensions/manifest_url_handler.h" | 38 #include "chrome/common/extensions/manifest_url_handler.h" |
| 38 #include "chrome/common/pref_names.h" | 39 #include "chrome/common/pref_names.h" |
| 39 #include "chrome/common/render_messages.h" | 40 #include "chrome/common/render_messages.h" |
| 40 #include "chrome/common/url_constants.h" | 41 #include "chrome/common/url_constants.h" |
| (...skipping 986 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1027 | 1028 |
| 1028 content::JavaScriptDialogManager* DevToolsWindow::GetJavaScriptDialogManager() { | 1029 content::JavaScriptDialogManager* DevToolsWindow::GetJavaScriptDialogManager() { |
| 1029 content::WebContents* inspected_web_contents = GetInspectedWebContents(); | 1030 content::WebContents* inspected_web_contents = GetInspectedWebContents(); |
| 1030 if (inspected_web_contents && inspected_web_contents->GetDelegate()) { | 1031 if (inspected_web_contents && inspected_web_contents->GetDelegate()) { |
| 1031 return inspected_web_contents->GetDelegate()-> | 1032 return inspected_web_contents->GetDelegate()-> |
| 1032 GetJavaScriptDialogManager(); | 1033 GetJavaScriptDialogManager(); |
| 1033 } | 1034 } |
| 1034 return content::WebContentsDelegate::GetJavaScriptDialogManager(); | 1035 return content::WebContentsDelegate::GetJavaScriptDialogManager(); |
| 1035 } | 1036 } |
| 1036 | 1037 |
| 1038 content::ColorChooser* DevToolsWindow::OpenColorChooser( |
| 1039 WebContents* web_contents, SkColor initial_color) { |
| 1040 return ColorChooser::Open(web_contents, initial_color); |
| 1041 } |
| 1042 |
| 1037 void DevToolsWindow::RunFileChooser(WebContents* web_contents, | 1043 void DevToolsWindow::RunFileChooser(WebContents* web_contents, |
| 1038 const FileChooserParams& params) { | 1044 const FileChooserParams& params) { |
| 1039 FileSelectHelper::RunFileChooser(web_contents, params); | 1045 FileSelectHelper::RunFileChooser(web_contents, params); |
| 1040 } | 1046 } |
| 1041 | 1047 |
| 1042 void DevToolsWindow::WebContentsFocused(WebContents* contents) { | 1048 void DevToolsWindow::WebContentsFocused(WebContents* contents) { |
| 1043 Browser* inspected_browser = NULL; | 1049 Browser* inspected_browser = NULL; |
| 1044 int inspected_tab_index = -1; | 1050 int inspected_tab_index = -1; |
| 1045 | 1051 |
| 1046 if (IsDocked() && FindInspectedBrowserAndTabIndex(&inspected_browser, | 1052 if (IsDocked() && FindInspectedBrowserAndTabIndex(&inspected_browser, |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1100 DevToolsDockSide DevToolsWindow::SideFromString( | 1106 DevToolsDockSide DevToolsWindow::SideFromString( |
| 1101 const std::string& dock_side) { | 1107 const std::string& dock_side) { |
| 1102 if (dock_side == kDockSideRight) | 1108 if (dock_side == kDockSideRight) |
| 1103 return DEVTOOLS_DOCK_SIDE_RIGHT; | 1109 return DEVTOOLS_DOCK_SIDE_RIGHT; |
| 1104 if (dock_side == kDockSideBottom) | 1110 if (dock_side == kDockSideBottom) |
| 1105 return DEVTOOLS_DOCK_SIDE_BOTTOM; | 1111 return DEVTOOLS_DOCK_SIDE_BOTTOM; |
| 1106 if (dock_side == kDockSideMinimized) | 1112 if (dock_side == kDockSideMinimized) |
| 1107 return DEVTOOLS_DOCK_SIDE_MINIMIZED; | 1113 return DEVTOOLS_DOCK_SIDE_MINIMIZED; |
| 1108 return DEVTOOLS_DOCK_SIDE_UNDOCKED; | 1114 return DEVTOOLS_DOCK_SIDE_UNDOCKED; |
| 1109 } | 1115 } |
| OLD | NEW |