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

Unified Diff: headless/lib/browser/headless_screen.h

Issue 1674263002: headless: Initial headless embedder API implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fine, no console logging Mr. Presubmit. Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « headless/lib/browser/headless_devtools.cc ('k') | headless/lib/browser/headless_screen.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: headless/lib/browser/headless_screen.h
diff --git a/ui/aura/test/test_screen.h b/headless/lib/browser/headless_screen.h
similarity index 71%
copy from ui/aura/test/test_screen.h
copy to headless/lib/browser/headless_screen.h
index 03cb4107e1e5f8404c67a8f62f6fceb8b4da4050..c6b6b3be01b740d3a77687123c787c64bb5996da 100644
--- a/ui/aura/test/test_screen.h
+++ b/headless/lib/browser/headless_screen.h
@@ -1,9 +1,9 @@
-// Copyright (c) 2012 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 UI_AURA_TEST_TEST_SCREEN_H_
-#define UI_AURA_TEST_TEST_SCREEN_H_
+#ifndef HEADLESS_LIB_BROWSER_HEADLESS_SCREEN_H_
+#define HEADLESS_LIB_BROWSER_HEADLESS_SCREEN_H_
#include "base/compiler_specific.h"
#include "base/macros.h"
@@ -20,18 +20,18 @@ class Transform;
namespace aura {
class Window;
class WindowTreeHost;
+}
+
+namespace headless {
-// A minimal, testing Aura implementation of gfx::Screen.
-// TODO(bruthig): Consider extending gfx::test::TestScreen.
-class TestScreen : public gfx::Screen,
- public WindowObserver {
+class HeadlessScreen : public gfx::Screen, public aura::WindowObserver {
public:
// Creates a gfx::Screen of the specified size. If no size is specified, then
// creates a 800x600 screen. |size| is in physical pixels.
- static TestScreen* Create(const gfx::Size& size);
- ~TestScreen() override;
+ static HeadlessScreen* Create(const gfx::Size& size);
+ ~HeadlessScreen() override;
- WindowTreeHost* CreateHostForPrimaryDisplay();
+ aura::WindowTreeHost* CreateHostForPrimaryDisplay();
void SetDeviceScaleFactor(float device_scale_fator);
void SetDisplayRotation(gfx::Display::Rotation rotation);
@@ -43,10 +43,10 @@ class TestScreen : public gfx::Screen,
gfx::Transform GetUIScaleTransform() const;
// WindowObserver overrides:
- void OnWindowBoundsChanged(Window* window,
+ void OnWindowBoundsChanged(aura::Window* window,
const gfx::Rect& old_bounds,
const gfx::Rect& new_bounds) override;
- void OnWindowDestroying(Window* window) override;
+ void OnWindowDestroying(aura::Window* window) override;
// gfx::Screen overrides:
gfx::Point GetCursorScreenPoint() override;
@@ -62,17 +62,15 @@ class TestScreen : public gfx::Screen,
void RemoveObserver(gfx::DisplayObserver* observer) override;
private:
- explicit TestScreen(const gfx::Rect& screen_bounds);
+ explicit HeadlessScreen(const gfx::Rect& screen_bounds);
aura::WindowTreeHost* host_;
-
gfx::Display display_;
-
float ui_scale_;
- DISALLOW_COPY_AND_ASSIGN(TestScreen);
+ DISALLOW_COPY_AND_ASSIGN(HeadlessScreen);
};
-} // namespace aura
+} // namespace headless
-#endif // UI_AURA_TEST_TEST_SCREEN_H_
+#endif // HEADLESS_LIB_BROWSER_HEADLESS_SCREEN_H_
« no previous file with comments | « headless/lib/browser/headless_devtools.cc ('k') | headless/lib/browser/headless_screen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698