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

Side by Side Diff: chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos.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, 10 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/multi_user/multi_user_window_manager_chromeos.h" 5 #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos.h"
6 6
7 #include "ash/ash_switches.h" 7 #include "ash/ash_switches.h"
8 #include "ash/multi_profile_uma.h" 8 #include "ash/multi_profile_uma.h"
9 #include "ash/root_window_controller.h" 9 #include "ash/root_window_controller.h"
10 #include "ash/session/session_state_delegate.h" 10 #include "ash/session/session_state_delegate.h"
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
425 425
426 // Account all existing application windows of this user accordingly. 426 // Account all existing application windows of this user accordingly.
427 const extensions::AppWindowRegistry::AppWindowList& app_windows = 427 const extensions::AppWindowRegistry::AppWindowList& app_windows =
428 extensions::AppWindowRegistry::Get(profile)->app_windows(); 428 extensions::AppWindowRegistry::Get(profile)->app_windows();
429 extensions::AppWindowRegistry::AppWindowList::const_iterator it = 429 extensions::AppWindowRegistry::AppWindowList::const_iterator it =
430 app_windows.begin(); 430 app_windows.begin();
431 for (; it != app_windows.end(); ++it) 431 for (; it != app_windows.end(); ++it)
432 account_id_to_app_observer_[account_id]->OnAppWindowAdded(*it); 432 account_id_to_app_observer_[account_id]->OnAppWindowAdded(*it);
433 433
434 // Account all existing browser windows of this user accordingly. 434 // Account all existing browser windows of this user accordingly.
435 BrowserList* browser_list = BrowserList::GetInstance(HOST_DESKTOP_TYPE_ASH); 435 BrowserList* browser_list = BrowserList::GetInstance();
436 BrowserList::const_iterator browser_it = browser_list->begin(); 436 BrowserList::const_iterator browser_it = browser_list->begin();
437 for (; browser_it != browser_list->end(); ++browser_it) { 437 for (; browser_it != browser_list->end(); ++browser_it) {
438 if ((*browser_it)->profile()->GetOriginalProfile() == profile) 438 if ((*browser_it)->profile()->GetOriginalProfile() == profile)
439 AddBrowserWindow(*browser_it); 439 AddBrowserWindow(*browser_it);
440 } 440 }
441 // When adding another user to the session, we auto switch users. 441 // When adding another user to the session, we auto switch users.
442 if (account_id_to_app_observer_.size() == 1) 442 if (account_id_to_app_observer_.size() == 1)
443 return; 443 return;
444 444
445 // Don't do anything special in case of user session restore after crash. 445 // Don't do anything special in case of user session restore after crash.
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
800 if (app_observer_iterator == account_id_to_app_observer_.end()) 800 if (app_observer_iterator == account_id_to_app_observer_.end())
801 return; 801 return;
802 802
803 extensions::AppWindowRegistry::Get(profile) 803 extensions::AppWindowRegistry::Get(profile)
804 ->RemoveObserver(app_observer_iterator->second); 804 ->RemoveObserver(app_observer_iterator->second);
805 delete app_observer_iterator->second; 805 delete app_observer_iterator->second;
806 account_id_to_app_observer_.erase(app_observer_iterator); 806 account_id_to_app_observer_.erase(app_observer_iterator);
807 } 807 }
808 808
809 } // namespace chrome 809 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/ui/ash/metrics/chrome_user_metrics_recorder.cc ('k') | chrome/browser/ui/ash/system_tray_delegate_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698