Chromium Code Reviews| Index: ui/display/android/screen_android.h |
| diff --git a/ui/display/test/test_screen.h b/ui/display/android/screen_android.h |
| similarity index 53% |
| copy from ui/display/test/test_screen.h |
| copy to ui/display/android/screen_android.h |
| index fb822f5d8dcd67e11426add22056ad13f72583b6..3304317ce1ed47b3e25991a97ccc55590884fcc2 100644 |
| --- a/ui/display/test/test_screen.h |
| +++ b/ui/display/android/screen_android.h |
| @@ -1,53 +1,45 @@ |
| -// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Copyright (c) 2016 The Chromium Authors. All rights reserved. |
|
boliu
2016/10/26 17:24:20
remove (c)
Tima Vaisburd
2016/10/27 07:55:58
Gone while moving/renaming
|
| // 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 <map> |
| -#include <vector> |
| - |
| -#include "base/macros.h" |
| #include "ui/display/display.h" |
| +#include "ui/display/display_export.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 { |
| + |
| +class DISPLAY_EXPORT ScreenAndroid : public Screen { |
| public: |
| - TestScreen(); |
| - ~TestScreen() override; |
| + ScreenAndroid(); |
| + ~ScreenAndroid(); |
| - Display* display() { return &display_; } |
| + // Disallow copy and assign. |
| + ScreenAndroid(const ScreenAndroid& rhs) = delete; |
| + ScreenAndroid& operator=(const ScreenAndroid& rhs) = delete; |
| - // display::Screen: |
| + // Screen interface. |
| 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_; |
| + // Called from Java side. |
| + void UpdateDisplay(int display_id, const Display& display); |
| + void RemoveDisplay(int display_id); |
| - DISALLOW_COPY_AND_ASSIGN(TestScreen); |
| + private: |
| + std::map<int, Display> displays_; |
|
mthiesse
2016/10/26 14:49:49
It looks like other platforms (like ash) keep thei
boliu
2016/10/26 17:24:20
The point here is we don't want to expose ScreenAn
Tima Vaisburd
2016/10/27 07:55:58
Renamed screen_android.cc into display_android_man
|
| }; |
| -} // namespace test |
| } // namespace display |
| - |
| -#endif // UI_DISPLAY_TEST_TEST_SCREEN_H_ |