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

Side by Side Diff: headless/lib/browser/headless_screen.h

Issue 2669693002: Minimize headless code that refers to aura. (Closed)
Patch Set: Remove GetTopWindowContainingPoint Created 3 years, 10 months 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef HEADLESS_LIB_BROWSER_HEADLESS_SCREEN_H_ 5 #ifndef HEADLESS_LIB_BROWSER_HEADLESS_SCREEN_H_
6 #define HEADLESS_LIB_BROWSER_HEADLESS_SCREEN_H_ 6 #define HEADLESS_LIB_BROWSER_HEADLESS_SCREEN_H_
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "ui/aura/window_observer.h" 10 #include "ui/aura/window_observer.h"
11 #include "ui/display/display.h" 11 #include "ui/display/display.h"
12 #include "ui/display/screen_base.h" 12 #include "ui/display/screen_base.h"
13 13
14 namespace gfx { 14 namespace gfx {
15 class Insets;
16 class Rect; 15 class Rect;
17 class Transform;
18 }
19
20 namespace aura {
21 class Window;
22 class WindowTreeHost;
23 } 16 }
24 17
25 namespace headless { 18 namespace headless {
26 19
27 class HeadlessScreen : public display::ScreenBase, public aura::WindowObserver { 20 class HeadlessScreen : public display::ScreenBase {
28 public: 21 public:
29 // Creates a display::Screen of the specified size (physical pixels). 22 // Creates a display::Screen of the specified size (physical pixels).
30 static HeadlessScreen* Create(const gfx::Size& size); 23 static HeadlessScreen* Create(const gfx::Size& size);
31 ~HeadlessScreen() override; 24 ~HeadlessScreen() override;
32 25
33 aura::WindowTreeHost* CreateHostForPrimaryDisplay();
34
35 void SetDeviceScaleFactor(float device_scale_fator);
36 void SetDisplayRotation(display::Display::Rotation rotation);
37 void SetUIScale(float ui_scale);
38 void SetWorkAreaInsets(const gfx::Insets& insets);
39
40 protected: 26 protected:
41 gfx::Transform GetRotationTransform() const;
42 gfx::Transform GetUIScaleTransform() const;
43
44 // WindowObserver overrides:
45 void OnWindowBoundsChanged(aura::Window* window,
46 const gfx::Rect& old_bounds,
47 const gfx::Rect& new_bounds) override;
48 void OnWindowDestroying(aura::Window* window) override;
49
50 // display::Screen overrides: 27 // display::Screen overrides:
51 gfx::Point GetCursorScreenPoint() override; 28 gfx::Point GetCursorScreenPoint() override;
52 bool IsWindowUnderCursor(gfx::NativeWindow window) override; 29 bool IsWindowUnderCursor(gfx::NativeWindow window) override;
53 gfx::NativeWindow GetWindowAtScreenPoint(const gfx::Point& point) override; 30 gfx::NativeWindow GetWindowAtScreenPoint(const gfx::Point& point) override;
54 display::Display GetDisplayNearestWindow(gfx::NativeView view) const override; 31 display::Display GetDisplayNearestWindow(gfx::NativeView view) const override;
55 32
56 private: 33 private:
57 explicit HeadlessScreen(const gfx::Rect& screen_bounds); 34 explicit HeadlessScreen(const gfx::Rect& screen_bounds);
58 35
59 aura::WindowTreeHost* host_;
60 float ui_scale_;
61
62 DISALLOW_COPY_AND_ASSIGN(HeadlessScreen); 36 DISALLOW_COPY_AND_ASSIGN(HeadlessScreen);
63 }; 37 };
64 38
65 } // namespace headless 39 } // namespace headless
66 40
67 #endif // HEADLESS_LIB_BROWSER_HEADLESS_SCREEN_H_ 41 #endif // HEADLESS_LIB_BROWSER_HEADLESS_SCREEN_H_
OLDNEW
« no previous file with comments | « headless/lib/browser/headless_browser_main_parts.cc ('k') | headless/lib/browser/headless_screen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698