Upstreaming browser/ui/uikit_ui_util from iOS.
[chromium-blink-merge.git] / chromecast / graphics / cast_screen.h
blob50fbf70931dfad45f8f03ec0b9f2d4d56f72fb71
1 // Copyright 2015 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.
5 #ifndef CHROMECAST_GRAPHICS_CAST_SCREEN_H_
6 #define CHROMECAST_GRAPHICS_CAST_SCREEN_H_
8 #include "ui/gfx/display.h"
9 #include "ui/gfx/screen.h"
11 namespace chromecast {
13 namespace shell {
14 class CastBrowserMainParts;
15 } // namespace shell
17 // CastScreen is Chromecast's own minimal implementation of gfx::Screen.
18 // Right now, it almost exactly duplicates the behavior of aura's TestScreen
19 // class for necessary methods. The instantiation of CastScreen occurs in
20 // CastBrowserMainParts, where its ownership is assigned to CastBrowserProcess.
21 // To then subsequently access CastScreen, see CastBrowerProcess.
22 class CastScreen : public gfx::Screen {
23 public:
24 ~CastScreen() override;
26 // Updates the primary display size.
27 void UpdateDisplaySize(const gfx::Size& size);
29 // gfx::Screen overrides:
30 gfx::Point GetCursorScreenPoint() override;
31 gfx::NativeWindow GetWindowUnderCursor() override;
32 gfx::NativeWindow GetWindowAtScreenPoint(const gfx::Point& point) override;
33 int GetNumDisplays() const override;
34 std::vector<gfx::Display> GetAllDisplays() const override;
35 gfx::Display GetDisplayNearestWindow(gfx::NativeView view) const override;
36 gfx::Display GetDisplayNearestPoint(const gfx::Point& point) const override;
37 gfx::Display GetDisplayMatching(const gfx::Rect& match_rect) const override;
38 gfx::Display GetPrimaryDisplay() const override;
39 void AddObserver(gfx::DisplayObserver* observer) override;
40 void RemoveObserver(gfx::DisplayObserver* observer) override;
42 private:
43 CastScreen();
45 gfx::Display display_;
47 friend class shell::CastBrowserMainParts;
49 DISALLOW_COPY_AND_ASSIGN(CastScreen);
52 } // namespace chromecast
54 #endif // CHROMECAST_GRAPHICS_CAST_SCREEN_H_