Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(247)

Unified Diff: services/ui/ws/platform_display.h

Issue 2507943002: Move PlatformDisplayDefault into it's own file. (Closed)
Patch Set: Fixes. Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « services/ui/ws/display.h ('k') | services/ui/ws/platform_display.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/ws/platform_display.h
diff --git a/services/ui/ws/platform_display.h b/services/ui/ws/platform_display.h
index 702e9f99c944117d2b0c643e8fa515c3baf4dc05..73acba6de83d521df85c725787cca37f4e3f94f8 100644
--- a/services/ui/ws/platform_display.h
+++ b/services/ui/ws/platform_display.h
@@ -9,20 +9,10 @@
#include <memory>
-#include "base/macros.h"
-#include "base/memory/weak_ptr.h"
+#include "base/memory/ref_counted.h"
#include "base/strings/string16.h"
-#include "build/build_config.h"
#include "services/ui/display/viewport_metrics.h"
#include "services/ui/public/interfaces/cursor.mojom.h"
-#include "services/ui/public/interfaces/window_manager.mojom.h"
-#include "services/ui/public/interfaces/window_manager_constants.mojom.h"
-#include "services/ui/public/interfaces/window_tree.mojom.h"
-#include "services/ui/ws/frame_generator.h"
-#include "services/ui/ws/frame_generator_delegate.h"
-#include "services/ui/ws/platform_display_delegate.h"
-#include "ui/display/display.h"
-#include "ui/platform_window/platform_window_delegate.h"
namespace gfx {
class Rect;
@@ -34,15 +24,13 @@ class GpuChannelHost;
namespace ui {
-class CursorLoader;
-class PlatformWindow;
struct TextInputState;
namespace ws {
+class PlatformDisplayDelegate;
class PlatformDisplayFactory;
struct PlatformDisplayInitParams;
-class ServerWindow;
// PlatformDisplay is used to connect the root ServerWindow to a display.
class PlatformDisplay {
@@ -96,72 +84,8 @@ class PlatformDisplay {
static PlatformDisplayFactory* factory_;
};
-// PlatformDisplay implementation that connects to the services necessary to
-// actually display.
-class DefaultPlatformDisplay : public PlatformDisplay,
- public ui::PlatformWindowDelegate,
- private FrameGeneratorDelegate {
- public:
- explicit DefaultPlatformDisplay(const PlatformDisplayInitParams& init_params);
- ~DefaultPlatformDisplay() override;
-
- // PlatformDisplay:
- void Init(PlatformDisplayDelegate* delegate) override;
- int64_t GetId() const override;
- void SetViewportSize(const gfx::Size& size) override;
- void SetTitle(const base::string16& title) override;
- void SetCapture() override;
- void ReleaseCapture() override;
- void SetCursorById(mojom::Cursor cursor) override;
- void UpdateTextInputState(const ui::TextInputState& state) override;
- void SetImeVisibility(bool visible) override;
- gfx::Rect GetBounds() const override;
- bool UpdateViewportMetrics(const display::ViewportMetrics& metrics) override;
- const display::ViewportMetrics& GetViewportMetrics() const override;
- bool IsPrimaryDisplay() const override;
- void OnGpuChannelEstablished(
- scoped_refptr<gpu::GpuChannelHost> gpu_channel) override;
-
- private:
- // Update the root_location of located events to be relative to the origin
- // of this display. For example, if the origin of this display is (1800, 0)
- // and the location of the event is (100, 200) then the root_location will be
- // updated to be (1900, 200).
- void UpdateEventRootLocation(ui::LocatedEvent* event);
-
- // ui::PlatformWindowDelegate:
- void OnBoundsChanged(const gfx::Rect& new_bounds) override;
- void OnDamageRect(const gfx::Rect& damaged_region) override;
- void DispatchEvent(ui::Event* event) override;
- void OnCloseRequest() override;
- void OnClosed() override;
- void OnWindowStateChanged(ui::PlatformWindowState new_state) override;
- void OnLostCapture() override;
- void OnAcceleratedWidgetAvailable(gfx::AcceleratedWidget widget,
- float device_scale_factor) override;
- void OnAcceleratedWidgetDestroyed() override;
- void OnActivationChanged(bool active) override;
-
- // FrameGeneratorDelegate:
- bool IsInHighContrastMode() override;
-
- int64_t id_;
-
-#if !defined(OS_ANDROID)
- std::unique_ptr<ui::CursorLoader> cursor_loader_;
-#endif
-
- PlatformDisplayDelegate* delegate_ = nullptr;
- std::unique_ptr<FrameGenerator> frame_generator_;
-
- display::ViewportMetrics metrics_;
- std::unique_ptr<ui::PlatformWindow> platform_window_;
-
- DISALLOW_COPY_AND_ASSIGN(DefaultPlatformDisplay);
-};
} // namespace ws
-
} // namespace ui
#endif // SERVICES_UI_WS_PLATFORM_DISPLAY_H_
« no previous file with comments | « services/ui/ws/display.h ('k') | services/ui/ws/platform_display.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698