| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/gfx/display_change_notifier.h" | 5 #include "ui/gfx/display_change_notifier.h" |
| 6 | 6 |
| 7 #include <stdint.h> |
| 8 |
| 7 #include "ui/gfx/display.h" | 9 #include "ui/gfx/display.h" |
| 8 #include "ui/gfx/display_observer.h" | 10 #include "ui/gfx/display_observer.h" |
| 9 | 11 |
| 10 namespace gfx { | 12 namespace gfx { |
| 11 | 13 |
| 12 namespace { | 14 namespace { |
| 13 | 15 |
| 14 class DisplayComparator { | 16 class DisplayComparator { |
| 15 public: | 17 public: |
| 16 explicit DisplayComparator(const Display& display) | 18 explicit DisplayComparator(const Display& display) |
| 17 : display_id_(display.id()) | 19 : display_id_(display.id()) |
| 18 {} | 20 {} |
| 19 | 21 |
| 20 bool operator()(const Display& display) const { | 22 bool operator()(const Display& display) const { |
| 21 return display.id() == display_id_; | 23 return display.id() == display_id_; |
| 22 } | 24 } |
| 23 | 25 |
| 24 private: | 26 private: |
| 25 int64 display_id_; | 27 int64_t display_id_; |
| 26 }; | 28 }; |
| 27 | 29 |
| 28 } // anonymous namespace | 30 } // anonymous namespace |
| 29 | 31 |
| 30 DisplayChangeNotifier::DisplayChangeNotifier() { | 32 DisplayChangeNotifier::DisplayChangeNotifier() { |
| 31 } | 33 } |
| 32 | 34 |
| 33 DisplayChangeNotifier::~DisplayChangeNotifier() { | 35 DisplayChangeNotifier::~DisplayChangeNotifier() { |
| 34 } | 36 } |
| 35 | 37 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 | 85 |
| 84 if (metrics != DisplayObserver::DISPLAY_METRIC_NONE) { | 86 if (metrics != DisplayObserver::DISPLAY_METRIC_NONE) { |
| 85 FOR_EACH_OBSERVER(DisplayObserver, | 87 FOR_EACH_OBSERVER(DisplayObserver, |
| 86 observer_list_, | 88 observer_list_, |
| 87 OnDisplayMetricsChanged(*new_it, metrics)); | 89 OnDisplayMetricsChanged(*new_it, metrics)); |
| 88 } | 90 } |
| 89 } | 91 } |
| 90 } | 92 } |
| 91 | 93 |
| 92 } // namespace gfx | 94 } // namespace gfx |
| OLD | NEW |