| 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" | 
|  11 #include "services/ui/display/viewport_metrics.h" |  11 #include "services/ui/display/viewport_metrics.h" | 
|  12 #include "services/ui/ws/frame_generator.h" |  12 #include "services/ui/ws/frame_generator.h" | 
|  13 #include "services/ui/ws/frame_generator_delegate.h" |  | 
|  14 #include "services/ui/ws/platform_display.h" |  13 #include "services/ui/ws/platform_display.h" | 
|  15 #include "services/ui/ws/platform_display_delegate.h" |  14 #include "services/ui/ws/platform_display_delegate.h" | 
|  16 #include "services/ui/ws/server_window.h" |  15 #include "services/ui/ws/server_window.h" | 
|  17 #include "ui/platform_window/platform_window_delegate.h" |  16 #include "ui/platform_window/platform_window_delegate.h" | 
|  18  |  17  | 
|  19 namespace ui { |  18 namespace ui { | 
|  20  |  19  | 
|  21 class ImageCursors; |  20 class ImageCursors; | 
|  22 class LocatedEvent; |  21 class LocatedEvent; | 
|  23 class PlatformWindow; |  22 class PlatformWindow; | 
|  24  |  23  | 
|  25 namespace ws { |  24 namespace ws { | 
|  26  |  25  | 
|  27 // PlatformDisplay implementation that connects to a PlatformWindow and |  26 // PlatformDisplay implementation that connects to a PlatformWindow and | 
|  28 // FrameGenerator for Chrome OS. |  27 // FrameGenerator for Chrome OS. | 
|  29 class PlatformDisplayDefault : public PlatformDisplay, |  28 class PlatformDisplayDefault : public PlatformDisplay, | 
|  30                                public ui::PlatformWindowDelegate, |  29                                public ui::PlatformWindowDelegate { | 
|  31                                public FrameGeneratorDelegate { |  | 
|  32  public: |  30  public: | 
|  33   PlatformDisplayDefault(ServerWindow* root_window, |  31   PlatformDisplayDefault(ServerWindow* root_window, | 
|  34                          const display::ViewportMetrics& metrics); |  32                          const display::ViewportMetrics& metrics); | 
|  35   ~PlatformDisplayDefault() override; |  33   ~PlatformDisplayDefault() override; | 
|  36  |  34  | 
|  37   // PlatformDisplay: |  35   // PlatformDisplay: | 
|  38   void Init(PlatformDisplayDelegate* delegate) override; |  36   void Init(PlatformDisplayDelegate* delegate) override; | 
|  39   void SetViewportSize(const gfx::Size& size) override; |  37   void SetViewportSize(const gfx::Size& size) override; | 
|  40   void SetTitle(const base::string16& title) override; |  38   void SetTitle(const base::string16& title) override; | 
|  41   void SetCapture() override; |  39   void SetCapture() override; | 
| (...skipping 19 matching lines...) Expand all  Loading... | 
|  61   void DispatchEvent(ui::Event* event) override; |  59   void DispatchEvent(ui::Event* event) override; | 
|  62   void OnCloseRequest() override; |  60   void OnCloseRequest() override; | 
|  63   void OnClosed() override; |  61   void OnClosed() override; | 
|  64   void OnWindowStateChanged(ui::PlatformWindowState new_state) override; |  62   void OnWindowStateChanged(ui::PlatformWindowState new_state) override; | 
|  65   void OnLostCapture() override; |  63   void OnLostCapture() override; | 
|  66   void OnAcceleratedWidgetAvailable(gfx::AcceleratedWidget widget, |  64   void OnAcceleratedWidgetAvailable(gfx::AcceleratedWidget widget, | 
|  67                                     float device_scale_factor) override; |  65                                     float device_scale_factor) override; | 
|  68   void OnAcceleratedWidgetDestroyed() override; |  66   void OnAcceleratedWidgetDestroyed() override; | 
|  69   void OnActivationChanged(bool active) override; |  67   void OnActivationChanged(bool active) override; | 
|  70  |  68  | 
|  71   // FrameGeneratorDelegate: |  | 
|  72   bool IsInHighContrastMode() override; |  | 
|  73  |  | 
|  74   ServerWindow* root_window_; |  69   ServerWindow* root_window_; | 
|  75  |  70  | 
|  76 #if !defined(OS_ANDROID) |  71 #if !defined(OS_ANDROID) | 
|  77   std::unique_ptr<ui::ImageCursors> image_cursors_; |  72   std::unique_ptr<ui::ImageCursors> image_cursors_; | 
|  78 #endif |  73 #endif | 
|  79  |  74  | 
|  80   PlatformDisplayDelegate* delegate_ = nullptr; |  75   PlatformDisplayDelegate* delegate_ = nullptr; | 
|  81   std::unique_ptr<FrameGenerator> frame_generator_; |  76   std::unique_ptr<FrameGenerator> frame_generator_; | 
|  82  |  77  | 
|  83   display::ViewportMetrics metrics_; |  78   display::ViewportMetrics metrics_; | 
|  84   std::unique_ptr<ui::PlatformWindow> platform_window_; |  79   std::unique_ptr<ui::PlatformWindow> platform_window_; | 
|  85   gfx::AcceleratedWidget widget_; |  80   gfx::AcceleratedWidget widget_; | 
|  86   float init_device_scale_factor_; |  81   float init_device_scale_factor_; | 
|  87  |  82  | 
|  88   DISALLOW_COPY_AND_ASSIGN(PlatformDisplayDefault); |  83   DISALLOW_COPY_AND_ASSIGN(PlatformDisplayDefault); | 
|  89 }; |  84 }; | 
|  90  |  85  | 
|  91 }  // namespace ws |  86 }  // namespace ws | 
|  92 }  // namespace ui |  87 }  // namespace ui | 
|  93  |  88  | 
|  94 #endif  // SERVICES_UI_WS_PLATFORM_DISPLAY_DEFAULT_H_ |  89 #endif  // SERVICES_UI_WS_PLATFORM_DISPLAY_DEFAULT_H_ | 
| OLD | NEW |