OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |