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

Side by Side Diff: chrome/browser/ui/ash/launcher/multi_profile_browser_status_monitor.cc

Issue 1637943003: Remove HostDesktopType from BrowserList::GetInstance() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@screen-wrapper-land
Patch Set: mac2 Created 4 years, 11 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/ash/launcher/multi_profile_browser_status_monitor.h" 5 #include "chrome/browser/ui/ash/launcher/multi_profile_browser_status_monitor.h"
6 6
7 #include "ash/shelf/shelf_util.h" 7 #include "ash/shelf/shelf_util.h"
8 #include "chrome/browser/profiles/profile.h" 8 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/browser/profiles/profile_manager.h" 9 #include "chrome/browser/profiles/profile_manager.h"
10 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" 10 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h"
(...skipping 24 matching lines...) Expand all
35 for (AppList::iterator it = app_list_.begin(); it != app_list_.end(); ++it) { 35 for (AppList::iterator it = app_list_.begin(); it != app_list_.end(); ++it) {
36 bool owned = multi_user_util::IsProfileFromActiveUser((*it)->profile()); 36 bool owned = multi_user_util::IsProfileFromActiveUser((*it)->profile());
37 bool shown = IsV1AppInShelf(*it); 37 bool shown = IsV1AppInShelf(*it);
38 if (owned && !shown) 38 if (owned && !shown)
39 ConnectV1AppToLauncher(*it); 39 ConnectV1AppToLauncher(*it);
40 else if (!owned && shown) 40 else if (!owned && shown)
41 DisconnectV1AppFromLauncher(*it); 41 DisconnectV1AppFromLauncher(*it);
42 } 42 }
43 43
44 // Handle apps in browser tabs: Add the new applications. 44 // Handle apps in browser tabs: Add the new applications.
45 BrowserList* browser_list = 45 BrowserList* browser_list = BrowserList::GetInstance();
46 BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_ASH);
47 46
48 // Remove old (tabbed V1) applications. 47 // Remove old (tabbed V1) applications.
49 for (BrowserList::const_iterator it = browser_list->begin(); 48 for (BrowserList::const_iterator it = browser_list->begin();
50 it != browser_list->end(); ++it) { 49 it != browser_list->end(); ++it) {
51 Browser* browser = *it; 50 Browser* browser = *it;
52 if (!browser->is_app() && 51 if (!browser->is_app() &&
53 browser->is_type_tabbed() && 52 browser->is_type_tabbed() &&
54 !multi_user_util::IsProfileFromActiveUser(browser->profile())) { 53 !multi_user_util::IsProfileFromActiveUser(browser->profile())) {
55 for (int i = 0; i < browser->tab_strip_model()->count(); ++i) { 54 for (int i = 0; i < browser->tab_strip_model()->count(); ++i) {
56 launcher_controller_->UpdateAppState( 55 launcher_controller_->UpdateAppState(
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 133
135 void MultiProfileBrowserStatusMonitor::DisconnectV1AppFromLauncher( 134 void MultiProfileBrowserStatusMonitor::DisconnectV1AppFromLauncher(
136 Browser* browser) { 135 Browser* browser) {
137 // Removing a V1 app from the launcher requires to remove the content and 136 // Removing a V1 app from the launcher requires to remove the content and
138 // the launcher item. 137 // the launcher item.
139 launcher_controller_->UpdateAppState( 138 launcher_controller_->UpdateAppState(
140 browser->tab_strip_model()->GetActiveWebContents(), 139 browser->tab_strip_model()->GetActiveWebContents(),
141 ChromeLauncherController::APP_STATE_REMOVED); 140 ChromeLauncherController::APP_STATE_REMOVED);
142 BrowserStatusMonitor::RemoveV1AppFromShelf(browser); 141 BrowserStatusMonitor::RemoveV1AppFromShelf(browser);
143 } 142 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698