| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/ui/window_sizer/window_sizer_common_unittest.h" | 5 #include "chrome/browser/ui/window_sizer/window_sizer_common_unittest.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "ash/common/wm/window_resizer.h" | 10 #include "ash/common/wm/window_resizer.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 NOTREACHED(); | 54 NOTREACHED(); |
| 55 return NULL; | 55 return NULL; |
| 56 } | 56 } |
| 57 | 57 |
| 58 int GetNumDisplays() const override { return displays_.size(); } | 58 int GetNumDisplays() const override { return displays_.size(); } |
| 59 | 59 |
| 60 std::vector<display::Display> GetAllDisplays() const override { | 60 std::vector<display::Display> GetAllDisplays() const override { |
| 61 return displays_; | 61 return displays_; |
| 62 } | 62 } |
| 63 | 63 |
| 64 bool GetDisplayWithDisplayId(int64_t display_id, |
| 65 display::Display* display) const override { |
| 66 for (const display::Display& display_in_list : displays_) { |
| 67 if (display_in_list.id() == display_id) { |
| 68 *display = display_in_list; |
| 69 return true; |
| 70 } |
| 71 } |
| 72 return false; |
| 73 } |
| 74 |
| 64 display::Display GetDisplayNearestWindow( | 75 display::Display GetDisplayNearestWindow( |
| 65 gfx::NativeView view) const override { | 76 gfx::NativeView view) const override { |
| 66 #if defined(USE_AURA) | 77 #if defined(USE_AURA) |
| 67 return displays_[index_of_display_nearest_window_]; | 78 return displays_[index_of_display_nearest_window_]; |
| 68 #else | 79 #else |
| 69 NOTREACHED(); | 80 NOTREACHED(); |
| 70 return display::Display(); | 81 return display::Display(); |
| 71 #endif | 82 #endif |
| 72 } | 83 } |
| 73 | 84 |
| (...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 465 { // Check that a window which hangs out of the screen get moved back in. | 476 { // Check that a window which hangs out of the screen get moved back in. |
| 466 gfx::Rect window_bounds; | 477 gfx::Rect window_bounds; |
| 467 GetWindowBounds(p1024x768, p1024x768, gfx::Rect(), gfx::Rect(), | 478 GetWindowBounds(p1024x768, p1024x768, gfx::Rect(), gfx::Rect(), |
| 468 gfx::Rect(), DEFAULT, NULL, | 479 gfx::Rect(), DEFAULT, NULL, |
| 469 gfx::Rect(1020, 700, 100, 100), &window_bounds); | 480 gfx::Rect(1020, 700, 100, 100), &window_bounds); |
| 470 EXPECT_EQ("924,668 100x100", window_bounds.ToString()); | 481 EXPECT_EQ("924,668 100x100", window_bounds.ToString()); |
| 471 } | 482 } |
| 472 } | 483 } |
| 473 | 484 |
| 474 #endif // defined(OS_MACOSX) | 485 #endif // defined(OS_MACOSX) |
| OLD | NEW |