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

Side by Side Diff: chrome/browser/ui/ash/multi_user/user_switch_animator_chromeos.cc

Issue 2927163002: wm: Do not resize when switching users if window is already maximized. (Closed)
Patch Set: Add a comment. Created 3 years, 6 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
« no previous file with comments | « chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/user_switch_animator_chromeos.h" 5 #include "chrome/browser/ui/ash/multi_user/user_switch_animator_chromeos.h"
6 6
7 #include "ash/root_window_controller.h" 7 #include "ash/root_window_controller.h"
8 #include "ash/shelf/shelf.h" 8 #include "ash/shelf/shelf.h"
9 #include "ash/shelf/shelf_layout_manager.h" 9 #include "ash/shelf/shelf_layout_manager.h"
10 #include "ash/shelf/shelf_widget.h" 10 #include "ash/shelf/shelf_widget.h"
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 // static 138 // static
139 bool UserSwitchAnimatorChromeOS::CoversScreen(aura::Window* window) { 139 bool UserSwitchAnimatorChromeOS::CoversScreen(aura::Window* window) {
140 // Full screen covers the screen naturally. Since a normal window can have the 140 // Full screen covers the screen naturally. Since a normal window can have the
141 // same size as the work area, we only compare the bounds against the work 141 // same size as the work area, we only compare the bounds against the work
142 // area. 142 // area.
143 if (ash::wm::GetWindowState(window)->IsFullscreen()) 143 if (ash::wm::GetWindowState(window)->IsFullscreen())
144 return true; 144 return true;
145 gfx::Rect bounds = window->GetBoundsInRootWindow(); 145 gfx::Rect bounds = window->GetBoundsInRootWindow();
146 gfx::Rect work_area = 146 gfx::Rect work_area =
147 display::Screen::GetScreen()->GetDisplayNearestWindow(window).work_area(); 147 display::Screen::GetScreen()->GetDisplayNearestWindow(window).work_area();
148 bounds.Intersect(work_area); 148 // |work_area| may be on a different display, so we cannot just check the
149 return work_area == bounds; 149 // intersection of |work_area| and |bounds|, so just check if their sizes are
150 // equal to see if |bounds| covers |work_area|.
151 return work_area.size() == bounds.size();
Mr4D (OOO till 08-26) 2017/06/09 23:50:25 If you have a window which has the same size as ma
sammiequon 2017/06/10 00:04:49 I see, I *think* GetBoundsInScreen() would do.
150 } 152 }
151 153
152 void UserSwitchAnimatorChromeOS::AdvanceUserTransitionAnimation() { 154 void UserSwitchAnimatorChromeOS::AdvanceUserTransitionAnimation() {
153 DCHECK_NE(animation_step_, ANIMATION_STEP_ENDED); 155 DCHECK_NE(animation_step_, ANIMATION_STEP_ENDED);
154 156
155 TransitionWallpaper(animation_step_); 157 TransitionWallpaper(animation_step_);
156 TransitionUserShelf(animation_step_); 158 TransitionUserShelf(animation_step_);
157 TransitionWindows(animation_step_); 159 TransitionWindows(animation_step_);
158 160
159 // Advance to the next step. 161 // Advance to the next step.
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 if (itr != window_to_entry_map.end()) { 435 if (itr != window_to_entry_map.end()) {
434 windows_by_account_id_[itr->second->show_for_user()].push_back( 436 windows_by_account_id_[itr->second->show_for_user()].push_back(
435 child_window); 437 child_window);
436 } 438 }
437 } 439 }
438 } 440 }
439 } 441 }
440 } 442 }
441 443
442 } // namespace chrome 444 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698