| 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" |
| 11 #include "base/stringprintf.h" | 11 #include "base/stringprintf.h" |
| 12 #include "base/utf_string_conversions.h" | 12 #include "base/utf_string_conversions.h" |
| 13 #include "base/values.h" | 13 #include "base/values.h" |
| 14 #include "chrome/browser/browser_process.h" | 14 #include "chrome/browser/browser_process.h" |
| 15 #include "chrome/browser/debugger/devtools_window.h" | 15 #include "chrome/browser/debugger/devtools_window.h" |
| 16 #include "chrome/browser/extensions/extension_service.h" | 16 #include "chrome/browser/extensions/extension_service.h" |
| 17 #include "chrome/browser/file_select_helper.h" | 17 #include "chrome/browser/file_select_helper.h" |
| 18 #include "chrome/browser/prefs/pref_service.h" | 18 #include "chrome/browser/prefs/pref_service.h" |
| 19 #include "chrome/browser/prefs/scoped_user_pref_update.h" | 19 #include "chrome/browser/prefs/scoped_user_pref_update.h" |
| 20 #include "chrome/browser/profiles/profile.h" | 20 #include "chrome/browser/profiles/profile.h" |
| 21 #include "chrome/browser/sessions/restore_tab_helper.h" | 21 #include "chrome/browser/sessions/session_tab_helper.h" |
| 22 #include "chrome/browser/themes/theme_service.h" | 22 #include "chrome/browser/themes/theme_service.h" |
| 23 #include "chrome/browser/themes/theme_service_factory.h" | 23 #include "chrome/browser/themes/theme_service_factory.h" |
| 24 #include "chrome/browser/ui/browser.h" | 24 #include "chrome/browser/ui/browser.h" |
| 25 #include "chrome/browser/ui/browser_list.h" | 25 #include "chrome/browser/ui/browser_list.h" |
| 26 #include "chrome/browser/ui/browser_tabstrip.h" | 26 #include "chrome/browser/ui/browser_tabstrip.h" |
| 27 #include "chrome/browser/ui/browser_window.h" | 27 #include "chrome/browser/ui/browser_window.h" |
| 28 #include "chrome/browser/ui/tab_contents/tab_contents.h" | 28 #include "chrome/browser/ui/tab_contents/tab_contents.h" |
| 29 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 29 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 30 #include "chrome/common/chrome_notification_types.h" | 30 #include "chrome/common/chrome_notification_types.h" |
| 31 #include "chrome/common/chrome_switches.h" | 31 #include "chrome/common/chrome_switches.h" |
| (...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 421 | 421 |
| 422 void DevToolsWindow::UpdateFrontendAttachedState() { | 422 void DevToolsWindow::UpdateFrontendAttachedState() { |
| 423 base::FundamentalValue docked(docked_); | 423 base::FundamentalValue docked(docked_); |
| 424 CallClientFunction("InspectorFrontendAPI.setAttachedWindow", &docked); | 424 CallClientFunction("InspectorFrontendAPI.setAttachedWindow", &docked); |
| 425 } | 425 } |
| 426 | 426 |
| 427 | 427 |
| 428 void DevToolsWindow::AddDevToolsExtensionsToClient() { | 428 void DevToolsWindow::AddDevToolsExtensionsToClient() { |
| 429 if (inspected_tab_) { | 429 if (inspected_tab_) { |
| 430 base::FundamentalValue tabId( | 430 base::FundamentalValue tabId( |
| 431 inspected_tab_->restore_tab_helper()->session_id().id()); | 431 inspected_tab_->session_tab_helper()->session_id().id()); |
| 432 CallClientFunction("WebInspector.setInspectedTabId", &tabId); | 432 CallClientFunction("WebInspector.setInspectedTabId", &tabId); |
| 433 } | 433 } |
| 434 ListValue results; | 434 ListValue results; |
| 435 const ExtensionService* extension_service = | 435 const ExtensionService* extension_service = |
| 436 tab_contents_->profile()->GetOriginalProfile()->GetExtensionService(); | 436 tab_contents_->profile()->GetOriginalProfile()->GetExtensionService(); |
| 437 if (!extension_service) | 437 if (!extension_service) |
| 438 return; | 438 return; |
| 439 | 439 |
| 440 const ExtensionSet* extensions = extension_service->extensions(); | 440 const ExtensionSet* extensions = extension_service->extensions(); |
| 441 | 441 |
| (...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 765 FileSelectHelper::RunFileChooser(web_contents, params); | 765 FileSelectHelper::RunFileChooser(web_contents, params); |
| 766 } | 766 } |
| 767 | 767 |
| 768 void DevToolsWindow::UpdateBrowserToolbar() { | 768 void DevToolsWindow::UpdateBrowserToolbar() { |
| 769 if (!inspected_tab_) | 769 if (!inspected_tab_) |
| 770 return; | 770 return; |
| 771 BrowserWindow* inspected_window = GetInspectedBrowserWindow(); | 771 BrowserWindow* inspected_window = GetInspectedBrowserWindow(); |
| 772 if (inspected_window) | 772 if (inspected_window) |
| 773 inspected_window->UpdateToolbar(inspected_tab_, false); | 773 inspected_window->UpdateToolbar(inspected_tab_, false); |
| 774 } | 774 } |
| OLD | NEW |