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

Unified Diff: chrome/browser/ui/webui/ntp/app_launcher_handler.cc

Issue 7799008: Fix crash on NTP related to multi-profile extensions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/browser.cc ('k') | chrome/browser/web_resource/promo_resource_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/ntp/app_launcher_handler.cc
diff --git a/chrome/browser/ui/webui/ntp/app_launcher_handler.cc b/chrome/browser/ui/webui/ntp/app_launcher_handler.cc
index 0355ee7e2ad6279726f037212487ea77ff267862..dfe024dac30dee7320c5d83a5e9e9645a53fc0b9 100644
--- a/chrome/browser/ui/webui/ntp/app_launcher_handler.cc
+++ b/chrome/browser/ui/webui/ntp/app_launcher_handler.cc
@@ -441,7 +441,8 @@ void AppLauncherHandler::HandleGetApps(const ListValue* args) {
// b) Conceptually, it doesn't really make sense to count a
// prefchange-triggered refresh as a promo 'view'.
AppsPromo* apps_promo = extension_service_->apps_promo();
- PrefService* prefs = Profile::FromWebUI(web_ui_)->GetPrefs();
+ Profile* profile = Profile::FromWebUI(web_ui_);
+ PrefService* prefs = profile->GetPrefs();
bool apps_promo_just_expired = false;
if (apps_promo->ShouldShowPromo(extension_service_->GetAppIds(),
&apps_promo_just_expired)) {
@@ -470,17 +471,17 @@ void AppLauncherHandler::HandleGetApps(const ListValue* args) {
// the apps as they change.
if (registrar_.IsEmpty()) {
registrar_.Add(this, chrome::NOTIFICATION_APP_NOTIFICATION_STATE_CHANGED,
Yoyo Zhou 2011/08/29 22:40:46 This looks like it could possibly be sent from an
jstritar 2011/08/30 15:06:31 Done.
- NotificationService::AllSources());
+ Source<Profile>(profile));
registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED,
- NotificationService::AllSources());
+ Source<Profile>(profile));
registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED,
- NotificationService::AllSources());
+ Source<Profile>(profile));
registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LAUNCHER_REORDERED,
- NotificationService::AllSources());
+ Source<ExtensionPrefs>(extension_service_->extension_prefs()));
registrar_.Add(this, chrome::NOTIFICATION_WEB_STORE_PROMO_LOADED,
- NotificationService::AllSources());
+ Source<Profile>(profile));
registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_INSTALL_ERROR,
- NotificationService::AllSources());
+ Source<Profile>(profile));
}
if (pref_change_registrar_.IsEmpty()) {
pref_change_registrar_.Init(
« no previous file with comments | « chrome/browser/ui/browser.cc ('k') | chrome/browser/web_resource/promo_resource_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698