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

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

Issue 11783038: Allow multiple WebUIControllerFactory objects to be registered. This makes is possible to implement… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: reland after bogus revert of r175971 Created 7 years, 10 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 | Annotate | Revision Log
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 16 matching lines...) Expand all
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/extensions/manifest_url_handler.h"
34 #include "chrome/common/pref_names.h" 34 #include "chrome/common/pref_names.h"
35 #include "chrome/common/render_messages.h" 35 #include "chrome/common/render_messages.h"
36 #include "chrome/common/url_constants.h" 36 #include "chrome/common/url_constants.h"
37 #include "content/public/browser/content_browser_client.h"
38 #include "content/public/browser/devtools_agent_host.h" 37 #include "content/public/browser/devtools_agent_host.h"
39 #include "content/public/browser/devtools_manager.h" 38 #include "content/public/browser/devtools_manager.h"
40 #include "content/public/browser/favicon_status.h" 39 #include "content/public/browser/favicon_status.h"
41 #include "content/public/browser/load_notification_details.h" 40 #include "content/public/browser/load_notification_details.h"
42 #include "content/public/browser/navigation_controller.h" 41 #include "content/public/browser/navigation_controller.h"
43 #include "content/public/browser/navigation_entry.h" 42 #include "content/public/browser/navigation_entry.h"
44 #include "content/public/browser/notification_source.h" 43 #include "content/public/browser/notification_source.h"
45 #include "content/public/browser/render_process_host.h" 44 #include "content/public/browser/render_process_host.h"
46 #include "content/public/browser/render_view_host.h" 45 #include "content/public/browser/render_view_host.h"
47 #include "content/public/browser/web_contents.h" 46 #include "content/public/browser/web_contents.h"
48 #include "content/public/browser/web_contents_view.h" 47 #include "content/public/browser/web_contents_view.h"
49 #include "content/public/common/bindings_policy.h" 48 #include "content/public/common/bindings_policy.h"
50 #include "content/public/common/content_client.h" 49 #include "content/public/common/content_client.h"
51 #include "content/public/common/page_transition_types.h" 50 #include "content/public/common/page_transition_types.h"
51 #include "content/public/common/url_constants.h"
52 #include "grit/generated_resources.h" 52 #include "grit/generated_resources.h"
53 53
54 typedef std::vector<DevToolsWindow*> DevToolsWindowList; 54 typedef std::vector<DevToolsWindow*> DevToolsWindowList;
55 namespace { 55 namespace {
56 base::LazyInstance<DevToolsWindowList>::Leaky 56 base::LazyInstance<DevToolsWindowList>::Leaky
57 g_instances = LAZY_INSTANCE_INITIALIZER; 57 g_instances = LAZY_INSTANCE_INITIALIZER;
58 } // namespace 58 } // namespace
59 59
60 using base::Bind; 60 using base::Bind;
61 using content::DevToolsAgentHost; 61 using content::DevToolsAgentHost;
(...skipping 783 matching lines...) Expand 10 before | Expand all | Expand 10 after
845 DictionaryValue* file_system_value = new DictionaryValue(); 845 DictionaryValue* file_system_value = new DictionaryValue();
846 file_system_value->SetString("fileSystemName", file_system.file_system_name); 846 file_system_value->SetString("fileSystemName", file_system.file_system_name);
847 file_system_value->SetString("rootURL", file_system.root_url); 847 file_system_value->SetString("rootURL", file_system.root_url);
848 file_system_value->SetString("fileSystemPath", file_system.file_system_path); 848 file_system_value->SetString("fileSystemPath", file_system.file_system_path);
849 return file_system_value; 849 return file_system_value;
850 } 850 }
851 851
852 } // namespace 852 } // namespace
853 853
854 void DevToolsWindow::RequestFileSystems() { 854 void DevToolsWindow::RequestFileSystems() {
855 CHECK(content::GetContentClient()->HasWebUIScheme(web_contents_->GetURL())); 855 CHECK(content::HasWebUIScheme(web_contents_->GetURL()));
856 file_helper_->RequestFileSystems( 856 file_helper_->RequestFileSystems(
857 Bind(&DevToolsWindow::FileSystemsLoaded, weak_factory_.GetWeakPtr())); 857 Bind(&DevToolsWindow::FileSystemsLoaded, weak_factory_.GetWeakPtr()));
858 } 858 }
859 859
860 void DevToolsWindow::AddFileSystem() { 860 void DevToolsWindow::AddFileSystem() {
861 CHECK(content::GetContentClient()->HasWebUIScheme(web_contents_->GetURL())); 861 CHECK(content::HasWebUIScheme(web_contents_->GetURL()));
862 file_helper_->AddFileSystem( 862 file_helper_->AddFileSystem(
863 Bind(&DevToolsWindow::FileSystemAdded, weak_factory_.GetWeakPtr())); 863 Bind(&DevToolsWindow::FileSystemAdded, weak_factory_.GetWeakPtr()));
864 } 864 }
865 865
866 void DevToolsWindow::RemoveFileSystem(const std::string& file_system_path) { 866 void DevToolsWindow::RemoveFileSystem(const std::string& file_system_path) {
867 CHECK(content::GetContentClient()->HasWebUIScheme(web_contents_->GetURL())); 867 CHECK(content::HasWebUIScheme(web_contents_->GetURL()));
868 file_helper_->RemoveFileSystem(file_system_path); 868 file_helper_->RemoveFileSystem(file_system_path);
869 StringValue file_system_path_value(file_system_path); 869 StringValue file_system_path_value(file_system_path);
870 CallClientFunction("InspectorFrontendAPI.fileSystemRemoved", 870 CallClientFunction("InspectorFrontendAPI.fileSystemRemoved",
871 &file_system_path_value); 871 &file_system_path_value);
872 } 872 }
873 873
874 void DevToolsWindow::FileSavedAs(const std::string& url) { 874 void DevToolsWindow::FileSavedAs(const std::string& url) {
875 StringValue url_value(url); 875 StringValue url_value(url);
876 CallClientFunction("InspectorFrontendAPI.savedURL", &url_value); 876 CallClientFunction("InspectorFrontendAPI.savedURL", &url_value);
877 } 877 }
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
975 975
976 // static 976 // static
977 DevToolsDockSide DevToolsWindow::SideFromString( 977 DevToolsDockSide DevToolsWindow::SideFromString(
978 const std::string& dock_side) { 978 const std::string& dock_side) {
979 if (dock_side == kDockSideRight) 979 if (dock_side == kDockSideRight)
980 return DEVTOOLS_DOCK_SIDE_RIGHT; 980 return DEVTOOLS_DOCK_SIDE_RIGHT;
981 if (dock_side == kDockSideBottom) 981 if (dock_side == kDockSideBottom)
982 return DEVTOOLS_DOCK_SIDE_BOTTOM; 982 return DEVTOOLS_DOCK_SIDE_BOTTOM;
983 return DEVTOOLS_DOCK_SIDE_UNDOCKED; 983 return DEVTOOLS_DOCK_SIDE_UNDOCKED;
984 } 984 }
OLDNEW
« no previous file with comments | « chrome/browser/devtools/devtools_file_helper.cc ('k') | chrome/browser/extensions/api/debugger/debugger_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698