| 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/extension_urls/extension_urls_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.h" | 38 #include "content/public/browser/devtools_agent_host.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 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 477 Profile::FromBrowserContext(web_contents_->GetBrowserContext()); | 478 Profile::FromBrowserContext(web_contents_->GetBrowserContext()); |
| 478 const ExtensionService* extension_service = extensions::ExtensionSystem::Get( | 479 const ExtensionService* extension_service = extensions::ExtensionSystem::Get( |
| 479 profile->GetOriginalProfile())->extension_service(); | 480 profile->GetOriginalProfile())->extension_service(); |
| 480 if (!extension_service) | 481 if (!extension_service) |
| 481 return; | 482 return; |
| 482 | 483 |
| 483 const ExtensionSet* extensions = extension_service->extensions(); | 484 const ExtensionSet* extensions = extension_service->extensions(); |
| 484 | 485 |
| 485 for (ExtensionSet::const_iterator extension = extensions->begin(); | 486 for (ExtensionSet::const_iterator extension = extensions->begin(); |
| 486 extension != extensions->end(); ++extension) { | 487 extension != extensions->end(); ++extension) { |
| 487 if ((*extension)->devtools_url().is_empty()) | 488 if (extensions::ExtensionURL::GetDevToolsURL(*extension).is_empty()) |
| 488 continue; | 489 continue; |
| 489 DictionaryValue* extension_info = new DictionaryValue(); | 490 DictionaryValue* extension_info = new DictionaryValue(); |
| 490 extension_info->Set("startPage", | 491 extension_info->Set( |
| 491 new StringValue((*extension)->devtools_url().spec())); | 492 "startPage", |
| 493 new StringValue( |
| 494 extensions::ExtensionURL::GetDevToolsURL(*extension).spec())); |
| 492 extension_info->Set("name", new StringValue((*extension)->name())); | 495 extension_info->Set("name", new StringValue((*extension)->name())); |
| 493 bool allow_experimental = (*extension)->HasAPIPermission( | 496 bool allow_experimental = (*extension)->HasAPIPermission( |
| 494 extensions::APIPermission::kExperimental); | 497 extensions::APIPermission::kExperimental); |
| 495 extension_info->Set("exposeExperimentalAPIs", | 498 extension_info->Set("exposeExperimentalAPIs", |
| 496 new base::FundamentalValue(allow_experimental)); | 499 new base::FundamentalValue(allow_experimental)); |
| 497 results.Append(extension_info); | 500 results.Append(extension_info); |
| 498 } | 501 } |
| 499 CallClientFunction("WebInspector.addExtensions", &results); | 502 CallClientFunction("WebInspector.addExtensions", &results); |
| 500 } | 503 } |
| 501 | 504 |
| (...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 906 | 909 |
| 907 // static | 910 // static |
| 908 DevToolsDockSide DevToolsWindow::SideFromString( | 911 DevToolsDockSide DevToolsWindow::SideFromString( |
| 909 const std::string& dock_side) { | 912 const std::string& dock_side) { |
| 910 if (dock_side == kDockSideRight) | 913 if (dock_side == kDockSideRight) |
| 911 return DEVTOOLS_DOCK_SIDE_RIGHT; | 914 return DEVTOOLS_DOCK_SIDE_RIGHT; |
| 912 if (dock_side == kDockSideBottom) | 915 if (dock_side == kDockSideBottom) |
| 913 return DEVTOOLS_DOCK_SIDE_BOTTOM; | 916 return DEVTOOLS_DOCK_SIDE_BOTTOM; |
| 914 return DEVTOOLS_DOCK_SIDE_UNDOCKED; | 917 return DEVTOOLS_DOCK_SIDE_UNDOCKED; |
| 915 } | 918 } |
| OLD | NEW |