| 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 "blimp/engine/app/ui/blimp_screen.h" | 5 #include "blimp/engine/app/ui/blimp_screen.h" |
| 6 | 6 |
| 7 #include "ui/aura/window.h" | 7 #include "ui/aura/window.h" |
| 8 #include "ui/aura/window_tree_host.h" | 8 #include "ui/aura/window_tree_host.h" |
| 9 #include "ui/display/display_observer.h" | 9 #include "ui/display/display_observer.h" |
| 10 #include "ui/gfx/geometry/size.h" | 10 #include "ui/gfx/geometry/size.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 | 32 |
| 33 uint32_t metrics = display::DisplayObserver::DISPLAY_METRIC_NONE; | 33 uint32_t metrics = display::DisplayObserver::DISPLAY_METRIC_NONE; |
| 34 if (scale != display_.device_scale_factor()) | 34 if (scale != display_.device_scale_factor()) |
| 35 metrics |= display::DisplayObserver::DISPLAY_METRIC_DEVICE_SCALE_FACTOR; | 35 metrics |= display::DisplayObserver::DISPLAY_METRIC_DEVICE_SCALE_FACTOR; |
| 36 | 36 |
| 37 if (size != display_.GetSizeInPixel()) | 37 if (size != display_.GetSizeInPixel()) |
| 38 metrics |= display::DisplayObserver::DISPLAY_METRIC_BOUNDS; | 38 metrics |= display::DisplayObserver::DISPLAY_METRIC_BOUNDS; |
| 39 | 39 |
| 40 display_.SetScaleAndBounds(scale, gfx::Rect(size)); | 40 display_.SetScaleAndBounds(scale, gfx::Rect(size)); |
| 41 | 41 |
| 42 FOR_EACH_OBSERVER(display::DisplayObserver, observers_, | 42 for (auto& observer : observers_) |
| 43 OnDisplayMetricsChanged(display_, metrics)); | 43 observer.OnDisplayMetricsChanged(display_, metrics); |
| 44 } | 44 } |
| 45 | 45 |
| 46 gfx::Point BlimpScreen::GetCursorScreenPoint() { | 46 gfx::Point BlimpScreen::GetCursorScreenPoint() { |
| 47 return gfx::Point(); | 47 return gfx::Point(); |
| 48 } | 48 } |
| 49 | 49 |
| 50 bool BlimpScreen::IsWindowUnderCursor(gfx::NativeWindow window) { | 50 bool BlimpScreen::IsWindowUnderCursor(gfx::NativeWindow window) { |
| 51 NOTIMPLEMENTED(); | 51 NOTIMPLEMENTED(); |
| 52 return false; | 52 return false; |
| 53 } | 53 } |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 void BlimpScreen::AddObserver(display::DisplayObserver* observer) { | 88 void BlimpScreen::AddObserver(display::DisplayObserver* observer) { |
| 89 observers_.AddObserver(observer); | 89 observers_.AddObserver(observer); |
| 90 } | 90 } |
| 91 | 91 |
| 92 void BlimpScreen::RemoveObserver(display::DisplayObserver* observer) { | 92 void BlimpScreen::RemoveObserver(display::DisplayObserver* observer) { |
| 93 observers_.RemoveObserver(observer); | 93 observers_.RemoveObserver(observer); |
| 94 } | 94 } |
| 95 | 95 |
| 96 } // namespace engine | 96 } // namespace engine |
| 97 } // namespace blimp | 97 } // namespace blimp |
| OLD | NEW |