summaryrefslogtreecommitdiffstats
path: root/chrome/browser/dom_ui
diff options
context:
space:
mode:
authoreroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-11 19:17:54 +0000
committereroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-11 19:17:54 +0000
commite4afd59066bb43990b2f5142262f7a31fd5e17e4 (patch)
tree3459676a47bfe904c96d41420949f81c2b3f23d3 /chrome/browser/dom_ui
parent4148ee871dc3edbc2032a519d3719d240f9b5068 (diff)
downloadchromium_src-e4afd59066bb43990b2f5142262f7a31fd5e17e4.zip
chromium_src-e4afd59066bb43990b2f5142262f7a31fd5e17e4.tar.gz
chromium_src-e4afd59066bb43990b2f5142262f7a31fd5e17e4.tar.bz2
Fix-up the URL provided to the connection test runner, so users can enter partial URLs like "www.google.com" (instead of the exact URL, "http://www.google.com").
Review URL: http://codereview.chromium.org/1985012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46949 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/dom_ui')
-rw-r--r--chrome/browser/dom_ui/net_internals_ui.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/chrome/browser/dom_ui/net_internals_ui.cc b/chrome/browser/dom_ui/net_internals_ui.cc
index 8ddad85..b74c264 100644
--- a/chrome/browser/dom_ui/net_internals_ui.cc
+++ b/chrome/browser/dom_ui/net_internals_ui.cc
@@ -16,6 +16,7 @@
#include "base/singleton.h"
#include "base/string_piece.h"
#include "base/string_util.h"
+#include "base/utf_string_conversions.h"
#include "base/values.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chrome_thread.h"
@@ -24,6 +25,7 @@
#include "chrome/browser/net/chrome_net_log.h"
#include "chrome/browser/net/connection_tester.h"
#include "chrome/browser/net/passive_log_collector.h"
+#include "chrome/browser/net/url_fixer_upper.h"
#include "chrome/browser/profile.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/net/url_request_context_getter.h"
@@ -100,7 +102,9 @@ Value* EntryToDictionaryValue(net::NetLog::EventType type,
Value* ExperimentToValue(const ConnectionTester::Experiment& experiment) {
DictionaryValue* dict = new DictionaryValue();
- dict->SetString(L"url", experiment.url.spec());
+
+ if (experiment.url.is_valid())
+ dict->SetString(L"url", experiment.url.spec());
dict->SetStringFromUTF16(
L"proxy_settings_experiment",
@@ -716,7 +720,9 @@ void NetInternalsMessageHandler::IOThreadImpl::OnStartConnectionTests(
list->GetStringAsUTF16(0, &url_str);
}
- GURL url(url_str);
+ // Try to fix-up the user provided URL into something valid.
+ // For example, turn "www.google.com" into "http://www.google.com".
+ GURL url(URLFixerUpper::FixupURL(UTF16ToUTF8(url_str), std::string()));
connection_tester_.reset(new ConnectionTester(this));
connection_tester_->RunAllTests(url);