Remove ExtensionPrefs::SetDidExtensionEscalatePermissions.
[chromium-blink-merge.git] / ui / aura / test / test_screen.h
blob6324fa7cd41207d1d684014a1b2f7fe8f68d9651
1 // Copyright (c) 2012 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 UI_AURA_TEST_TEST_SCREEN_H_
6 #define UI_AURA_TEST_TEST_SCREEN_H_
8 #include "base/compiler_specific.h"
9 #include "ui/aura/window_observer.h"
10 #include "ui/gfx/display.h"
11 #include "ui/gfx/screen.h"
13 namespace gfx {
14 class Insets;
15 class Rect;
16 class Transform;
19 namespace aura {
20 class Window;
21 class WindowTreeHost;
23 // A minimal, testing Aura implementation of gfx::Screen.
24 class TestScreen : public gfx::Screen,
25 public WindowObserver {
26 public:
27 // Creates a gfx::Screen of the specified size. If no size is specified, then
28 // creates a 800x600 screen. |size| is in physical pixels.
29 static TestScreen* Create(const gfx::Size& size);
30 // Creates a TestScreen that uses fullscreen for the display.
31 static TestScreen* CreateFullscreen();
32 ~TestScreen() override;
34 WindowTreeHost* CreateHostForPrimaryDisplay();
36 void SetDeviceScaleFactor(float device_scale_fator);
37 void SetDisplayRotation(gfx::Display::Rotation rotation);
38 void SetUIScale(float ui_scale);
39 void SetWorkAreaInsets(const gfx::Insets& insets);
41 protected:
42 gfx::Transform GetRotationTransform() const;
43 gfx::Transform GetUIScaleTransform() const;
45 // WindowObserver overrides:
46 void OnWindowBoundsChanged(Window* window,
47 const gfx::Rect& old_bounds,
48 const gfx::Rect& new_bounds) override;
49 void OnWindowDestroying(Window* window) override;
51 // gfx::Screen overrides:
52 gfx::Point GetCursorScreenPoint() override;
53 gfx::NativeWindow GetWindowUnderCursor() override;
54 gfx::NativeWindow GetWindowAtScreenPoint(const gfx::Point& point) override;
55 int GetNumDisplays() const override;
56 std::vector<gfx::Display> GetAllDisplays() const override;
57 gfx::Display GetDisplayNearestWindow(gfx::NativeView view) const override;
58 gfx::Display GetDisplayNearestPoint(const gfx::Point& point) const override;
59 gfx::Display GetDisplayMatching(const gfx::Rect& match_rect) const override;
60 gfx::Display GetPrimaryDisplay() const override;
61 void AddObserver(gfx::DisplayObserver* observer) override;
62 void RemoveObserver(gfx::DisplayObserver* observer) override;
64 private:
65 explicit TestScreen(const gfx::Rect& screen_bounds);
67 aura::WindowTreeHost* host_;
69 gfx::Display display_;
71 float ui_scale_;
73 DISALLOW_COPY_AND_ASSIGN(TestScreen);
76 } // namespace aura
78 #endif // UI_AURA_TEST_TEST_SCREEN_H_