Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef ASH_WM_MUSHROME_ASH_NATIVE_CURSOR_MANAGER_H_ | |
| 6 #define ASH_WM_MUSHROME_ASH_NATIVE_CURSOR_MANAGER_H_ | |
| 7 | |
| 8 #include "ash/wm/ash_native_cursor_manager.h" | |
| 9 | |
| 10 namespace ui { | |
| 11 class CursorDataFactoryOzone; | |
| 12 class ImageCursors; | |
| 13 } | |
| 14 | |
| 15 namespace ash { | |
| 16 | |
| 17 // An AshNativeCursorManager which is used in Mushrome mode. | |
| 18 // | |
| 19 // ClassicAshNativeCursorManager implicitly communicates with ozone via | |
| 20 // ImageCursors and the window tree host, but in mushrome, we want to | |
| 21 // communicate with the window server purely through the mus interfaces. | |
| 22 // | |
| 23 // This doesn't mean that we can just cut out all ozone communication; we'll | |
| 24 // have to do what the mash does, which is install just the cursor factory part | |
| 25 // of ozone. | |
| 26 class ASH_EXPORT MushromeAshNativeCursorManager | |
| 27 : public AshNativeCursorManager { | |
| 28 public: | |
| 29 MushromeAshNativeCursorManager(); | |
| 30 ~MushromeAshNativeCursorManager() override; | |
| 31 | |
| 32 private: | |
| 33 // Overridden from AshNativeCursorManager: | |
| 34 void SetNativeCursorEnabled(bool enabled) override; | |
| 35 float GetScale() const override; | |
| 36 display::Display::Rotation GetRotation() const override; | |
| 37 | |
| 38 // Overridden from ::wm::NativeCursorManager: | |
| 39 void SetDisplay(const display::Display& display, | |
| 40 ::wm::NativeCursorManagerDelegate* delegate) override; | |
| 41 void SetCursor(gfx::NativeCursor cursor, | |
| 42 ::wm::NativeCursorManagerDelegate* delegate) override; | |
| 43 void SetVisibility(bool visible, | |
| 44 ::wm::NativeCursorManagerDelegate* delegate) override; | |
| 45 void SetCursorSet(ui::CursorSetType cursor_set, | |
| 46 ::wm::NativeCursorManagerDelegate* delegate) override; | |
| 47 void SetMouseEventsEnabled( | |
| 48 bool enabled, | |
| 49 ::wm::NativeCursorManagerDelegate* delegate) override; | |
| 50 | |
| 51 // The cursor location where the cursor was disabled. | |
| 52 gfx::Point disabled_cursor_location_; | |
| 53 | |
| 54 bool native_cursor_enabled_; | |
|
James Cook
2017/06/12 20:17:24
Is this initialized?
Elliot Glaysher
2017/06/12 23:18:46
Done.
| |
| 55 | |
| 56 #if defined(USE_OZONE) | |
| 57 std::unique_ptr<ui::CursorDataFactoryOzone> cursor_factory_ozone_; | |
| 58 #endif | |
| 59 | |
| 60 // Always nullptr when USE_OZONE is false. | |
| 61 std::unique_ptr<::ui::ImageCursors> image_cursors_; | |
| 62 | |
| 63 DISALLOW_COPY_AND_ASSIGN(MushromeAshNativeCursorManager); | |
| 64 }; | |
| 65 | |
| 66 } // namespace ash | |
| 67 | |
| 68 #endif // ASH_WM_MUSHROME_ASH_NATIVE_CURSOR_MANAGER_H_ | |
| OLD | NEW |