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/aura/wm_window_aura.h" | 7 #include "ash/aura/wm_window_aura.h" |
8 #include "ash/common/multi_profile_uma.h" | 8 #include "ash/common/multi_profile_uma.h" |
9 #include "ash/common/session/session_state_delegate.h" | 9 #include "ash/common/session/session_state_delegate.h" |
10 #include "ash/common/shell_window_ids.h" | 10 #include "ash/common/shell_window_ids.h" |
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 // will add the children but not the owner to the transient children map. | 326 // will add the children but not the owner to the transient children map. |
327 AddTransientOwnerRecursive(window, window); | 327 AddTransientOwnerRecursive(window, window); |
328 | 328 |
329 // Notify entry adding. | 329 // Notify entry adding. |
330 FOR_EACH_OBSERVER(Observer, observers_, OnOwnerEntryAdded(window)); | 330 FOR_EACH_OBSERVER(Observer, observers_, OnOwnerEntryAdded(window)); |
331 | 331 |
332 if (!IsWindowOnDesktopOfUser(window, current_account_id_)) | 332 if (!IsWindowOnDesktopOfUser(window, current_account_id_)) |
333 SetWindowVisibility(window, false, 0); | 333 SetWindowVisibility(window, false, 0); |
334 } | 334 } |
335 | 335 |
| 336 void MultiUserWindowManagerChromeOS::MarkWindowAsVisible(aura::Window* window) { |
| 337 DCHECK(window); |
| 338 DCHECK(!GetWindowOwner(window).empty()); |
| 339 window_to_entry_[window]->set_show(true); |
| 340 } |
| 341 |
336 const AccountId& MultiUserWindowManagerChromeOS::GetWindowOwner( | 342 const AccountId& MultiUserWindowManagerChromeOS::GetWindowOwner( |
337 aura::Window* window) const { | 343 aura::Window* window) const { |
338 WindowToEntryMap::const_iterator it = window_to_entry_.find(window); | 344 WindowToEntryMap::const_iterator it = window_to_entry_.find(window); |
339 return it != window_to_entry_.end() ? it->second->owner() : EmptyAccountId(); | 345 return it != window_to_entry_.end() ? it->second->owner() : EmptyAccountId(); |
340 } | 346 } |
341 | 347 |
342 void MultiUserWindowManagerChromeOS::ShowWindowForUser( | 348 void MultiUserWindowManagerChromeOS::ShowWindowForUser( |
343 aura::Window* window, | 349 aura::Window* window, |
344 const AccountId& account_id) { | 350 const AccountId& account_id) { |
345 const AccountId previous_owner(GetUserPresentingWindow(window)); | 351 const AccountId previous_owner(GetUserPresentingWindow(window)); |
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
752 window->Hide(); | 758 window->Hide(); |
753 } | 759 } |
754 | 760 |
755 int MultiUserWindowManagerChromeOS::GetAdjustedAnimationTimeInMS( | 761 int MultiUserWindowManagerChromeOS::GetAdjustedAnimationTimeInMS( |
756 int default_time_in_ms) const { | 762 int default_time_in_ms) const { |
757 return animation_speed_ == ANIMATION_SPEED_NORMAL ? default_time_in_ms : | 763 return animation_speed_ == ANIMATION_SPEED_NORMAL ? default_time_in_ms : |
758 (animation_speed_ == ANIMATION_SPEED_FAST ? 10 : 0); | 764 (animation_speed_ == ANIMATION_SPEED_FAST ? 10 : 0); |
759 } | 765 } |
760 | 766 |
761 } // namespace chrome | 767 } // namespace chrome |
OLD | NEW |