OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 UI_VIEWS_MUS_PLATFORM_WINDOW_MUS_H_ | 5 #ifndef UI_VIEWS_MUS_PLATFORM_WINDOW_MUS_H_ |
6 #define UI_VIEWS_MUS_PLATFORM_WINDOW_MUS_H_ | 6 #define UI_VIEWS_MUS_PLATFORM_WINDOW_MUS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "components/mus/public/cpp/window_observer.h" | 12 #include "components/mus/public/cpp/window_observer.h" |
13 #include "ui/platform_window/platform_window.h" | 13 #include "ui/platform_window/platform_window.h" |
14 #include "ui/views/mus/mus_export.h" | 14 #include "ui/views/mus/mus_export.h" |
15 | 15 |
16 namespace views { | 16 namespace views { |
17 | 17 |
18 class VIEWS_MUS_EXPORT PlatformWindowMus | 18 class VIEWS_MUS_EXPORT PlatformWindowMus |
19 : public NON_EXPORTED_BASE(ui::PlatformWindow), | 19 : public NON_EXPORTED_BASE(ui::PlatformWindow), |
20 public mus::WindowObserver { | 20 public mus::WindowObserver { |
21 public: | 21 public: |
22 PlatformWindowMus(ui::PlatformWindowDelegate* delegate, | 22 PlatformWindowMus(ui::PlatformWindowDelegate* delegate, |
23 mus::Window* mus_window); | 23 mus::Window* mus_window); |
24 ~PlatformWindowMus() override; | 24 ~PlatformWindowMus() override; |
25 | 25 |
26 void Activate(); | 26 void Activate(); |
27 | 27 |
| 28 void SetCursorById(mus::mojom::Cursor cursor); |
| 29 |
28 // ui::PlatformWindow: | 30 // ui::PlatformWindow: |
29 void Show() override; | 31 void Show() override; |
30 void Hide() override; | 32 void Hide() override; |
31 void Close() override; | 33 void Close() override; |
32 void SetBounds(const gfx::Rect& bounds) override; | 34 void SetBounds(const gfx::Rect& bounds) override; |
33 gfx::Rect GetBounds() override; | 35 gfx::Rect GetBounds() override; |
34 void SetTitle(const base::string16& title) override; | 36 void SetTitle(const base::string16& title) override; |
35 void SetCapture() override; | 37 void SetCapture() override; |
36 void ReleaseCapture() override; | 38 void ReleaseCapture() override; |
37 void ToggleFullscreen() override; | 39 void ToggleFullscreen() override; |
38 void Maximize() override; | 40 void Maximize() override; |
39 void Minimize() override; | 41 void Minimize() override; |
40 void Restore() override; | 42 void Restore() override; |
41 void SetCursor(ui::PlatformCursor cursor) override; | 43 void SetCursor(ui::PlatformCursor cursor) override; |
42 void MoveCursorTo(const gfx::Point& location) override; | 44 void MoveCursorTo(const gfx::Point& location) override; |
43 void ConfineCursorToBounds(const gfx::Rect& bounds) override; | 45 void ConfineCursorToBounds(const gfx::Rect& bounds) override; |
44 ui::PlatformImeController* GetPlatformImeController() override; | 46 ui::PlatformImeController* GetPlatformImeController() override; |
45 | 47 |
46 private: | 48 private: |
47 void SetShowState(mus::mojom::ShowState show_state); | 49 void SetShowState(mus::mojom::ShowState show_state); |
48 | 50 |
49 // mus::WindowObserver: | 51 // mus::WindowObserver: |
50 void OnWindowDestroyed(mus::Window* window) override; | 52 void OnWindowDestroyed(mus::Window* window) override; |
51 void OnWindowBoundsChanged(mus::Window* window, | 53 void OnWindowBoundsChanged(mus::Window* window, |
52 const gfx::Rect& old_bounds, | 54 const gfx::Rect& old_bounds, |
53 const gfx::Rect& new_bounds) override; | 55 const gfx::Rect& new_bounds) override; |
54 void OnWindowFocusChanged(mus::Window* gained_focus, | 56 void OnWindowFocusChanged(mus::Window* gained_focus, |
55 mus::Window* lost_focus) override; | 57 mus::Window* lost_focus) override; |
| 58 void OnWindowPredefinedCursorChanged(mus::Window* window, |
| 59 mus::mojom::Cursor cursor) override; |
56 void OnWindowInputEvent(mus::Window* view, | 60 void OnWindowInputEvent(mus::Window* view, |
57 const mus::mojom::EventPtr& event) override; | 61 const mus::mojom::EventPtr& event) override; |
58 void OnWindowSharedPropertyChanged( | 62 void OnWindowSharedPropertyChanged( |
59 mus::Window* window, | 63 mus::Window* window, |
60 const std::string& name, | 64 const std::string& name, |
61 const std::vector<uint8_t>* old_data, | 65 const std::vector<uint8_t>* old_data, |
62 const std::vector<uint8_t>* new_data) override; | 66 const std::vector<uint8_t>* new_data) override; |
63 | 67 |
64 ui::PlatformWindowDelegate* delegate_; | 68 ui::PlatformWindowDelegate* delegate_; |
65 mus::Window* mus_window_; | 69 mus::Window* mus_window_; |
66 mus::mojom::ShowState show_state_; | 70 mus::mojom::ShowState show_state_; |
| 71 mus::mojom::Cursor last_cursor_; |
67 bool has_capture_; | 72 bool has_capture_; |
68 | 73 |
69 DISALLOW_COPY_AND_ASSIGN(PlatformWindowMus); | 74 DISALLOW_COPY_AND_ASSIGN(PlatformWindowMus); |
70 }; | 75 }; |
71 | 76 |
72 } // namespace views | 77 } // namespace views |
73 | 78 |
74 #endif // UI_VIEWS_MUS_PLATFORM_WINDOW_MUS_H_ | 79 #endif // UI_VIEWS_MUS_PLATFORM_WINDOW_MUS_H_ |
OLD | NEW |