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

Unified Diff: ui/display/test/test_screen.h

Issue 1957523004: Rename gfx::test::TestScreen to display::test::TestScreen (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 | « ui/display/display.gyp ('k') | ui/display/test/test_screen.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/display/test/test_screen.h
diff --git a/ui/display/test/test_screen.h b/ui/display/test/test_screen.h
new file mode 100644
index 0000000000000000000000000000000000000000..2d04bd74bfb55793cea53ad6f0a9719bb2a7fefe
--- /dev/null
+++ b/ui/display/test/test_screen.h
@@ -0,0 +1,53 @@
+// Copyright 2015 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_DISPLAY_TEST_TEST_SCREEN_H_
+#define UI_DISPLAY_TEST_TEST_SCREEN_H_
+
+#include <vector>
+
+#include "base/macros.h"
+#include "ui/display/display.h"
+#include "ui/display/screen.h"
+
+namespace display {
+namespace test {
+
+// A dummy implementation of display::Screen that contains a single
+// display::Display only. The contained Display can be accessed and modified via
+// TestScreen::display().
+//
+// NOTE: Adding and removing display::DisplayOberver's are no-ops and observers
+// will NOT be notified ever.
+class TestScreen : public Screen {
+ public:
+ TestScreen();
+ ~TestScreen() override;
+
+ Display* display() { return &display_; }
+
+ // Screen:
+ gfx::Point GetCursorScreenPoint() override;
+ bool IsWindowUnderCursor(gfx::NativeWindow window) override;
+ gfx::NativeWindow GetWindowAtScreenPoint(const gfx::Point& point) override;
+ int GetNumDisplays() const override;
+ std::vector<Display> GetAllDisplays() const override;
+ Display GetDisplayNearestWindow(gfx::NativeView view) const override;
+ Display GetDisplayNearestPoint(const gfx::Point& point) const override;
+ Display GetDisplayMatching(const gfx::Rect& match_rect) const override;
+ Display GetPrimaryDisplay() const override;
+ void AddObserver(DisplayObserver* observer) override;
+ void RemoveObserver(DisplayObserver* observer) override;
+
+ private:
+ // The only display.
+ Display display_;
+
+ DISALLOW_COPY_AND_ASSIGN(TestScreen);
+};
+
+} // namespace test
+} // namespace display
+
+#endif // UI_DISPLAY_TEST_TEST_SCREEN_H_
« no previous file with comments | « ui/display/display.gyp ('k') | ui/display/test/test_screen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698