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

Unified Diff: ash/wm/window_state.h

Issue 149303003: [Refactor] Move the logic to update bounds for show type from WorkspaceLayoutManager to DefaultState (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: handle show_inactive Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/wm/toplevel_window_event_handler.cc ('k') | ash/wm/window_state.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/window_state.h
diff --git a/ash/wm/window_state.h b/ash/wm/window_state.h
index 4ed2fe6b699b7f7e3a2d647586a76d62610f4bd8..1023cdd8cb86f47c7c95d6e0ba4cc59611ae29ce 100644
--- a/ash/wm/window_state.h
+++ b/ash/wm/window_state.h
@@ -23,6 +23,9 @@ class Rect;
}
namespace ash {
+namespace internal {
+class WorkspaceLayoutManager;
+}
namespace wm {
class WindowStateDelegate;
@@ -271,6 +274,10 @@ class ASH_EXPORT WindowState : public aura::WindowObserver {
// Sets the currently stored restore bounds and clears the restore bounds.
void SetAndClearRestoreBounds();
+ // Adjusts the |bounds| so that they are flush with the edge of the
+ // workspace if the window represented by |window_state| is side snapped.
+ void AdjustSnappedBounds(gfx::Rect* bounds);
+
// Returns a pointer to DragDetails during drag operations.
const DragDetails* drag_details() const { return drag_details_.get(); }
DragDetails* drag_details() { return drag_details_.get(); }
@@ -281,12 +288,26 @@ class ASH_EXPORT WindowState : public aura::WindowObserver {
intptr_t old) OVERRIDE;
private:
+ friend class DefaultState;
+ // TODO(oshima): Move more logic from WLM to this class and remove
+ // this friend.
+ friend class internal::WorkspaceLayoutManager;
+
+ WindowStateDelegate* delegate() { return delegate_.get(); }
+
// Snaps the window to left or right of the desktop with given bounds.
void SnapWindow(WindowShowType left_or_right,
const gfx::Rect& bounds);
// Sets the window show type and updates the show state if necessary.
- void SetWindowShowType(WindowShowType new_window_show_type);
+ // Note that this does not update the window bounds.
+ void UpdateWindowShowType(WindowShowType new_window_show_type);
+
+ void NotifyPreShowTypeChange(WindowShowType old_window_show_type);
+ void NotifyPostShowTypeChange(WindowShowType old_window_show_type);
+
+ void SetBoundsDirect(const gfx::Rect& bounds);
+ void SetBoundsDirectAnimated(const gfx::Rect& bounds);
// The owner of this window settings.
aura::Window* window_;
@@ -313,8 +334,9 @@ class ASH_EXPORT WindowState : public aura::WindowObserver {
ObserverList<WindowStateObserver> observer_list_;
- // True when in SetWindowShowType(). This is used to avoid reentrance.
- bool in_set_window_show_type_;
+ // True to ignore a property change event to avoid reentrance in
+ // UpdateWindowShowType()
+ bool ignore_property_change_;
WindowShowType window_show_type_;
« no previous file with comments | « ash/wm/toplevel_window_event_handler.cc ('k') | ash/wm/window_state.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698