| Index: services/ui/ws/platform_display_default.h
|
| diff --git a/services/ui/ws/platform_display.h b/services/ui/ws/platform_display_default.h
|
| similarity index 50%
|
| copy from services/ui/ws/platform_display.h
|
| copy to services/ui/ws/platform_display_default.h
|
| index 702e9f99c944117d2b0c643e8fa515c3baf4dc05..215a9f0ec83c3a0ac715b915619571c98eca2ead 100644
|
| --- a/services/ui/ws/platform_display.h
|
| +++ b/services/ui/ws/platform_display_default.h
|
| @@ -1,109 +1,35 @@
|
| -// Copyright 2014 The Chromium Authors. All rights reserved.
|
| +// Copyright 2016 The Chromium Authors. All rights reserved.
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#ifndef SERVICES_UI_WS_PLATFORM_DISPLAY_H_
|
| -#define SERVICES_UI_WS_PLATFORM_DISPLAY_H_
|
| -
|
| -#include <stdint.h>
|
| +#ifndef SERVICES_UI_WS_PLATFORM_DISPLAY_DEFAULT_H_
|
| +#define SERVICES_UI_WS_PLATFORM_DISPLAY_DEFAULT_H_
|
|
|
| #include <memory>
|
|
|
| #include "base/macros.h"
|
| -#include "base/memory/weak_ptr.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.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;
|
| -}
|
| -
|
| -namespace gpu {
|
| -class GpuChannelHost;
|
| -}
|
| -
|
| namespace ui {
|
|
|
| class CursorLoader;
|
| class PlatformWindow;
|
| -struct TextInputState;
|
|
|
| namespace ws {
|
|
|
| -class PlatformDisplayFactory;
|
| -struct PlatformDisplayInitParams;
|
| -class ServerWindow;
|
| -
|
| -// PlatformDisplay is used to connect the root ServerWindow to a display.
|
| -class PlatformDisplay {
|
| - public:
|
| - virtual ~PlatformDisplay() {}
|
| -
|
| - static std::unique_ptr<PlatformDisplay> Create(
|
| - const PlatformDisplayInitParams& init_params);
|
| -
|
| - virtual int64_t GetId() const = 0;
|
| -
|
| - virtual void Init(PlatformDisplayDelegate* delegate) = 0;
|
| -
|
| - virtual void SetViewportSize(const gfx::Size& size) = 0;
|
| -
|
| - virtual void SetTitle(const base::string16& title) = 0;
|
| -
|
| - virtual void SetCapture() = 0;
|
| -
|
| - virtual void ReleaseCapture() = 0;
|
| -
|
| - virtual void SetCursorById(mojom::Cursor cursor) = 0;
|
| -
|
| - virtual void UpdateTextInputState(const ui::TextInputState& state) = 0;
|
| - virtual void SetImeVisibility(bool visible) = 0;
|
| -
|
| - virtual gfx::Rect GetBounds() const = 0;
|
| -
|
| - // Updates the viewport metrics for the display, returning true if any
|
| - // metrics have changed.
|
| - virtual bool UpdateViewportMetrics(
|
| - const display::ViewportMetrics& metrics) = 0;
|
| -
|
| - virtual const display::ViewportMetrics& GetViewportMetrics() const = 0;
|
| -
|
| - virtual bool IsPrimaryDisplay() const = 0;
|
| -
|
| - // Notifies the PlatformDisplay that a connection to the gpu has been
|
| - // established.
|
| - virtual void OnGpuChannelEstablished(
|
| - scoped_refptr<gpu::GpuChannelHost> gpu_channel) = 0;
|
| -
|
| - // Overrides factory for testing. Default (NULL) value indicates regular
|
| - // (non-test) environment.
|
| - static void set_factory_for_testing(PlatformDisplayFactory* factory) {
|
| - PlatformDisplay::factory_ = factory;
|
| - }
|
| -
|
| - private:
|
| - // Static factory instance (always NULL for non-test).
|
| - static PlatformDisplayFactory* factory_;
|
| -};
|
| -
|
| -// PlatformDisplay implementation that connects to the services necessary to
|
| -// actually display.
|
| -class DefaultPlatformDisplay : public PlatformDisplay,
|
| +// PlatformDisplay implementation that connects to a PlatformWindow and
|
| +// FrameGenerator for Chrome OS.
|
| +class PlatformDisplayDefault : public PlatformDisplay,
|
| public ui::PlatformWindowDelegate,
|
| private FrameGeneratorDelegate {
|
| public:
|
| - explicit DefaultPlatformDisplay(const PlatformDisplayInitParams& init_params);
|
| - ~DefaultPlatformDisplay() override;
|
| + explicit PlatformDisplayDefault(const PlatformDisplayInitParams& init_params);
|
| + ~PlatformDisplayDefault() override;
|
|
|
| // PlatformDisplay:
|
| void Init(PlatformDisplayDelegate* delegate) override;
|
| @@ -127,6 +53,7 @@ class DefaultPlatformDisplay : public PlatformDisplay,
|
| // 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).
|
| + // TODO(riajiang): This is totally broken with HDPI.
|
| void UpdateEventRootLocation(ui::LocatedEvent* event);
|
|
|
| // ui::PlatformWindowDelegate:
|
| @@ -145,7 +72,7 @@ class DefaultPlatformDisplay : public PlatformDisplay,
|
| // FrameGeneratorDelegate:
|
| bool IsInHighContrastMode() override;
|
|
|
| - int64_t id_;
|
| + int64_t display_id_;
|
|
|
| #if !defined(OS_ANDROID)
|
| std::unique_ptr<ui::CursorLoader> cursor_loader_;
|
| @@ -157,11 +84,10 @@ class DefaultPlatformDisplay : public PlatformDisplay,
|
| display::ViewportMetrics metrics_;
|
| std::unique_ptr<ui::PlatformWindow> platform_window_;
|
|
|
| - DISALLOW_COPY_AND_ASSIGN(DefaultPlatformDisplay);
|
| + DISALLOW_COPY_AND_ASSIGN(PlatformDisplayDefault);
|
| };
|
|
|
| } // namespace ws
|
| -
|
| } // namespace ui
|
|
|
| -#endif // SERVICES_UI_WS_PLATFORM_DISPLAY_H_
|
| +#endif // SERVICES_UI_WS_PLATFORM_DISPLAY_DEFAULT_H_
|
|
|