Chromium Code Reviews| 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 SERVICES_UI_WS_PLATFORM_DISPLAY_DEFAULT_H_ | 5 #ifndef SERVICES_UI_WS_PLATFORM_DISPLAY_DEFAULT_H_ |
| 6 #define SERVICES_UI_WS_PLATFORM_DISPLAY_DEFAULT_H_ | 6 #define SERVICES_UI_WS_PLATFORM_DISPLAY_DEFAULT_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 22 class LocatedEvent; | 22 class LocatedEvent; |
| 23 class PlatformWindow; | 23 class PlatformWindow; |
| 24 | 24 |
| 25 namespace ws { | 25 namespace ws { |
| 26 | 26 |
| 27 // PlatformDisplay implementation that connects to a PlatformWindow and | 27 // PlatformDisplay implementation that connects to a PlatformWindow and |
| 28 // FrameGenerator for Chrome OS. | 28 // FrameGenerator for Chrome OS. |
| 29 class PlatformDisplayDefault : public PlatformDisplay, | 29 class PlatformDisplayDefault : public PlatformDisplay, |
| 30 public ui::PlatformWindowDelegate { | 30 public ui::PlatformWindowDelegate { |
| 31 public: | 31 public: |
| 32 // |image_cursors| may be null, for example on Android or in tests. | |
| 32 PlatformDisplayDefault(ServerWindow* root_window, | 33 PlatformDisplayDefault(ServerWindow* root_window, |
| 33 const display::ViewportMetrics& metrics); | 34 const display::ViewportMetrics& metrics, |
| 35 std::unique_ptr<ImageCursors> image_cursors); | |
| 34 ~PlatformDisplayDefault() override; | 36 ~PlatformDisplayDefault() override; |
| 35 | 37 |
| 36 // EventSource:: | 38 // EventSource:: |
| 37 EventSink* GetEventSink() override; | 39 EventSink* GetEventSink() override; |
| 38 | 40 |
| 39 // PlatformDisplay: | 41 // PlatformDisplay: |
| 40 void Init(PlatformDisplayDelegate* delegate) override; | 42 void Init(PlatformDisplayDelegate* delegate) override; |
| 41 void SetViewportSize(const gfx::Size& size) override; | 43 void SetViewportSize(const gfx::Size& size) override; |
| 42 void SetTitle(const base::string16& title) override; | 44 void SetTitle(const base::string16& title) override; |
| 43 void SetCapture() override; | 45 void SetCapture() override; |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 65 void OnClosed() override; | 67 void OnClosed() override; |
| 66 void OnWindowStateChanged(ui::PlatformWindowState new_state) override; | 68 void OnWindowStateChanged(ui::PlatformWindowState new_state) override; |
| 67 void OnLostCapture() override; | 69 void OnLostCapture() override; |
| 68 void OnAcceleratedWidgetAvailable(gfx::AcceleratedWidget widget, | 70 void OnAcceleratedWidgetAvailable(gfx::AcceleratedWidget widget, |
| 69 float device_scale_factor) override; | 71 float device_scale_factor) override; |
| 70 void OnAcceleratedWidgetDestroyed() override; | 72 void OnAcceleratedWidgetDestroyed() override; |
| 71 void OnActivationChanged(bool active) override; | 73 void OnActivationChanged(bool active) override; |
| 72 | 74 |
| 73 ServerWindow* root_window_; | 75 ServerWindow* root_window_; |
| 74 | 76 |
| 75 #if !defined(OS_ANDROID) | |
|
James Cook
2017/03/31 23:31:20
Lemme know if you want me to keep these ifdefs. I
| |
| 76 std::unique_ptr<ui::ImageCursors> image_cursors_; | 77 std::unique_ptr<ui::ImageCursors> image_cursors_; |
| 77 #endif | |
| 78 | 78 |
| 79 PlatformDisplayDelegate* delegate_ = nullptr; | 79 PlatformDisplayDelegate* delegate_ = nullptr; |
| 80 std::unique_ptr<FrameGenerator> frame_generator_; | 80 std::unique_ptr<FrameGenerator> frame_generator_; |
| 81 | 81 |
| 82 display::ViewportMetrics metrics_; | 82 display::ViewportMetrics metrics_; |
| 83 std::unique_ptr<ui::PlatformWindow> platform_window_; | 83 std::unique_ptr<ui::PlatformWindow> platform_window_; |
| 84 gfx::AcceleratedWidget widget_; | 84 gfx::AcceleratedWidget widget_; |
| 85 | 85 |
| 86 DISALLOW_COPY_AND_ASSIGN(PlatformDisplayDefault); | 86 DISALLOW_COPY_AND_ASSIGN(PlatformDisplayDefault); |
| 87 }; | 87 }; |
| 88 | 88 |
| 89 } // namespace ws | 89 } // namespace ws |
| 90 } // namespace ui | 90 } // namespace ui |
| 91 | 91 |
| 92 #endif // SERVICES_UI_WS_PLATFORM_DISPLAY_DEFAULT_H_ | 92 #endif // SERVICES_UI_WS_PLATFORM_DISPLAY_DEFAULT_H_ |
| OLD | NEW |