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

Unified Diff: ash/wm/window_positioning_utils.cc

Issue 2897993003: chromeos: converts WindowResizer to aura::Window (Closed)
Patch Set: remove include from exo Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/wm/window_positioning_utils.h ('k') | ash/wm/window_resizer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/window_positioning_utils.cc
diff --git a/ash/wm/window_positioning_utils.cc b/ash/wm/window_positioning_utils.cc
index 918f3e83211921ccbc8b0db1f721d0d071cbb669..f45ca4cb51cec22ec1c83455b1c4a9a9bd857606 100644
--- a/ash/wm/window_positioning_utils.cc
+++ b/ash/wm/window_positioning_utils.cc
@@ -15,6 +15,8 @@
#include "ash/wm/wm_event.h"
#include "ash/wm_window.h"
#include "ui/aura/client/focus_client.h"
+#include "ui/aura/window.h"
+#include "ui/aura/window_delegate.h"
#include "ui/aura/window_tracker.h"
#include "ui/display/display.h"
#include "ui/display/types/display_constants.h"
@@ -27,13 +29,13 @@ namespace wm {
namespace {
// Returns the default width of a snapped window.
-int GetDefaultSnappedWindowWidth(WmWindow* window) {
+int GetDefaultSnappedWindowWidth(aura::Window* window) {
const float kSnappedWidthWorkspaceRatio = 0.5f;
int work_area_width =
- ScreenUtil::GetDisplayWorkAreaBoundsInParent(window->aura_window())
- .width();
- int min_width = window->GetMinimumSize().width();
+ ScreenUtil::GetDisplayWorkAreaBoundsInParent(window).width();
+ int min_width =
+ window->delegate() ? window->delegate()->GetMinimumSize().width() : 0;
int ideal_width =
static_cast<int>(work_area_width * kSnappedWidthWorkspaceRatio);
return std::min(work_area_width, std::max(ideal_width, min_width));
@@ -109,17 +111,17 @@ void AdjustBoundsToEnsureMinimumWindowVisibility(const gfx::Rect& visible_area,
kMinimumOnScreenArea, bounds);
}
-gfx::Rect GetDefaultLeftSnappedWindowBoundsInParent(WmWindow* window) {
+gfx::Rect GetDefaultLeftSnappedWindowBoundsInParent(aura::Window* window) {
gfx::Rect work_area_in_parent(
- ScreenUtil::GetDisplayWorkAreaBoundsInParent(window->aura_window()));
+ ScreenUtil::GetDisplayWorkAreaBoundsInParent(window));
return gfx::Rect(work_area_in_parent.x(), work_area_in_parent.y(),
GetDefaultSnappedWindowWidth(window),
work_area_in_parent.height());
}
-gfx::Rect GetDefaultRightSnappedWindowBoundsInParent(WmWindow* window) {
+gfx::Rect GetDefaultRightSnappedWindowBoundsInParent(aura::Window* window) {
gfx::Rect work_area_in_parent(
- ScreenUtil::GetDisplayWorkAreaBoundsInParent(window->aura_window()));
+ ScreenUtil::GetDisplayWorkAreaBoundsInParent(window));
int width = GetDefaultSnappedWindowWidth(window);
return gfx::Rect(work_area_in_parent.right() - width, work_area_in_parent.y(),
width, work_area_in_parent.height());
« no previous file with comments | « ash/wm/window_positioning_utils.h ('k') | ash/wm/window_resizer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698