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 "chrome/browser/ui/webui/net_internals/net_internals_ui.h" | 5 #include "chrome/browser/ui/webui/net_internals/net_internals_ui.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <list> | 8 #include <list> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 28 matching lines...) Expand all Loading... |
39 #include "chrome/browser/net/chrome_net_log.h" | 39 #include "chrome/browser/net/chrome_net_log.h" |
40 #include "chrome/browser/net/chrome_network_delegate.h" | 40 #include "chrome/browser/net/chrome_network_delegate.h" |
41 #include "chrome/browser/net/connection_tester.h" | 41 #include "chrome/browser/net/connection_tester.h" |
42 #include "chrome/browser/prerender/prerender_manager.h" | 42 #include "chrome/browser/prerender/prerender_manager.h" |
43 #include "chrome/browser/prerender/prerender_manager_factory.h" | 43 #include "chrome/browser/prerender/prerender_manager_factory.h" |
44 #include "chrome/browser/profiles/profile.h" | 44 #include "chrome/browser/profiles/profile.h" |
45 #include "chrome/browser/ui/webui/extensions/extension_basic_info.h" | 45 #include "chrome/browser/ui/webui/extensions/extension_basic_info.h" |
46 #include "chrome/common/cancelable_task_tracker.h" | 46 #include "chrome/common/cancelable_task_tracker.h" |
47 #include "chrome/common/chrome_paths.h" | 47 #include "chrome/common/chrome_paths.h" |
48 #include "chrome/common/chrome_version_info.h" | 48 #include "chrome/common/chrome_version_info.h" |
49 #include "chrome/common/extensions/extension_set.h" | |
50 #include "chrome/common/logging_chrome.h" | 49 #include "chrome/common/logging_chrome.h" |
51 #include "chrome/common/net/url_fixer_upper.h" | 50 #include "chrome/common/net/url_fixer_upper.h" |
52 #include "chrome/common/pref_names.h" | 51 #include "chrome/common/pref_names.h" |
53 #include "chrome/common/url_constants.h" | 52 #include "chrome/common/url_constants.h" |
54 #include "components/onc/onc_constants.h" | 53 #include "components/onc/onc_constants.h" |
55 #include "content/public/browser/browser_thread.h" | 54 #include "content/public/browser/browser_thread.h" |
56 #include "content/public/browser/notification_details.h" | 55 #include "content/public/browser/notification_details.h" |
57 #include "content/public/browser/resource_dispatcher_host.h" | 56 #include "content/public/browser/resource_dispatcher_host.h" |
58 #include "content/public/browser/web_contents.h" | 57 #include "content/public/browser/web_contents.h" |
59 #include "content/public/browser/web_ui.h" | 58 #include "content/public/browser/web_ui.h" |
60 #include "content/public/browser/web_ui_data_source.h" | 59 #include "content/public/browser/web_ui_data_source.h" |
61 #include "content/public/browser/web_ui_message_handler.h" | 60 #include "content/public/browser/web_ui_message_handler.h" |
| 61 #include "extensions/common/extension_set.h" |
62 #include "grit/generated_resources.h" | 62 #include "grit/generated_resources.h" |
63 #include "grit/net_internals_resources.h" | 63 #include "grit/net_internals_resources.h" |
64 #include "net/base/net_errors.h" | 64 #include "net/base/net_errors.h" |
65 #include "net/base/net_log_logger.h" | 65 #include "net/base/net_log_logger.h" |
66 #include "net/base/net_util.h" | 66 #include "net/base/net_util.h" |
67 #include "net/disk_cache/disk_cache.h" | 67 #include "net/disk_cache/disk_cache.h" |
68 #include "net/dns/host_cache.h" | 68 #include "net/dns/host_cache.h" |
69 #include "net/dns/host_resolver.h" | 69 #include "net/dns/host_resolver.h" |
70 #include "net/http/http_cache.h" | 70 #include "net/http/http_cache.h" |
71 #include "net/http/http_network_layer.h" | 71 #include "net/http/http_network_layer.h" |
(...skipping 774 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
846 | 846 |
847 void NetInternalsMessageHandler::OnGetExtensionInfo(const ListValue* list) { | 847 void NetInternalsMessageHandler::OnGetExtensionInfo(const ListValue* list) { |
848 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 848 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
849 ListValue* extension_list = new ListValue(); | 849 ListValue* extension_list = new ListValue(); |
850 Profile* profile = Profile::FromWebUI(web_ui()); | 850 Profile* profile = Profile::FromWebUI(web_ui()); |
851 extensions::ExtensionSystem* extension_system = | 851 extensions::ExtensionSystem* extension_system = |
852 extensions::ExtensionSystem::Get(profile); | 852 extensions::ExtensionSystem::Get(profile); |
853 if (extension_system) { | 853 if (extension_system) { |
854 ExtensionService* extension_service = extension_system->extension_service(); | 854 ExtensionService* extension_service = extension_system->extension_service(); |
855 if (extension_service) { | 855 if (extension_service) { |
856 scoped_ptr<const ExtensionSet> extensions( | 856 scoped_ptr<const extensions::ExtensionSet> extensions( |
857 extension_service->GenerateInstalledExtensionsSet()); | 857 extension_service->GenerateInstalledExtensionsSet()); |
858 for (ExtensionSet::const_iterator it = extensions->begin(); | 858 for (extensions::ExtensionSet::const_iterator it = extensions->begin(); |
859 it != extensions->end(); ++it) { | 859 it != extensions->end(); ++it) { |
860 DictionaryValue* extension_info = new DictionaryValue(); | 860 DictionaryValue* extension_info = new DictionaryValue(); |
861 bool enabled = extension_service->IsExtensionEnabled((*it)->id()); | 861 bool enabled = extension_service->IsExtensionEnabled((*it)->id()); |
862 extensions::GetExtensionBasicInfo(it->get(), enabled, extension_info); | 862 extensions::GetExtensionBasicInfo(it->get(), enabled, extension_info); |
863 extension_list->Append(extension_info); | 863 extension_list->Append(extension_info); |
864 } | 864 } |
865 } | 865 } |
866 } | 866 } |
867 SendJavascriptCommand("receivedExtensionInfo", extension_list); | 867 SendJavascriptCommand("receivedExtensionInfo", extension_list); |
868 } | 868 } |
(...skipping 967 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1836 } | 1836 } |
1837 | 1837 |
1838 NetInternalsUI::NetInternalsUI(content::WebUI* web_ui) | 1838 NetInternalsUI::NetInternalsUI(content::WebUI* web_ui) |
1839 : WebUIController(web_ui) { | 1839 : WebUIController(web_ui) { |
1840 web_ui->AddMessageHandler(new NetInternalsMessageHandler()); | 1840 web_ui->AddMessageHandler(new NetInternalsMessageHandler()); |
1841 | 1841 |
1842 // Set up the chrome://net-internals/ source. | 1842 // Set up the chrome://net-internals/ source. |
1843 Profile* profile = Profile::FromWebUI(web_ui); | 1843 Profile* profile = Profile::FromWebUI(web_ui); |
1844 content::WebUIDataSource::Add(profile, CreateNetInternalsHTMLSource()); | 1844 content::WebUIDataSource::Add(profile, CreateNetInternalsHTMLSource()); |
1845 } | 1845 } |
OLD | NEW |