| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #include "ui/display/win/screen_win.h" | 5 #include "ui/display/win/screen_win.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 #include <inttypes.h> | 8 #include <inttypes.h> |
| 9 #include <stddef.h> | 9 #include <stddef.h> |
| 10 | 10 |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 hwnd_map_)); | 177 hwnd_map_)); |
| 178 gfx::Screen::SetScreenInstance(screen_win_.get()); | 178 gfx::Screen::SetScreenInstance(screen_win_.get()); |
| 179 } | 179 } |
| 180 | 180 |
| 181 ScreenWin* GetScreenWin() { | 181 ScreenWin* GetScreenWin() { |
| 182 return screen_win_.get(); | 182 return screen_win_.get(); |
| 183 } | 183 } |
| 184 | 184 |
| 185 private: | 185 private: |
| 186 HWND hwndLast_ = nullptr; | 186 HWND hwndLast_ = nullptr; |
| 187 scoped_ptr<ScreenWin> screen_win_; | 187 std::unique_ptr<ScreenWin> screen_win_; |
| 188 std::vector<MONITORINFOEX> monitor_infos_; | 188 std::vector<MONITORINFOEX> monitor_infos_; |
| 189 std::vector<DisplayInfo> display_infos_; | 189 std::vector<DisplayInfo> display_infos_; |
| 190 std::unordered_map<HWND, gfx::Rect> hwnd_map_; | 190 std::unordered_map<HWND, gfx::Rect> hwnd_map_; |
| 191 | 191 |
| 192 DISALLOW_COPY_AND_ASSIGN(TestScreenWinManager); | 192 DISALLOW_COPY_AND_ASSIGN(TestScreenWinManager); |
| 193 }; | 193 }; |
| 194 | 194 |
| 195 class ScreenWinTest : public testing::Test { | 195 class ScreenWinTest : public testing::Test { |
| 196 protected: | 196 protected: |
| 197 ScreenWinTest() = default; | 197 ScreenWinTest() = default; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 211 } | 211 } |
| 212 | 212 |
| 213 virtual void SetUpScreen(TestScreenWinInitializer* initializer) = 0; | 213 virtual void SetUpScreen(TestScreenWinInitializer* initializer) = 0; |
| 214 | 214 |
| 215 gfx::NativeWindow GetNativeWindowFromHWND(HWND hwnd) const { | 215 gfx::NativeWindow GetNativeWindowFromHWND(HWND hwnd) const { |
| 216 ScreenWin* screen_win = screen_win_initializer_->GetScreenWin(); | 216 ScreenWin* screen_win = screen_win_initializer_->GetScreenWin(); |
| 217 return screen_win->GetNativeWindowFromHWND(hwnd);; | 217 return screen_win->GetNativeWindowFromHWND(hwnd);; |
| 218 } | 218 } |
| 219 | 219 |
| 220 private: | 220 private: |
| 221 scoped_ptr<TestScreenWinManager> screen_win_initializer_; | 221 std::unique_ptr<TestScreenWinManager> screen_win_initializer_; |
| 222 | 222 |
| 223 DISALLOW_COPY_AND_ASSIGN(ScreenWinTest); | 223 DISALLOW_COPY_AND_ASSIGN(ScreenWinTest); |
| 224 }; | 224 }; |
| 225 | 225 |
| 226 // Single Display of 1.0 Device Scale Factor. | 226 // Single Display of 1.0 Device Scale Factor. |
| 227 class ScreenWinTestSingleDisplay1x : public ScreenWinTest { | 227 class ScreenWinTestSingleDisplay1x : public ScreenWinTest { |
| 228 public: | 228 public: |
| 229 ScreenWinTestSingleDisplay1x() = default; | 229 ScreenWinTestSingleDisplay1x() = default; |
| 230 | 230 |
| 231 void SetUpScreen(TestScreenWinInitializer* initializer) override { | 231 void SetUpScreen(TestScreenWinInitializer* initializer) override { |
| (...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 775 TEST_F(ScreenWinTestTwoDisplays2x1xVirtualized, GetPrimaryDisplay) { | 775 TEST_F(ScreenWinTestTwoDisplays2x1xVirtualized, GetPrimaryDisplay) { |
| 776 gfx::Screen* screen = GetScreen(); | 776 gfx::Screen* screen = GetScreen(); |
| 777 gfx::Display primary = screen->GetPrimaryDisplay(); | 777 gfx::Display primary = screen->GetPrimaryDisplay(); |
| 778 EXPECT_EQ(gfx::Point(0, 0), primary.bounds().origin()); | 778 EXPECT_EQ(gfx::Point(0, 0), primary.bounds().origin()); |
| 779 } | 779 } |
| 780 | 780 |
| 781 } // namespace | 781 } // namespace |
| 782 | 782 |
| 783 } // namespace win | 783 } // namespace win |
| 784 } // namespace display | 784 } // namespace display |
| OLD | NEW |