Index: apps/shell_window.cc |
diff --git a/apps/shell_window.cc b/apps/shell_window.cc |
index 9c0247aef560ccf9a429c63df120539be4d452a9..7e0145d5ce3d9fe7d324d1533b0c9992bf4f37ba 100644 |
--- a/apps/shell_window.cc |
+++ b/apps/shell_window.cc |
@@ -212,6 +212,9 @@ void ShellWindow::Init(const GURL& url, |
// Close when the browser process is exiting. |
registrar_.Add(this, chrome::NOTIFICATION_APP_TERMINATING, |
content::NotificationService::AllSources()); |
+ // Update the app menu if an ephemeral app becomes installed. |
+ registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_INSTALLED, |
+ content::Source<Profile>(profile_)); |
shell_window_contents_->LoadContents(new_params.creator_process_id); |
@@ -747,6 +750,15 @@ void ShellWindow::Observe(int type, |
native_app_window_->Close(); |
break; |
} |
+ case chrome::NOTIFICATION_EXTENSION_INSTALLED: { |
+ const extensions::Extension* installed_extension = |
+ content::Details<const extensions::InstalledExtensionInfo>( |
+ details)->extension; |
+ DCHECK(installed_extension); |
+ if (installed_extension->id() == extension_->id()) |
+ native_app_window_->UpdateAppMenu(); |
+ break; |
+ } |
case chrome::NOTIFICATION_APP_TERMINATING: |
native_app_window_->Close(); |
break; |