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

Unified Diff: ash/wm/aura/wm_window_aura.h

Issue 1890713002: Adds WmWindow and converts WindowState to use it (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge again Created 4 years, 8 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/aura/wm_root_window_controller_aura.cc ('k') | ash/wm/aura/wm_window_aura.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/aura/wm_window_aura.h
diff --git a/ash/wm/aura/wm_window_aura.h b/ash/wm/aura/wm_window_aura.h
new file mode 100644
index 0000000000000000000000000000000000000000..3ebde89dc61538c9e8df305097a201c231256b5e
--- /dev/null
+++ b/ash/wm/aura/wm_window_aura.h
@@ -0,0 +1,124 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef ASH_WM_AURA_WM_WINDOW_AURA_H_
+#define ASH_WM_AURA_WM_WINDOW_AURA_H_
+
+#include "ash/wm/common/wm_window.h"
+#include "base/macros.h"
+#include "base/observer_list.h"
+#include "ui/aura/window_observer.h"
+
+namespace ash {
+namespace wm {
+
+// WmWindowAura is tied to the life of the underlying aura::Window.
+class ASH_EXPORT WmWindowAura : public WmWindow, public aura::WindowObserver {
+ public:
+ explicit WmWindowAura(aura::Window* window);
+ // NOTE: this class is owned by the corresponding window. You shouldn't delete
+ // TODO(sky): friend deleter and make private.
+ ~WmWindowAura() override;
+
+ // Returns a WmWindow for an aura::Window, creating if necessary.
+ static WmWindow* Get(aura::Window* window);
+
+ static aura::Window* GetAuraWindow(WmWindow* wm_window) {
+ return const_cast<aura::Window*>(
+ GetAuraWindow(const_cast<const WmWindow*>(wm_window)));
+ }
+ static const aura::Window* GetAuraWindow(const WmWindow* wm_window);
+
+ aura::Window* aura_window() { return window_; }
+ const aura::Window* aura_window() const { return window_; }
+
+ // WmWindow:
+ const WmWindow* GetRootWindow() const override;
+ WmRootWindowController* GetRootWindowController() override;
+ int GetShellWindowId() override;
+ WmWindow* GetChildByShellWindowId(int id) override;
+ ui::wm::WindowType GetType() const override;
+ ui::Layer* GetLayer() override;
+ gfx::Display GetDisplayNearestWindow() override;
+ bool HasNonClientArea() override;
+ int GetNonClientComponent(const gfx::Point& location) override;
+ gfx::Point ConvertPointToTarget(const WmWindow* target,
+ const gfx::Point& point) const override;
+ gfx::Point ConvertPointToScreen(const gfx::Point& point) const override;
+ gfx::Point ConvertPointFromScreen(const gfx::Point& point) const override;
+ gfx::Rect ConvertRectToScreen(const gfx::Rect& rect) const override;
+ gfx::Rect ConvertRectFromScreen(const gfx::Rect& rect) const override;
+ gfx::Size GetMinimumSize() override;
+ gfx::Size GetMaximumSize() override;
+ bool GetTargetVisibility() const override;
+ bool IsVisible() const override;
+ bool GetBoolProperty(WmWindowProperty key) override;
+ WindowState* GetWindowState() override;
+ WmWindow* GetToplevelWindow() override;
+ WmWindow* GetParent() override;
+ WmWindow* GetTransientParent() override;
+ void SetBounds(const gfx::Rect& bounds) override;
+ void SetBoundsDirect(const gfx::Rect& bounds) override;
+ void SetBoundsDirectAnimated(const gfx::Rect& bounds) override;
+ void SetBoundsDirectCrossFade(const gfx::Rect& bounds) override;
+ void SetBoundsInScreen(const gfx::Rect& bounds_in_screen,
+ const gfx::Display& dst_display) override;
+ gfx::Rect GetBoundsInScreen() const override;
+ const gfx::Rect& GetBounds() const override;
+ gfx::Rect GetTargetBounds() override;
+ void ClearRestoreBounds() override;
+ void SetRestoreBoundsInScreen(const gfx::Rect& bounds) override;
+ gfx::Rect GetRestoreBoundsInScreen() const override;
+ void OnWMEvent(const wm::WMEvent* event) override;
+ bool Contains(const WmWindow* other) const override;
+ void SetShowState(ui::WindowShowState show_state) override;
+ ui::WindowShowState GetShowState() const override;
+ void SetCapture() override;
+ bool HasCapture() override;
+ void ReleaseCapture() override;
+ bool HasRestoreBounds() const override;
+ bool CanMaximize() const override;
+ bool CanMinimize() const override;
+ bool CanResize() const override;
+ bool CanActivate() const override;
+ void StackChildAtTop(WmWindow* child) override;
+ void StackChildAbove(WmWindow* child, WmWindow* target) override;
+ void StackChildBelow(WmWindow* child, WmWindow* target) override;
+ void SetAlwaysOnTop(bool value) override;
+ bool IsAlwaysOnTop() const override;
+ void Hide() override;
+ void Show() override;
+ bool IsActive() const override;
+ void Activate() override;
+ void Deactivate() override;
+ void Maximize() override;
+ void Minimize() override;
+ void Unminimize() override;
+ std::vector<WmWindow*> GetChildren() override;
+ void AddObserver(WmWindowObserver* observer) override;
+ void RemoveObserver(WmWindowObserver* observer) override;
+
+ private:
+ // aura::WindowObserver:
+ void OnWindowHierarchyChanged(const HierarchyChangeParams& params) override;
+ void OnWindowStackingChanged(aura::Window* window) override;
+ void OnWindowPropertyChanged(aura::Window* window,
+ const void* key,
+ intptr_t old) override;
+ void OnWindowBoundsChanged(aura::Window* window,
+ const gfx::Rect& old_bounds,
+ const gfx::Rect& new_bounds) override;
+ void OnWindowDestroying(aura::Window* window) override;
+
+ aura::Window* window_;
+
+ base::ObserverList<WmWindowObserver> observers_;
+
+ DISALLOW_COPY_AND_ASSIGN(WmWindowAura);
+};
+
+} // namespace wm
+} // namespace ash
+
+#endif // ASH_WM_AURA_WM_WINDOW_AURA_H_
« no previous file with comments | « ash/wm/aura/wm_root_window_controller_aura.cc ('k') | ash/wm/aura/wm_window_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698