Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(104)

Side by Side Diff: chrome/browser/devtools/devtools_window.cc

Issue 11624036: Move the parsing of homepage_url" and "devtools_page" out of Extension. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: patch-rebased- 2 Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/extensions/api/developer_private/developer_private_api.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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/manifest_url_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
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::ManifestURL::GetDevToolsPage(*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("startPage", new StringValue(
491 new StringValue((*extension)->devtools_url().spec())); 492 extensions::ManifestURL::GetDevToolsPage(*extension).spec()));
492 extension_info->Set("name", new StringValue((*extension)->name())); 493 extension_info->Set("name", new StringValue((*extension)->name()));
493 bool allow_experimental = (*extension)->HasAPIPermission( 494 bool allow_experimental = (*extension)->HasAPIPermission(
494 extensions::APIPermission::kExperimental); 495 extensions::APIPermission::kExperimental);
495 extension_info->Set("exposeExperimentalAPIs", 496 extension_info->Set("exposeExperimentalAPIs",
496 new base::FundamentalValue(allow_experimental)); 497 new base::FundamentalValue(allow_experimental));
497 results.Append(extension_info); 498 results.Append(extension_info);
498 } 499 }
499 CallClientFunction("WebInspector.addExtensions", &results); 500 CallClientFunction("WebInspector.addExtensions", &results);
500 } 501 }
501 502
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
906 907
907 // static 908 // static
908 DevToolsDockSide DevToolsWindow::SideFromString( 909 DevToolsDockSide DevToolsWindow::SideFromString(
909 const std::string& dock_side) { 910 const std::string& dock_side) {
910 if (dock_side == kDockSideRight) 911 if (dock_side == kDockSideRight)
911 return DEVTOOLS_DOCK_SIDE_RIGHT; 912 return DEVTOOLS_DOCK_SIDE_RIGHT;
912 if (dock_side == kDockSideBottom) 913 if (dock_side == kDockSideBottom)
913 return DEVTOOLS_DOCK_SIDE_BOTTOM; 914 return DEVTOOLS_DOCK_SIDE_BOTTOM;
914 return DEVTOOLS_DOCK_SIDE_UNDOCKED; 915 return DEVTOOLS_DOCK_SIDE_UNDOCKED;
915 } 916 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/api/developer_private/developer_private_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698