| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "components/mus/public/cpp/input_event_handler.h" | |
| 15 #include "components/mus/public/cpp/window_observer.h" | 14 #include "components/mus/public/cpp/window_observer.h" |
| 16 #include "ui/platform_window/platform_window.h" | 15 #include "ui/platform_window/platform_window.h" |
| 17 #include "ui/views/mus/mus_export.h" | 16 #include "ui/views/mus/mus_export.h" |
| 18 | 17 |
| 19 namespace bitmap_uploader { | 18 namespace bitmap_uploader { |
| 20 class BitmapUploader; | 19 class BitmapUploader; |
| 21 } | 20 } |
| 22 | 21 |
| 23 namespace shell { | 22 namespace shell { |
| 24 class Connector; | 23 class Connector; |
| 25 } | 24 } |
| 26 | 25 |
| 27 namespace ui { | 26 namespace ui { |
| 28 class Event; | |
| 29 class ViewProp; | 27 class ViewProp; |
| 30 } | 28 } |
| 31 | 29 |
| 32 namespace views { | 30 namespace views { |
| 33 | 31 |
| 34 // This class has been marked for deletion. Its implementation is being rolled | 32 // This class has been marked for deletion. Its implementation is being rolled |
| 35 // into views::NativeWidgetMus. See crbug.com/609555 for details. | 33 // into views::NativeWidgetMus. See crbug.com/609555 for details. |
| 36 class VIEWS_MUS_EXPORT PlatformWindowMus | 34 class VIEWS_MUS_EXPORT PlatformWindowMus |
| 37 : public NON_EXPORTED_BASE(ui::PlatformWindow), | 35 : public NON_EXPORTED_BASE(ui::PlatformWindow) { |
| 38 public NON_EXPORTED_BASE(mus::InputEventHandler) { | |
| 39 public: | 36 public: |
| 40 PlatformWindowMus(ui::PlatformWindowDelegate* delegate, | 37 PlatformWindowMus(ui::PlatformWindowDelegate* delegate, |
| 41 shell::Connector* connector, | 38 shell::Connector* connector, |
| 42 mus::Window* mus_window); | 39 mus::Window* mus_window); |
| 43 ~PlatformWindowMus() override; | 40 ~PlatformWindowMus() override; |
| 44 | 41 |
| 45 // ui::PlatformWindow: | 42 // ui::PlatformWindow: |
| 46 void Show() override; | 43 void Show() override; |
| 47 void Hide() override; | 44 void Hide() override; |
| 48 void Close() override; | 45 void Close() override; |
| 49 void SetBounds(const gfx::Rect& bounds) override; | 46 void SetBounds(const gfx::Rect& bounds) override; |
| 50 gfx::Rect GetBounds() override; | 47 gfx::Rect GetBounds() override; |
| 51 void SetTitle(const base::string16& title) override; | 48 void SetTitle(const base::string16& title) override; |
| 52 void SetCapture() override; | 49 void SetCapture() override; |
| 53 void ReleaseCapture() override; | 50 void ReleaseCapture() override; |
| 54 void ToggleFullscreen() override; | 51 void ToggleFullscreen() override; |
| 55 void Maximize() override; | 52 void Maximize() override; |
| 56 void Minimize() override; | 53 void Minimize() override; |
| 57 void Restore() override; | 54 void Restore() override; |
| 58 void SetCursor(ui::PlatformCursor cursor) override; | 55 void SetCursor(ui::PlatformCursor cursor) override; |
| 59 void MoveCursorTo(const gfx::Point& location) override; | 56 void MoveCursorTo(const gfx::Point& location) override; |
| 60 void ConfineCursorToBounds(const gfx::Rect& bounds) override; | 57 void ConfineCursorToBounds(const gfx::Rect& bounds) override; |
| 61 ui::PlatformImeController* GetPlatformImeController() override; | 58 ui::PlatformImeController* GetPlatformImeController() override; |
| 62 | 59 |
| 63 private: | 60 private: |
| 64 friend class PlatformWindowMusTest; | 61 friend class PlatformWindowMusTest; |
| 65 | 62 |
| 66 // mus::InputEventHandler: | |
| 67 void OnWindowInputEvent( | |
| 68 mus::Window* view, | |
| 69 const ui::Event& event, | |
| 70 std::unique_ptr<base::Callback<void(mus::mojom::EventResult)>>* | |
| 71 ack_callback) override; | |
| 72 | |
| 73 ui::PlatformWindowDelegate* delegate_; | 63 ui::PlatformWindowDelegate* delegate_; |
| 74 mus::Window* mus_window_; | 64 mus::Window* mus_window_; |
| 75 | 65 |
| 76 // True if OnWindowDestroyed() has been received. | 66 // True if OnWindowDestroyed() has been received. |
| 77 bool mus_window_destroyed_; | 67 bool mus_window_destroyed_; |
| 78 | 68 |
| 79 std::unique_ptr<bitmap_uploader::BitmapUploader> bitmap_uploader_; | 69 std::unique_ptr<bitmap_uploader::BitmapUploader> bitmap_uploader_; |
| 80 std::unique_ptr<ui::ViewProp> prop_; | 70 std::unique_ptr<ui::ViewProp> prop_; |
| 81 #ifndef NDEBUG | 71 #ifndef NDEBUG |
| 82 std::unique_ptr<base::WeakPtrFactory<PlatformWindowMus>> weak_factory_; | 72 std::unique_ptr<base::WeakPtrFactory<PlatformWindowMus>> weak_factory_; |
| 83 #endif | 73 #endif |
| 84 | 74 |
| 85 DISALLOW_COPY_AND_ASSIGN(PlatformWindowMus); | 75 DISALLOW_COPY_AND_ASSIGN(PlatformWindowMus); |
| 86 }; | 76 }; |
| 87 | 77 |
| 88 } // namespace views | 78 } // namespace views |
| 89 | 79 |
| 90 #endif // UI_VIEWS_MUS_PLATFORM_WINDOW_MUS_H_ | 80 #endif // UI_VIEWS_MUS_PLATFORM_WINDOW_MUS_H_ |
| OLD | NEW |