| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_WM_WINDOW_STATE_H_ | 5 #ifndef ASH_WM_WINDOW_STATE_H_ |
| 6 #define ASH_WM_WINDOW_STATE_H_ | 6 #define ASH_WM_WINDOW_STATE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
| 11 #include "ash/wm/aura/wm_window_aura.h" | |
| 12 #include "ash/wm/common/wm_types.h" | 11 #include "ash/wm/common/wm_types.h" |
| 13 #include "ash/wm/drag_details.h" | 12 #include "ash/wm/drag_details.h" |
| 14 #include "base/gtest_prod_util.h" | 13 #include "base/gtest_prod_util.h" |
| 15 #include "base/macros.h" | 14 #include "base/macros.h" |
| 16 #include "base/observer_list.h" | 15 #include "base/observer_list.h" |
| 17 #include "ui/base/ui_base_types.h" | 16 #include "ui/base/ui_base_types.h" |
| 18 | 17 |
| 19 namespace aura { | 18 namespace aura { |
| 20 class Window; | 19 class Window; |
| 21 } | 20 } |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 // Note: This only gets called when the state object gets changed. | 74 // Note: This only gets called when the state object gets changed. |
| 76 virtual void DetachState(WindowState* window_state) = 0; | 75 virtual void DetachState(WindowState* window_state) = 0; |
| 77 | 76 |
| 78 private: | 77 private: |
| 79 DISALLOW_COPY_AND_ASSIGN(State); | 78 DISALLOW_COPY_AND_ASSIGN(State); |
| 80 }; | 79 }; |
| 81 | 80 |
| 82 // Call GetWindowState() to instantiate this class. | 81 // Call GetWindowState() to instantiate this class. |
| 83 ~WindowState(); | 82 ~WindowState(); |
| 84 | 83 |
| 85 // TODO(sky): remove these. They are temporary until converted to common | |
| 86 // types. | |
| 87 aura::Window* aura_window() { return WmWindowAura::GetAuraWindow(window_); } | |
| 88 const aura::Window* aura_window() const { | |
| 89 return WmWindowAura::GetAuraWindow(window_); | |
| 90 } | |
| 91 | |
| 92 WmWindow* window() { return window_; } | 84 WmWindow* window() { return window_; } |
| 93 const WmWindow* window() const { return window_; } | 85 const WmWindow* window() const { return window_; } |
| 94 | 86 |
| 95 bool HasDelegate() const; | 87 bool HasDelegate() const; |
| 96 void SetDelegate(std::unique_ptr<WindowStateDelegate> delegate); | 88 void SetDelegate(std::unique_ptr<WindowStateDelegate> delegate); |
| 97 | 89 |
| 98 // Returns the window's current ash state type. | 90 // Returns the window's current ash state type. |
| 99 // Refer to WindowStateType definition in wm_types.h as for why Ash | 91 // Refer to WindowStateType definition in wm_types.h as for why Ash |
| 100 // has its own state type. | 92 // has its own state type. |
| 101 WindowStateType GetStateType() const; | 93 WindowStateType GetStateType() const; |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 395 | 387 |
| 396 std::unique_ptr<State> current_state_; | 388 std::unique_ptr<State> current_state_; |
| 397 | 389 |
| 398 DISALLOW_COPY_AND_ASSIGN(WindowState); | 390 DISALLOW_COPY_AND_ASSIGN(WindowState); |
| 399 }; | 391 }; |
| 400 | 392 |
| 401 } // namespace wm | 393 } // namespace wm |
| 402 } // namespace ash | 394 } // namespace ash |
| 403 | 395 |
| 404 #endif // ASH_WM_WINDOW_STATE_H_ | 396 #endif // ASH_WM_WINDOW_STATE_H_ |
| OLD | NEW |