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

Side by Side Diff: chrome/browser/ui/webui/net_internals/net_internals_ui.cc

Issue 320253004: Componentize URLFixerUpper. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Win64 fix Created 6 years, 6 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 "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 27 matching lines...) Expand all
38 #include "chrome/browser/net/chrome_net_log.h" 38 #include "chrome/browser/net/chrome_net_log.h"
39 #include "chrome/browser/net/chrome_network_delegate.h" 39 #include "chrome/browser/net/chrome_network_delegate.h"
40 #include "chrome/browser/net/connection_tester.h" 40 #include "chrome/browser/net/connection_tester.h"
41 #include "chrome/browser/prerender/prerender_manager.h" 41 #include "chrome/browser/prerender/prerender_manager.h"
42 #include "chrome/browser/prerender/prerender_manager_factory.h" 42 #include "chrome/browser/prerender/prerender_manager_factory.h"
43 #include "chrome/browser/profiles/profile.h" 43 #include "chrome/browser/profiles/profile.h"
44 #include "chrome/browser/ui/webui/extensions/extension_basic_info.h" 44 #include "chrome/browser/ui/webui/extensions/extension_basic_info.h"
45 #include "chrome/common/chrome_paths.h" 45 #include "chrome/common/chrome_paths.h"
46 #include "chrome/common/chrome_version_info.h" 46 #include "chrome/common/chrome_version_info.h"
47 #include "chrome/common/logging_chrome.h" 47 #include "chrome/common/logging_chrome.h"
48 #include "chrome/common/net/url_fixer_upper.h"
49 #include "chrome/common/pref_names.h" 48 #include "chrome/common/pref_names.h"
50 #include "chrome/common/url_constants.h" 49 #include "chrome/common/url_constants.h"
51 #include "components/onc/onc_constants.h" 50 #include "components/onc/onc_constants.h"
51 #include "components/url_fixer/url_fixer.h"
52 #include "content/public/browser/browser_thread.h" 52 #include "content/public/browser/browser_thread.h"
53 #include "content/public/browser/notification_details.h" 53 #include "content/public/browser/notification_details.h"
54 #include "content/public/browser/resource_dispatcher_host.h" 54 #include "content/public/browser/resource_dispatcher_host.h"
55 #include "content/public/browser/web_contents.h" 55 #include "content/public/browser/web_contents.h"
56 #include "content/public/browser/web_ui.h" 56 #include "content/public/browser/web_ui.h"
57 #include "content/public/browser/web_ui_data_source.h" 57 #include "content/public/browser/web_ui_data_source.h"
58 #include "content/public/browser/web_ui_message_handler.h" 58 #include "content/public/browser/web_ui_message_handler.h"
59 #include "extensions/browser/extension_registry.h" 59 #include "extensions/browser/extension_registry.h"
60 #include "extensions/browser/extension_system.h" 60 #include "extensions/browser/extension_system.h"
61 #include "extensions/common/extension_set.h" 61 #include "extensions/common/extension_set.h"
(...skipping 1059 matching lines...) Expand 10 before | Expand all | Expand 10 after
1121 } 1121 }
1122 1122
1123 void NetInternalsMessageHandler::IOThreadImpl::OnStartConnectionTests( 1123 void NetInternalsMessageHandler::IOThreadImpl::OnStartConnectionTests(
1124 const base::ListValue* list) { 1124 const base::ListValue* list) {
1125 // |value| should be: [<URL to test>]. 1125 // |value| should be: [<URL to test>].
1126 base::string16 url_str; 1126 base::string16 url_str;
1127 CHECK(list->GetString(0, &url_str)); 1127 CHECK(list->GetString(0, &url_str));
1128 1128
1129 // Try to fix-up the user provided URL into something valid. 1129 // Try to fix-up the user provided URL into something valid.
1130 // For example, turn "www.google.com" into "http://www.google.com". 1130 // For example, turn "www.google.com" into "http://www.google.com".
1131 GURL url(URLFixerUpper::FixupURL(base::UTF16ToUTF8(url_str), std::string())); 1131 GURL url(url_fixer::FixupURL(base::UTF16ToUTF8(url_str), std::string()));
1132 1132
1133 connection_tester_.reset(new ConnectionTester( 1133 connection_tester_.reset(new ConnectionTester(
1134 this, 1134 this,
1135 io_thread_->globals()->proxy_script_fetcher_context.get(), 1135 io_thread_->globals()->proxy_script_fetcher_context.get(),
1136 net_log())); 1136 net_log()));
1137 connection_tester_->RunAllTests(url); 1137 connection_tester_->RunAllTests(url);
1138 } 1138 }
1139 1139
1140 void NetInternalsMessageHandler::IOThreadImpl::OnHSTSQuery( 1140 void NetInternalsMessageHandler::IOThreadImpl::OnHSTSQuery(
1141 const base::ListValue* list) { 1141 const base::ListValue* list) {
(...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after
1773 } 1773 }
1774 1774
1775 NetInternalsUI::NetInternalsUI(content::WebUI* web_ui) 1775 NetInternalsUI::NetInternalsUI(content::WebUI* web_ui)
1776 : WebUIController(web_ui) { 1776 : WebUIController(web_ui) {
1777 web_ui->AddMessageHandler(new NetInternalsMessageHandler()); 1777 web_ui->AddMessageHandler(new NetInternalsMessageHandler());
1778 1778
1779 // Set up the chrome://net-internals/ source. 1779 // Set up the chrome://net-internals/ source.
1780 Profile* profile = Profile::FromWebUI(web_ui); 1780 Profile* profile = Profile::FromWebUI(web_ui);
1781 content::WebUIDataSource::Add(profile, CreateNetInternalsHTMLSource()); 1781 content::WebUIDataSource::Add(profile, CreateNetInternalsHTMLSource());
1782 } 1782 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/about_ui.cc ('k') | chrome/browser/ui/webui/options/browser_options_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698