summaryrefslogtreecommitdiffstats
path: root/chrome/browser/search_engines
diff options
context:
space:
mode:
authorukai@chromium.org <ukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-20 04:21:16 +0000
committerukai@chromium.org <ukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-20 04:21:16 +0000
commitc78b1e1619d7e700fce78f29533eba5ee78b0c70 (patch)
tree455f30adcb00e3b4cf41c392150a62722652cdf6 /chrome/browser/search_engines
parent9f602b88a2e61320d3ff3a5ef44b1714f3a60faa (diff)
downloadchromium_src-c78b1e1619d7e700fce78f29533eba5ee78b0c70.zip
chromium_src-c78b1e1619d7e700fce78f29533eba5ee78b0c70.tar.gz
chromium_src-c78b1e1619d7e700fce78f29533eba5ee78b0c70.tar.bz2
Reland r56483 - Monitor network change in GoogleURLTracker
It changes to fetch https://www.google.com/searchdomaincheck?format=domain&type=chrome instead of checking http://www.google.com/ redirection. Also show infobar if google domain has been changed to new domain and ask user to switch new domain. Fix Win IO Perf regressions: - GoogleURLTracker::RequestServerCheck() is not called in headless mode (CHROME_HEADLESS=1) nor in Chrome Frame (--chrome-frame). Fix leaks in TestingProfile::CreateRequestContext(): 52562 - Add TestURLFetcher::set_request_context() do nothing, because TestURLFetcher might miss to release core_->request_context_getter_. Fix GoogleURLTracker observer removal DCHECK: 52608 - call RemoveAll(), instead of calling Remove()s BUG=48688,15141,52477,52562,52608 TEST=unit_tests passes Review URL: http://codereview.chromium.org/3171019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56811 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/search_engines')
-rw-r--r--chrome/browser/search_engines/template_url_model.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/chrome/browser/search_engines/template_url_model.cc b/chrome/browser/search_engines/template_url_model.cc
index d777225..76a22f5 100644
--- a/chrome/browser/search_engines/template_url_model.cc
+++ b/chrome/browser/search_engines/template_url_model.cc
@@ -5,6 +5,8 @@
#include "chrome/browser/search_engines/template_url_model.h"
#include "app/l10n_util.h"
+#include "base/command_line.h"
+#include "base/environment.h"
#include "base/stl_util-inl.h"
#include "base/string_number_conversions.h"
#include "base/utf_string_conversions.h"
@@ -17,6 +19,8 @@
#include "chrome/browser/profile.h"
#include "chrome/browser/rlz/rlz.h"
#include "chrome/browser/search_engines/template_url_prepopulate_data.h"
+#include "chrome/common/chrome_switches.h"
+#include "chrome/common/env_vars.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/common/notification_service.h"
#include "chrome/common/pref_names.h"
@@ -126,9 +130,11 @@ void TemplateURLModel::Init(const Initializer* initializers,
}
// Request a server check for the correct Google URL if Google is the default
- // search engine.
+ // search engine, not in headless mode and not in Chrome Frame.
const TemplateURL* default_provider = GetDefaultSearchProvider();
- if (default_provider) {
+ scoped_ptr<base::Environment> env(base::Environment::Create());
+ if (default_provider && !env->HasVar(env_vars::kHeadless) &&
+ !CommandLine::ForCurrentProcess()->HasSwitch(switches::kChromeFrame)) {
const TemplateURLRef* default_provider_ref = default_provider->url();
if (default_provider_ref && default_provider_ref->HasGoogleBaseURLs())
GoogleURLTracker::RequestServerCheck();