| 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 "apps/app_window.h" | 7 #include "apps/app_window.h" |
| 8 #include "apps/app_window_registry.h" | 8 #include "apps/app_window_registry.h" |
| 9 #include "ash/ash_switches.h" | 9 #include "ash/ash_switches.h" |
| 10 #include "ash/multi_profile_uma.h" | 10 #include "ash/multi_profile_uma.h" |
| 11 #include "ash/root_window_controller.h" | 11 #include "ash/root_window_controller.h" |
| 12 #include "ash/session/session_state_delegate.h" | 12 #include "ash/session/session_state_delegate.h" |
| 13 #include "ash/shelf/shelf.h" | 13 #include "ash/shelf/shelf.h" |
| 14 #include "ash/shell.h" | 14 #include "ash/shell.h" |
| 15 #include "ash/shell_delegate.h" | 15 #include "ash/shell_delegate.h" |
| 16 #include "ash/shell_window_ids.h" | 16 #include "ash/shell_window_ids.h" |
| 17 #include "ash/system/tray/system_tray_notifier.h" |
| 17 #include "ash/wm/window_state.h" | 18 #include "ash/wm/window_state.h" |
| 18 #include "base/auto_reset.h" | 19 #include "base/auto_reset.h" |
| 19 #include "base/message_loop/message_loop.h" | 20 #include "base/message_loop/message_loop.h" |
| 20 #include "base/strings/string_util.h" | 21 #include "base/strings/string_util.h" |
| 21 #include "chrome/browser/browser_process.h" | 22 #include "chrome/browser/browser_process.h" |
| 22 #include "chrome/browser/chrome_notification_types.h" | 23 #include "chrome/browser/chrome_notification_types.h" |
| 23 #include "chrome/browser/chromeos/login/user_manager.h" | 24 #include "chrome/browser/chromeos/login/user_manager.h" |
| 24 #include "chrome/browser/profiles/profile.h" | 25 #include "chrome/browser/profiles/profile.h" |
| 25 #include "chrome/browser/profiles/profile_manager.h" | 26 #include "chrome/browser/profiles/profile_manager.h" |
| 26 #include "chrome/browser/ui/ash/multi_user/multi_user_notification_blocker_chrom
eos.h" | 27 #include "chrome/browser/ui/ash/multi_user/multi_user_notification_blocker_chrom
eos.h" |
| (...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 393 | 394 |
| 394 void MultiUserWindowManagerChromeOS::ActiveUserChanged( | 395 void MultiUserWindowManagerChromeOS::ActiveUserChanged( |
| 395 const std::string& user_id) { | 396 const std::string& user_id) { |
| 396 DCHECK(user_id != current_user_id_); | 397 DCHECK(user_id != current_user_id_); |
| 397 // This needs to be set before the animation starts. | 398 // This needs to be set before the animation starts. |
| 398 current_user_id_ = user_id; | 399 current_user_id_ = user_id; |
| 399 | 400 |
| 400 animation_.reset( | 401 animation_.reset( |
| 401 new UserSwichAnimatorChromeOS( | 402 new UserSwichAnimatorChromeOS( |
| 402 this, user_id, GetAdjustedAnimationTimeInMS(kUserFadeTimeMS))); | 403 this, user_id, GetAdjustedAnimationTimeInMS(kUserFadeTimeMS))); |
| 404 // Call notifier here instead of observing ActiveUserChanged because |
| 405 // this must happen after MultiUserWindowManagerChromeOS is notified. |
| 406 ash::Shell::GetInstance() |
| 407 ->system_tray_notifier() |
| 408 ->NotifyMediaCaptureChanged(); |
| 403 } | 409 } |
| 404 | 410 |
| 405 void MultiUserWindowManagerChromeOS::OnWindowDestroyed(aura::Window* window) { | 411 void MultiUserWindowManagerChromeOS::OnWindowDestroyed(aura::Window* window) { |
| 406 if (GetWindowOwner(window).empty()) { | 412 if (GetWindowOwner(window).empty()) { |
| 407 // This must be a window in the transient chain - remove it and its | 413 // This must be a window in the transient chain - remove it and its |
| 408 // children from the owner. | 414 // children from the owner. |
| 409 RemoveTransientOwnerRecursive(window); | 415 RemoveTransientOwnerRecursive(window); |
| 410 return; | 416 return; |
| 411 } | 417 } |
| 412 wm::TransientWindowManager::Get(window)->RemoveObserver(this); | 418 wm::TransientWindowManager::Get(window)->RemoveObserver(this); |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 702 DCHECK_EQ(visible, window->IsVisible()); | 708 DCHECK_EQ(visible, window->IsVisible()); |
| 703 } | 709 } |
| 704 | 710 |
| 705 int MultiUserWindowManagerChromeOS::GetAdjustedAnimationTimeInMS( | 711 int MultiUserWindowManagerChromeOS::GetAdjustedAnimationTimeInMS( |
| 706 int default_time_in_ms) const { | 712 int default_time_in_ms) const { |
| 707 return animation_speed_ == ANIMATION_SPEED_NORMAL ? default_time_in_ms : | 713 return animation_speed_ == ANIMATION_SPEED_NORMAL ? default_time_in_ms : |
| 708 (animation_speed_ == ANIMATION_SPEED_FAST ? 10 : 0); | 714 (animation_speed_ == ANIMATION_SPEED_FAST ? 10 : 0); |
| 709 } | 715 } |
| 710 | 716 |
| 711 } // namespace chrome | 717 } // namespace chrome |
| OLD | NEW |