Index: chrome/browser/search_engines/search_provider_install_data.cc |
diff --git a/chrome/browser/search_engines/search_provider_install_data.cc b/chrome/browser/search_engines/search_provider_install_data.cc |
index 4f9994ecd1ed71dc63e60ff29a7d7e21ef2ae542..3522aabe1d5a9a106f52ca59d27e1d219a9736a3 100644 |
--- a/chrome/browser/search_engines/search_provider_install_data.cc |
+++ b/chrome/browser/search_engines/search_provider_install_data.cc |
@@ -104,7 +104,8 @@ class GoogleURLObserver : public NotificationObserver { |
GoogleURLObserver( |
GoogleURLChangeNotifier* change_notifier, |
int ui_death_notification, |
- const NotificationSource& ui_death_source); |
+ const NotificationSource& ui_death_source, |
+ Profile* profile); |
// Implementation of NotificationObserver. |
virtual void Observe(int type, |
@@ -116,6 +117,7 @@ class GoogleURLObserver : public NotificationObserver { |
scoped_refptr<GoogleURLChangeNotifier> change_notifier_; |
NotificationRegistrar registrar_; |
+ Profile* const profile_; |
DISALLOW_COPY_AND_ASSIGN(GoogleURLObserver); |
}; |
@@ -123,8 +125,10 @@ class GoogleURLObserver : public NotificationObserver { |
GoogleURLObserver::GoogleURLObserver( |
GoogleURLChangeNotifier* change_notifier, |
int ui_death_notification, |
- const NotificationSource& ui_death_source) |
- : change_notifier_(change_notifier) { |
+ const NotificationSource& ui_death_source, |
+ Profile* profile) |
+ : change_notifier_(change_notifier), |
+ profile_(profile) { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
registrar_.Add(this, chrome::NOTIFICATION_GOOGLE_URL_UPDATED, |
NotificationService::AllSources()); |
@@ -137,8 +141,8 @@ void GoogleURLObserver::Observe(int type, |
if (type == chrome::NOTIFICATION_GOOGLE_URL_UPDATED) { |
BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, |
NewRunnableMethod(change_notifier_.get(), |
- &GoogleURLChangeNotifier::OnChange, |
- UIThreadSearchTermsData().GoogleBaseURLValue())); |
+ &GoogleURLChangeNotifier::OnChange, |
+ UIThreadSearchTermsData(profile_).GoogleBaseURLValue())); |
Peter Kasting
2011/08/10 20:54:06
Neither caller in this file is asking for the inst
|
} else { |
// This must be the death notification. |
delete this; |
@@ -163,14 +167,15 @@ static bool IsSameOrigin(const GURL& requested_origin, |
SearchProviderInstallData::SearchProviderInstallData( |
WebDataService* web_service, |
int ui_death_notification, |
- const NotificationSource& ui_death_source) |
+ const NotificationSource& ui_death_source, |
+ Profile* profile) |
: web_service_(web_service), |
load_handle_(0), |
- google_base_url_(UIThreadSearchTermsData().GoogleBaseURLValue()) { |
+ google_base_url_(UIThreadSearchTermsData(profile).GoogleBaseURLValue()) { |
// GoogleURLObserver is responsible for killing itself when |
// the given notification occurs. |
new GoogleURLObserver(new GoogleURLChangeNotifier(AsWeakPtr()), |
- ui_death_notification, ui_death_source); |
+ ui_death_notification, ui_death_source, profile); |
DetachFromThread(); |
} |