| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef ASH_MUS_BRIDGE_WM_WINDOW_MUS_H_ | 5 #ifndef ASH_MUS_BRIDGE_WM_WINDOW_MUS_H_ |
| 6 #define ASH_MUS_BRIDGE_WM_WINDOW_MUS_H_ | 6 #define ASH_MUS_BRIDGE_WM_WINDOW_MUS_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "ash/common/shell_window_ids.h" | 10 #include "ash/common/shell_window_ids.h" |
| 11 #include "ash/common/wm_window.h" | 11 #include "ash/common/wm_window.h" |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/observer_list.h" | 13 #include "base/observer_list.h" |
| 14 #include "services/ui/public/cpp/window_observer.h" | 14 #include "services/ui/public/cpp/window_observer.h" |
| 15 | 15 |
| 16 namespace views { | 16 namespace views { |
| 17 class Widget; | 17 class Widget; |
| 18 } | 18 } |
| 19 | 19 |
| 20 namespace ash { | 20 namespace ash { |
| 21 | 21 |
| 22 namespace wm { | 22 namespace wm { |
| 23 class WmLayoutManager; | 23 class WmLayoutManager; |
| 24 } | 24 } |
| 25 | 25 |
| 26 namespace mus { | 26 namespace mus { |
| 27 | 27 |
| 28 class MusLayoutManagerAdapter; | 28 class MusLayoutManagerAdapter; |
| 29 class WmRootWindowControllerMus; | 29 class WmRootWindowControllerMus; |
| 30 class WmWindowMusTestApi; |
| 30 | 31 |
| 31 // WmWindow implementation for mus. | 32 // WmWindow implementation for mus. |
| 32 // | 33 // |
| 33 // WmWindowMus is tied to the life of the underlying ui::Window (it is stored | 34 // WmWindowMus is tied to the life of the underlying ui::Window (it is stored |
| 34 // as an owned property). | 35 // as an owned property). |
| 35 class WmWindowMus : public WmWindow, public ui::WindowObserver { | 36 class WmWindowMus : public WmWindow, public ui::WindowObserver { |
| 36 public: | 37 public: |
| 37 // Indicates the source of the widget creation. | 38 // Indicates the source of the widget creation. |
| 38 enum class WidgetCreationType { | 39 enum class WidgetCreationType { |
| 39 // The widget was created internally, and not at the request of a client. | 40 // The widget was created internally, and not at the request of a client. |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 void AddObserver(WmWindowObserver* observer) override; | 223 void AddObserver(WmWindowObserver* observer) override; |
| 223 void RemoveObserver(WmWindowObserver* observer) override; | 224 void RemoveObserver(WmWindowObserver* observer) override; |
| 224 bool HasObserver(const WmWindowObserver* observer) const override; | 225 bool HasObserver(const WmWindowObserver* observer) const override; |
| 225 void AddTransientWindowObserver(WmTransientWindowObserver* observer) override; | 226 void AddTransientWindowObserver(WmTransientWindowObserver* observer) override; |
| 226 void RemoveTransientWindowObserver( | 227 void RemoveTransientWindowObserver( |
| 227 WmTransientWindowObserver* observer) override; | 228 WmTransientWindowObserver* observer) override; |
| 228 void AddLimitedPreTargetHandler(ui::EventHandler* handler) override; | 229 void AddLimitedPreTargetHandler(ui::EventHandler* handler) override; |
| 229 void RemoveLimitedPreTargetHandler(ui::EventHandler* handler) override; | 230 void RemoveLimitedPreTargetHandler(ui::EventHandler* handler) override; |
| 230 | 231 |
| 231 private: | 232 private: |
| 233 friend class WmWindowMusTestApi; |
| 234 |
| 232 // ui::WindowObserver: | 235 // ui::WindowObserver: |
| 233 void OnTreeChanging(const TreeChangeParams& params) override; | 236 void OnTreeChanging(const TreeChangeParams& params) override; |
| 234 void OnTreeChanged(const TreeChangeParams& params) override; | 237 void OnTreeChanged(const TreeChangeParams& params) override; |
| 235 void OnWindowReordered(ui::Window* window, | 238 void OnWindowReordered(ui::Window* window, |
| 236 ui::Window* relative_window, | 239 ui::Window* relative_window, |
| 237 ui::mojom::OrderDirection direction) override; | 240 ui::mojom::OrderDirection direction) override; |
| 238 void OnWindowSharedPropertyChanged( | 241 void OnWindowSharedPropertyChanged( |
| 239 ui::Window* window, | 242 ui::Window* window, |
| 240 const std::string& name, | 243 const std::string& name, |
| 241 const std::vector<uint8_t>* old_data, | 244 const std::vector<uint8_t>* old_data, |
| (...skipping 29 matching lines...) Expand all Loading... |
| 271 ui::WindowShowState restore_show_state_ = ui::SHOW_STATE_DEFAULT; | 274 ui::WindowShowState restore_show_state_ = ui::SHOW_STATE_DEFAULT; |
| 272 | 275 |
| 273 bool snap_children_to_pixel_boundary_ = false; | 276 bool snap_children_to_pixel_boundary_ = false; |
| 274 | 277 |
| 275 // If true child windows should get a slightly larger hit region to make | 278 // If true child windows should get a slightly larger hit region to make |
| 276 // resizing easier. | 279 // resizing easier. |
| 277 bool children_use_extended_hit_region_ = false; | 280 bool children_use_extended_hit_region_ = false; |
| 278 | 281 |
| 279 base::ObserverList<WmTransientWindowObserver, true> transient_observers_; | 282 base::ObserverList<WmTransientWindowObserver, true> transient_observers_; |
| 280 | 283 |
| 284 // If true the minimum size is 0x0, default is minimum size comes from widget. |
| 285 bool use_empty_minimum_size_for_testing_ = false; |
| 286 |
| 281 DISALLOW_COPY_AND_ASSIGN(WmWindowMus); | 287 DISALLOW_COPY_AND_ASSIGN(WmWindowMus); |
| 282 }; | 288 }; |
| 283 | 289 |
| 284 } // namespace mus | 290 } // namespace mus |
| 285 } // namespace ash | 291 } // namespace ash |
| 286 | 292 |
| 287 #endif // ASH_MUS_BRIDGE_WM_WINDOW_MUS_H_ | 293 #endif // ASH_MUS_BRIDGE_WM_WINDOW_MUS_H_ |
| OLD | NEW |