diff options
author | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-15 18:28:09 +0000 |
---|---|---|
committer | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-15 18:28:09 +0000 |
commit | 3dd1f6d55213a0c14590d5db0236b5472d2adfab (patch) | |
tree | 64410565ab648e88940c606c3823f2ba46c6cfa2 /chrome/browser/profile.cc | |
parent | dfaa8db80cfdf7c4f04dfedf87642a0f333da0e1 (diff) | |
download | chromium_src-3dd1f6d55213a0c14590d5db0236b5472d2adfab.zip chromium_src-3dd1f6d55213a0c14590d5db0236b5472d2adfab.tar.gz chromium_src-3dd1f6d55213a0c14590d5db0236b5472d2adfab.tar.bz2 |
Make the GoogleURLTracker only fetch the Google hostname if the user's default search engine is Google. Our existing restrictions still apply: no fetches before five seconds after startup, and no more than one fetch per run.
Because of lazy initialization everywhere, this was hairier than I'd hoped. We have to ensure we don't try to fetch until the profile has been created, lest GetDefaultRequestContext() return NULL. Note that this was actually a bug in the existing product: if you set your startup page to, say, about:blank, and started the browser and did nothing at all for five seconds, we'd crash.
BUG=1291
Review URL: http://codereview.chromium.org/1942
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2223 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/profile.cc')
-rw-r--r-- | chrome/browser/profile.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/chrome/browser/profile.cc b/chrome/browser/profile.cc index 3dd106f..28027c7 100644 --- a/chrome/browser/profile.cc +++ b/chrome/browser/profile.cc @@ -142,6 +142,9 @@ class ProfileImpl::RequestContext : public URLRequestContext, // profile - at least until we support multiple profiles. if (!default_request_context_) default_request_context_ = this; + NotificationService::current()->Notify( + NOTIFY_DEFAULT_REQUEST_CONTEXT_AVAILABLE, + NotificationService::AllSources(), NotificationService::NoDetails()); // Register for notifications about prefs. prefs_->AddPrefObserver(prefs::kAcceptLanguages, this); @@ -707,7 +710,8 @@ URLRequestContext* ProfileImpl::GetRequestContext() { file_util::AppendToPath(&cookie_path, chrome::kCookieFilename); std::wstring cache_path = GetPath(); file_util::AppendToPath(&cache_path, chrome::kCacheDirname); - request_context_ = new ProfileImpl::RequestContext(cookie_path, cache_path, GetPrefs()); + request_context_ = + new ProfileImpl::RequestContext(cookie_path, cache_path, GetPrefs()); request_context_->AddRef(); DCHECK(request_context_->cookie_store()); |