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

Unified Diff: mash/wm/bridge/wm_window_mus.h

Issue 2012343002: Converts overview to use common ash types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tweaks Created 4 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
Index: mash/wm/bridge/wm_window_mus.h
diff --git a/mash/wm/bridge/wm_window_mus.h b/mash/wm/bridge/wm_window_mus.h
index b6cb665e653a06e3cb96475c1fa7167b4daec51c..a64cc1ffd1cad91a176e88879f7b72e67251191e 100644
--- a/mash/wm/bridge/wm_window_mus.h
+++ b/mash/wm/bridge/wm_window_mus.h
@@ -34,6 +34,16 @@ class WmRootWindowControllerMus;
// as an owned property).
class WmWindowMus : public ash::wm::WmWindow, public mus::WindowObserver {
public:
+ // Indicates the source of the widget creation.
+ enum class WidgetCreationType {
+ // The widget was created internally, and not at the request of a client.
+ INTERNAL,
+
+ // The widget was created for a client. In other words there is a client
+ // embeeded in the mus::Window.
James Cook 2016/05/27 00:02:51 nit: embedded
sky 2016/05/27 03:18:04 Done.
+ FOR_REMOTE,
James Cook 2016/05/27 00:02:52 It took me a long time to wrap my head around the
sky 2016/05/27 03:18:04 I think that would be confusing as other widgets h
James Cook 2016/05/27 16:04:03 I think I would do something like: INTERNAL and FO
sky 2016/05/27 16:58:23 Done.
+ };
+
explicit WmWindowMus(mus::Window* window);
// NOTE: this class is owned by the corresponding window. You shouldn't delete
// TODO(sky): friend deleter and make private.
@@ -55,7 +65,10 @@ class WmWindowMus : public ash::wm::WmWindow, public mus::WindowObserver {
// Sets the widget associated with the window. The widget is used to query
// state, such as min/max size. The widget is not owned by the WmWindowMus.
- void set_widget(views::Widget* widget) { widget_ = widget; }
+ void set_widget(views::Widget* widget, WidgetCreationType type) {
James Cook 2016/05/27 00:02:51 SetWidget, given that it's no longer a trivial set
sky 2016/05/27 03:18:04 It is setting two values, but I they are both ints
James Cook 2016/05/27 16:30:27 Yeah, it's fine. The style guide isn't specific ab
+ widget_ = widget;
+ widget_creation_type_ = type;
+ }
mus::Window* mus_window() { return window_; }
const mus::Window* mus_window() const { return window_; }
@@ -81,6 +94,7 @@ class WmWindowMus : public ash::wm::WmWindow, public mus::WindowObserver {
const ash::wm::WmWindow* GetRootWindow() const override;
ash::wm::WmRootWindowController* GetRootWindowController() override;
ash::wm::WmGlobals* GetGlobals() const override;
+ base::string16 GetTitle() const override;
void SetShellWindowId(int id) override;
int GetShellWindowId() const override;
ash::wm::WmWindow* GetChildByShellWindowId(int id) override;
@@ -99,6 +113,10 @@ class WmWindowMus : public ash::wm::WmWindow, public mus::WindowObserver {
gfx::Size GetMaximumSize() const override;
bool GetTargetVisibility() const override;
bool IsVisible() const override;
+ void SetOpacity(float opacity) override;
+ float GetTargetOpacity() const override;
+ void SetTransform(const gfx::Transform& transform) override;
+ gfx::Transform GetTargetTransform() const override;
bool IsSystemModal() const override;
bool GetBoolProperty(ash::wm::WmWindowProperty key) override;
int GetIntProperty(ash::wm::WmWindowProperty key) override;
@@ -115,7 +133,11 @@ class WmWindowMus : public ash::wm::WmWindow, public mus::WindowObserver {
ash::wm::WmLayoutManager* GetLayoutManager() override;
void SetVisibilityAnimationType(int type) override;
void SetVisibilityAnimationDuration(base::TimeDelta delta) override;
+ void SetVisibilityAnimationTransition(
+ ::wm::WindowVisibilityAnimationTransition transition) override;
void Animate(::wm::WindowAnimationType type) override;
+ void StopAnimatingProperty(
+ ui::LayerAnimationElement::AnimatableProperty property) override;
void SetBounds(const gfx::Rect& bounds) override;
void SetBoundsWithTransitionDelay(const gfx::Rect& bounds,
base::TimeDelta delta) override;
@@ -143,6 +165,7 @@ class WmWindowMus : public ash::wm::WmWindow, public mus::WindowObserver {
bool IsAlwaysOnTop() const override;
void Hide() override;
void Show() override;
+ void Close() override;
bool IsFocused() const override;
bool IsActive() const override;
void Activate() override;
@@ -194,6 +217,8 @@ class WmWindowMus : public ash::wm::WmWindow, public mus::WindowObserver {
views::Widget* widget_ = nullptr;
+ WidgetCreationType widget_creation_type_ = WidgetCreationType::INTERNAL;
+
base::ObserverList<ash::wm::WmWindowObserver> observers_;
std::unique_ptr<MusLayoutManagerAdapter> layout_manager_adapter_;

Powered by Google App Engine
This is Rietveld 408576698