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

Unified Diff: chrome/browser/ui/ash/launcher/multi_profile_browser_status_monitor.cc

Issue 83173007: Fixing M32 crasher where closing of a windowed V1 app on a visiting desktop will cause crashes late… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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
Index: chrome/browser/ui/ash/launcher/multi_profile_browser_status_monitor.cc
diff --git a/chrome/browser/ui/ash/launcher/multi_profile_browser_status_monitor.cc b/chrome/browser/ui/ash/launcher/multi_profile_browser_status_monitor.cc
index bb2a86347dacf1993cf53f8c67c0bd05793481ea..ac2bb4ac64670e5f37242dfe37fe26f827755244 100644
--- a/chrome/browser/ui/ash/launcher/multi_profile_browser_status_monitor.cc
+++ b/chrome/browser/ui/ash/launcher/multi_profile_browser_status_monitor.cc
@@ -30,9 +30,9 @@ void MultiProfileBrowserStatusMonitor::ActiveUserChanged(
bool owned = multi_user_util::IsProfileFromActiveUser((*it)->profile());
bool shown = IsV1AppInShelf(*it);
if (owned && !shown)
- BrowserStatusMonitor::AddV1AppToShelf(*it);
+ ConnectV1AppToLauncher(*it);
else if (!owned && shown)
- BrowserStatusMonitor::RemoveV1AppFromShelf(*it);
+ DisconnectV1AppFromLauncher(*it);
}
// Handle apps in browser tabs: Add the new applications.
@@ -96,3 +96,23 @@ void MultiProfileBrowserStatusMonitor::RemoveV1AppFromShelf(Browser* browser) {
BrowserStatusMonitor::RemoveV1AppFromShelf(browser);
}
}
+
+void MultiProfileBrowserStatusMonitor::ConnectV1AppToLauncher(
+ Browser* browser) {
+ // Adding a V1 app to the launcher consists of two actions: Add the browser
+ // (launcher item) and add the content (launcher item status).
+ BrowserStatusMonitor::AddV1AppToShelf(browser);
+ launcher_controller_->UpdateAppState(
+ browser->tab_strip_model()->GetActiveWebContents(),
+ ChromeLauncherController::APP_STATE_INACTIVE);
+}
+
+void MultiProfileBrowserStatusMonitor::DisconnectV1AppFromLauncher(
+ Browser* browser) {
+ // Removing a V1 app from the launcher requires to remove the content and
+ // the launcher item.
+ launcher_controller_->UpdateAppState(
+ browser->tab_strip_model()->GetActiveWebContents(),
+ ChromeLauncherController::APP_STATE_REMOVED);
+ BrowserStatusMonitor::RemoveV1AppFromShelf(browser);
+}

Powered by Google App Engine
This is Rietveld 408576698