Revert "Fix broken channel icon in chrome://help on CrOS" and try again
[chromium-blink-merge.git] / extensions / shell / browser / shell_screen.h
blob4d24891785c7743f9e3de1c1bca8cde33a1346a4
1 // Copyright 2014 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 EXTENSIONS_SHELL_BROWSER_SHELL_SCREEN_H_
6 #define EXTENSIONS_SHELL_BROWSER_SHELL_SCREEN_H_
8 #include "base/macros.h"
9 #include "ui/aura/window_observer.h"
10 #include "ui/gfx/display.h"
11 #include "ui/gfx/screen.h"
13 namespace aura {
14 class WindowTreeHost;
17 namespace gfx {
18 class Size;
21 namespace extensions {
23 // A minimal Aura implementation of a screen. Scale factor is locked at 1.0.
24 // When running on a Linux desktop resizing the main window resizes the screen.
25 class ShellScreen : public gfx::Screen, public aura::WindowObserver {
26 public:
27 // Creates a screen occupying |size| physical pixels.
28 explicit ShellScreen(const gfx::Size& size);
29 ~ShellScreen() override;
31 // Caller owns the returned object.
32 aura::WindowTreeHost* CreateHostForPrimaryDisplay();
34 // WindowObserver overrides:
35 void OnWindowBoundsChanged(aura::Window* window,
36 const gfx::Rect& old_bounds,
37 const gfx::Rect& new_bounds) override;
38 void OnWindowDestroying(aura::Window* window) override;
40 // gfx::Screen overrides:
41 gfx::Point GetCursorScreenPoint() override;
42 gfx::NativeWindow GetWindowUnderCursor() override;
43 gfx::NativeWindow GetWindowAtScreenPoint(const gfx::Point& point) override;
44 int GetNumDisplays() const override;
45 std::vector<gfx::Display> GetAllDisplays() const override;
46 gfx::Display GetDisplayNearestWindow(gfx::NativeView view) const override;
47 gfx::Display GetDisplayNearestPoint(const gfx::Point& point) const override;
48 gfx::Display GetDisplayMatching(const gfx::Rect& match_rect) const override;
49 gfx::Display GetPrimaryDisplay() const override;
50 void AddObserver(gfx::DisplayObserver* observer) override;
51 void RemoveObserver(gfx::DisplayObserver* observer) override;
53 private:
54 aura::WindowTreeHost* host_; // Not owned.
55 gfx::Display display_;
57 DISALLOW_COPY_AND_ASSIGN(ShellScreen);
60 } // namespace extensions
62 #endif // EXTENSIONS_SHELL_BROWSER_SHELL_SCREEN_H_