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 "ash/display/screen_ash.h" | 5 #include "ash/display/screen_ash.h" |
6 | 6 |
7 #include "ash/aura/wm_window_aura.h" | 7 #include "ash/aura/wm_window_aura.h" |
8 #include "ash/common/wm/root_window_finder.h" | 8 #include "ash/common/wm/root_window_finder.h" |
9 #include "ash/display/display_manager.h" | 9 #include "ash/display/display_manager.h" |
10 #include "ash/display/window_tree_host_manager.h" | 10 #include "ash/display/window_tree_host_manager.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 namespace { | 26 namespace { |
27 | 27 |
28 DisplayManager* GetDisplayManager() { | 28 DisplayManager* GetDisplayManager() { |
29 return Shell::GetInstance()->display_manager(); | 29 return Shell::GetInstance()->display_manager(); |
30 } | 30 } |
31 | 31 |
32 class ScreenForShutdown : public display::Screen { | 32 class ScreenForShutdown : public display::Screen { |
33 public: | 33 public: |
34 explicit ScreenForShutdown(ScreenAsh* screen_ash) | 34 explicit ScreenForShutdown(ScreenAsh* screen_ash) |
35 : display_list_(screen_ash->GetAllDisplays()), | 35 : display_list_(screen_ash->GetAllDisplays()), |
36 primary_display_(screen_ash->GetPrimaryDisplay()) { | 36 primary_display_(screen_ash->GetPrimaryDisplay()) {} |
37 } | |
38 | 37 |
39 // display::Screen overrides: | 38 // display::Screen overrides: |
40 gfx::Point GetCursorScreenPoint() override { return gfx::Point(); } | 39 gfx::Point GetCursorScreenPoint() override { return gfx::Point(); } |
41 bool IsWindowUnderCursor(gfx::NativeWindow window) override { return false; } | 40 bool IsWindowUnderCursor(gfx::NativeWindow window) override { return false; } |
42 gfx::NativeWindow GetWindowAtScreenPoint(const gfx::Point& point) override { | 41 gfx::NativeWindow GetWindowAtScreenPoint(const gfx::Point& point) override { |
43 return NULL; | 42 return NULL; |
44 } | 43 } |
45 int GetNumDisplays() const override { return display_list_.size(); } | 44 int GetNumDisplays() const override { return display_list_.size(); } |
46 std::vector<display::Display> GetAllDisplays() const override { | 45 std::vector<display::Display> GetAllDisplays() const override { |
47 return display_list_; | 46 return display_list_; |
(...skipping 23 matching lines...) Expand all Loading... |
71 | 70 |
72 private: | 71 private: |
73 const std::vector<display::Display> display_list_; | 72 const std::vector<display::Display> display_list_; |
74 const display::Display primary_display_; | 73 const display::Display primary_display_; |
75 | 74 |
76 DISALLOW_COPY_AND_ASSIGN(ScreenForShutdown); | 75 DISALLOW_COPY_AND_ASSIGN(ScreenForShutdown); |
77 }; | 76 }; |
78 | 77 |
79 } // namespace | 78 } // namespace |
80 | 79 |
81 ScreenAsh::ScreenAsh() { | 80 ScreenAsh::ScreenAsh() {} |
82 } | |
83 | 81 |
84 ScreenAsh::~ScreenAsh() { | 82 ScreenAsh::~ScreenAsh() {} |
85 } | |
86 | 83 |
87 void ScreenAsh::NotifyMetricsChanged(const display::Display& display, | 84 void ScreenAsh::NotifyMetricsChanged(const display::Display& display, |
88 uint32_t metrics) { | 85 uint32_t metrics) { |
89 FOR_EACH_OBSERVER(display::DisplayObserver, observers_, | 86 FOR_EACH_OBSERVER(display::DisplayObserver, observers_, |
90 OnDisplayMetricsChanged(display, metrics)); | 87 OnDisplayMetricsChanged(display, metrics)); |
91 } | 88 } |
92 | 89 |
93 void ScreenAsh::NotifyDisplayAdded(const display::Display& display) { | 90 void ScreenAsh::NotifyDisplayAdded(const display::Display& display) { |
94 FOR_EACH_OBSERVER(display::DisplayObserver, observers_, | 91 FOR_EACH_OBSERVER(display::DisplayObserver, observers_, |
95 OnDisplayAdded(display)); | 92 OnDisplayAdded(display)); |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 | 186 |
190 void ScreenAsh::RemoveObserver(display::DisplayObserver* observer) { | 187 void ScreenAsh::RemoveObserver(display::DisplayObserver* observer) { |
191 observers_.RemoveObserver(observer); | 188 observers_.RemoveObserver(observer); |
192 } | 189 } |
193 | 190 |
194 display::Screen* ScreenAsh::CloneForShutdown() { | 191 display::Screen* ScreenAsh::CloneForShutdown() { |
195 return new ScreenForShutdown(this); | 192 return new ScreenForShutdown(this); |
196 } | 193 } |
197 | 194 |
198 } // namespace ash | 195 } // namespace ash |
OLD | NEW |