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

Side by Side Diff: ash/wm/window_state.cc

Issue 1608733002: Remove ui/gfx/screen_type_delegate.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@metro-mode-4
Patch Set: and another rebase 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
« no previous file with comments | « ash/wm/overview/window_grid.cc ('k') | ash/wm/workspace/multi_window_resize_controller.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "ash/wm/window_state.h" 5 #include "ash/wm/window_state.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "ash/ash_switches.h" 9 #include "ash/ash_switches.h"
10 #include "ash/root_window_controller.h" 10 #include "ash/root_window_controller.h"
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 OnPostWindowStateTypeChange(this, old_window_state_type)); 408 OnPostWindowStateTypeChange(this, old_window_state_type));
409 } 409 }
410 410
411 void WindowState::SetBoundsDirect(const gfx::Rect& bounds) { 411 void WindowState::SetBoundsDirect(const gfx::Rect& bounds) {
412 gfx::Rect actual_new_bounds(bounds); 412 gfx::Rect actual_new_bounds(bounds);
413 // Ensure we don't go smaller than our minimum bounds in "normal" window 413 // Ensure we don't go smaller than our minimum bounds in "normal" window
414 // modes 414 // modes
415 if (window_->delegate() && !IsMaximized() && !IsFullscreen()) { 415 if (window_->delegate() && !IsMaximized() && !IsFullscreen()) {
416 // Get the minimum usable size of the minimum size and the screen size. 416 // Get the minimum usable size of the minimum size and the screen size.
417 gfx::Size min_size = window_->delegate()->GetMinimumSize(); 417 gfx::Size min_size = window_->delegate()->GetMinimumSize();
418 min_size.SetToMin(gfx::Screen::GetScreenFor( 418 min_size.SetToMin(gfx::Screen::GetScreen()
419 window_)->GetDisplayNearestWindow(window_).work_area().size()); 419 ->GetDisplayNearestWindow(window_)
420 .work_area()
421 .size());
420 422
421 actual_new_bounds.set_width( 423 actual_new_bounds.set_width(
422 std::max(min_size.width(), actual_new_bounds.width())); 424 std::max(min_size.width(), actual_new_bounds.width()));
423 actual_new_bounds.set_height( 425 actual_new_bounds.set_height(
424 std::max(min_size.height(), actual_new_bounds.height())); 426 std::max(min_size.height(), actual_new_bounds.height()));
425 } 427 }
426 BoundsSetter().SetBounds(window_, actual_new_bounds); 428 BoundsSetter().SetBounds(window_, actual_new_bounds);
427 SnapWindowToPixelBoundary(window_); 429 SnapWindowToPixelBoundary(window_);
428 } 430 }
429 431
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 } 499 }
498 return settings; 500 return settings;
499 } 501 }
500 502
501 const WindowState* GetWindowState(const aura::Window* window) { 503 const WindowState* GetWindowState(const aura::Window* window) {
502 return GetWindowState(const_cast<aura::Window*>(window)); 504 return GetWindowState(const_cast<aura::Window*>(window));
503 } 505 }
504 506
505 } // namespace wm 507 } // namespace wm
506 } // namespace ash 508 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/overview/window_grid.cc ('k') | ash/wm/workspace/multi_window_resize_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698