| 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 12 matching lines...) Expand all Loading... |
| 23 #include "chrome/browser/sessions/session_tab_helper.h" | 23 #include "chrome/browser/sessions/session_tab_helper.h" |
| 24 #include "chrome/browser/themes/theme_service.h" | 24 #include "chrome/browser/themes/theme_service.h" |
| 25 #include "chrome/browser/themes/theme_service_factory.h" | 25 #include "chrome/browser/themes/theme_service_factory.h" |
| 26 #include "chrome/browser/ui/browser.h" | 26 #include "chrome/browser/ui/browser.h" |
| 27 #include "chrome/browser/ui/browser_list.h" | 27 #include "chrome/browser/ui/browser_list.h" |
| 28 #include "chrome/browser/ui/browser_list_impl.h" | 28 #include "chrome/browser/ui/browser_list_impl.h" |
| 29 #include "chrome/browser/ui/browser_window.h" | 29 #include "chrome/browser/ui/browser_window.h" |
| 30 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 30 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 31 #include "chrome/common/chrome_notification_types.h" | 31 #include "chrome/common/chrome_notification_types.h" |
| 32 #include "chrome/common/chrome_switches.h" | 32 #include "chrome/common/chrome_switches.h" |
| 33 #include "chrome/common/extensions/api/devtools/devtools_page_handler.h" |
| 33 #include "chrome/common/pref_names.h" | 34 #include "chrome/common/pref_names.h" |
| 34 #include "chrome/common/render_messages.h" | 35 #include "chrome/common/render_messages.h" |
| 35 #include "chrome/common/url_constants.h" | 36 #include "chrome/common/url_constants.h" |
| 36 #include "content/public/browser/content_browser_client.h" | 37 #include "content/public/browser/content_browser_client.h" |
| 37 #include "content/public/browser/devtools_agent_host_registry.h" | 38 #include "content/public/browser/devtools_agent_host_registry.h" |
| 38 #include "content/public/browser/devtools_manager.h" | 39 #include "content/public/browser/devtools_manager.h" |
| 39 #include "content/public/browser/favicon_status.h" | 40 #include "content/public/browser/favicon_status.h" |
| 40 #include "content/public/browser/load_notification_details.h" | 41 #include "content/public/browser/load_notification_details.h" |
| 41 #include "content/public/browser/navigation_controller.h" | 42 #include "content/public/browser/navigation_controller.h" |
| 42 #include "content/public/browser/navigation_entry.h" | 43 #include "content/public/browser/navigation_entry.h" |
| (...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 480 Profile::FromBrowserContext(web_contents_->GetBrowserContext()); | 481 Profile::FromBrowserContext(web_contents_->GetBrowserContext()); |
| 481 const ExtensionService* extension_service = extensions::ExtensionSystem::Get( | 482 const ExtensionService* extension_service = extensions::ExtensionSystem::Get( |
| 482 profile->GetOriginalProfile())->extension_service(); | 483 profile->GetOriginalProfile())->extension_service(); |
| 483 if (!extension_service) | 484 if (!extension_service) |
| 484 return; | 485 return; |
| 485 | 486 |
| 486 const ExtensionSet* extensions = extension_service->extensions(); | 487 const ExtensionSet* extensions = extension_service->extensions(); |
| 487 | 488 |
| 488 for (ExtensionSet::const_iterator extension = extensions->begin(); | 489 for (ExtensionSet::const_iterator extension = extensions->begin(); |
| 489 extension != extensions->end(); ++extension) { | 490 extension != extensions->end(); ++extension) { |
| 490 if ((*extension)->devtools_url().is_empty()) | 491 if (extensions::DevtoolsPageInfo::devtools_url(*extension).is_empty()) |
| 491 continue; | 492 continue; |
| 492 DictionaryValue* extension_info = new DictionaryValue(); | 493 DictionaryValue* extension_info = new DictionaryValue(); |
| 493 extension_info->Set("startPage", | 494 extension_info->Set("startPage", new StringValue( |
| 494 new StringValue((*extension)->devtools_url().spec())); | 495 extensions::DevtoolsPageInfo::devtools_url(*extension).spec())); |
| 495 extension_info->Set("name", new StringValue((*extension)->name())); | 496 extension_info->Set("name", new StringValue((*extension)->name())); |
| 496 bool allow_experimental = (*extension)->HasAPIPermission( | 497 bool allow_experimental = (*extension)->HasAPIPermission( |
| 497 extensions::APIPermission::kExperimental); | 498 extensions::APIPermission::kExperimental); |
| 498 extension_info->Set("exposeExperimentalAPIs", | 499 extension_info->Set("exposeExperimentalAPIs", |
| 499 new base::FundamentalValue(allow_experimental)); | 500 new base::FundamentalValue(allow_experimental)); |
| 500 results.Append(extension_info); | 501 results.Append(extension_info); |
| 501 } | 502 } |
| 502 CallClientFunction("WebInspector.addExtensions", &results); | 503 CallClientFunction("WebInspector.addExtensions", &results); |
| 503 } | 504 } |
| 504 | 505 |
| (...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 905 | 906 |
| 906 // static | 907 // static |
| 907 DevToolsDockSide DevToolsWindow::SideFromString( | 908 DevToolsDockSide DevToolsWindow::SideFromString( |
| 908 const std::string& dock_side) { | 909 const std::string& dock_side) { |
| 909 if (dock_side == kDockSideRight) | 910 if (dock_side == kDockSideRight) |
| 910 return DEVTOOLS_DOCK_SIDE_RIGHT; | 911 return DEVTOOLS_DOCK_SIDE_RIGHT; |
| 911 if (dock_side == kDockSideBottom) | 912 if (dock_side == kDockSideBottom) |
| 912 return DEVTOOLS_DOCK_SIDE_BOTTOM; | 913 return DEVTOOLS_DOCK_SIDE_BOTTOM; |
| 913 return DEVTOOLS_DOCK_SIDE_UNDOCKED; | 914 return DEVTOOLS_DOCK_SIDE_UNDOCKED; |
| 914 } | 915 } |
| OLD | NEW |