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

Unified Diff: ash/common/frame/caption_buttons/frame_size_button.cc

Issue 2215223003: Moves most frame related classes to ash/common/frame (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment Created 4 years, 4 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
Index: ash/common/frame/caption_buttons/frame_size_button.cc
diff --git a/ash/frame/caption_buttons/frame_size_button.cc b/ash/common/frame/caption_buttons/frame_size_button.cc
similarity index 91%
rename from ash/frame/caption_buttons/frame_size_button.cc
rename to ash/common/frame/caption_buttons/frame_size_button.cc
index 171ffcb98ca89051ce1b4dcc69150ec8a0aafa51..e28380958000abe098a322d6319908b2308d8f85 100644
--- a/ash/frame/caption_buttons/frame_size_button.cc
+++ b/ash/common/frame/caption_buttons/frame_size_button.cc
@@ -2,19 +2,16 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "ash/frame/caption_buttons/frame_size_button.h"
+#include "ash/common/frame/caption_buttons/frame_size_button.h"
-#include "ash/aura/wm_window_aura.h"
#include "ash/common/wm/window_positioning_utils.h"
#include "ash/common/wm/window_state.h"
#include "ash/common/wm/wm_event.h"
#include "ash/common/wm/workspace/phantom_window_controller.h"
+#include "ash/common/wm_lookup.h"
#include "ash/common/wm_shell.h"
-#include "ash/screen_util.h"
-#include "ash/wm/window_state_aura.h"
-#include "ash/wm/window_util.h"
+#include "ash/common/wm_window.h"
#include "base/i18n/rtl.h"
-#include "ui/aura/window.h"
#include "ui/gfx/geometry/vector2d.h"
#include "ui/views/widget/widget.h"
@@ -214,19 +211,15 @@ void FrameSizeButton::UpdateSnapType(const ui::LocatedEvent& event) {
}
if (snap_type_ == SNAP_LEFT || snap_type_ == SNAP_RIGHT) {
- aura::Window* window = frame_->GetNativeWindow();
- if (!phantom_window_controller_.get()) {
- phantom_window_controller_.reset(
- new PhantomWindowController(WmWindowAura::Get(window)));
- }
+ WmWindow* window = WmLookup::Get()->GetWindowForWidget(frame_);
+ if (!phantom_window_controller_.get())
+ phantom_window_controller_.reset(new PhantomWindowController(window));
gfx::Rect phantom_bounds_in_parent =
(snap_type_ == SNAP_LEFT)
- ? wm::GetDefaultLeftSnappedWindowBoundsInParent(
- WmWindowAura::Get(window))
- : wm::GetDefaultRightSnappedWindowBoundsInParent(
- WmWindowAura::Get(window));
- phantom_window_controller_->Show(ScreenUtil::ConvertRectToScreen(
- window->parent(), phantom_bounds_in_parent));
+ ? wm::GetDefaultLeftSnappedWindowBoundsInParent(window)
+ : wm::GetDefaultRightSnappedWindowBoundsInParent(window);
+ phantom_window_controller_->Show(
+ window->GetParent()->ConvertRectToScreen(phantom_bounds_in_parent));
} else {
phantom_window_controller_.reset();
}
@@ -250,8 +243,8 @@ bool FrameSizeButton::CommitSnap(const ui::LocatedEvent& event) {
UpdateSnapType(event);
if (in_snap_mode_ && (snap_type_ == SNAP_LEFT || snap_type_ == SNAP_RIGHT)) {
- wm::WindowState* window_state =
- wm::GetWindowState(frame_->GetNativeWindow());
+ WmWindow* window = WmLookup::Get()->GetWindowForWidget(frame_);
+ wm::WindowState* window_state = window->GetWindowState();
const wm::WMEvent snap_event(snap_type_ == SNAP_LEFT
? wm::WM_EVENT_SNAP_LEFT
: wm::WM_EVENT_SNAP_RIGHT);
« no previous file with comments | « ash/common/frame/caption_buttons/frame_size_button.h ('k') | ash/common/frame/caption_buttons/frame_size_button_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698