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/shelf/shelf_widget.h" | 8 #include "ash/common/shelf/shelf_widget.h" |
9 #include "ash/common/wm/root_window_finder.h" | 9 #include "ash/common/wm/root_window_finder.h" |
10 #include "ash/display/window_tree_host_manager.h" | 10 #include "ash/display/window_tree_host_manager.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 gfx::Point GetCursorScreenPoint() override { return gfx::Point(); } | 42 gfx::Point GetCursorScreenPoint() override { return gfx::Point(); } |
43 bool IsWindowUnderCursor(gfx::NativeWindow window) override { return false; } | 43 bool IsWindowUnderCursor(gfx::NativeWindow window) override { return false; } |
44 gfx::NativeWindow GetWindowAtScreenPoint(const gfx::Point& point) override { | 44 gfx::NativeWindow GetWindowAtScreenPoint(const gfx::Point& point) override { |
45 return NULL; | 45 return NULL; |
46 } | 46 } |
47 int GetNumDisplays() const override { return display_list_.size(); } | 47 int GetNumDisplays() const override { return display_list_.size(); } |
48 std::vector<display::Display> GetAllDisplays() const override { | 48 std::vector<display::Display> GetAllDisplays() const override { |
49 return display_list_; | 49 return display_list_; |
50 } | 50 } |
51 display::Display GetDisplayNearestWindow( | 51 display::Display GetDisplayNearestWindow( |
52 gfx::NativeView view) const override { | 52 const gfx::NativeView view) const override { |
53 return primary_display_; | 53 return primary_display_; |
54 } | 54 } |
55 display::Display GetDisplayNearestPoint( | 55 display::Display GetDisplayNearestPoint( |
56 const gfx::Point& point) const override { | 56 const gfx::Point& point) const override { |
57 return *display::FindDisplayNearestPoint(display_list_, point); | 57 return *display::FindDisplayNearestPoint(display_list_, point); |
58 } | 58 } |
59 display::Display GetDisplayMatching( | 59 display::Display GetDisplayMatching( |
60 const gfx::Rect& match_rect) const override { | 60 const gfx::Rect& match_rect) const override { |
61 const display::Display* matching = | 61 const display::Display* matching = |
62 display::FindDisplayWithBiggestIntersection(display_list_, match_rect); | 62 display::FindDisplayWithBiggestIntersection(display_list_, match_rect); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 | 108 |
109 int ScreenAsh::GetNumDisplays() const { | 109 int ScreenAsh::GetNumDisplays() const { |
110 return GetDisplayManager()->GetNumDisplays(); | 110 return GetDisplayManager()->GetNumDisplays(); |
111 } | 111 } |
112 | 112 |
113 std::vector<display::Display> ScreenAsh::GetAllDisplays() const { | 113 std::vector<display::Display> ScreenAsh::GetAllDisplays() const { |
114 return GetDisplayManager()->active_display_list(); | 114 return GetDisplayManager()->active_display_list(); |
115 } | 115 } |
116 | 116 |
117 display::Display ScreenAsh::GetDisplayNearestWindow( | 117 display::Display ScreenAsh::GetDisplayNearestWindow( |
118 gfx::NativeView window) const { | 118 const gfx::NativeView window) const { |
119 if (!window) | 119 if (!window) |
120 return GetPrimaryDisplay(); | 120 return GetPrimaryDisplay(); |
121 const aura::Window* root_window = window->GetRootWindow(); | 121 const aura::Window* root_window = window->GetRootWindow(); |
122 if (!root_window) | 122 if (!root_window) |
123 return GetPrimaryDisplay(); | 123 return GetPrimaryDisplay(); |
124 const RootWindowSettings* rws = GetRootWindowSettings(root_window); | 124 const RootWindowSettings* rws = GetRootWindowSettings(root_window); |
125 int64_t id = rws->display_id; | 125 int64_t id = rws->display_id; |
126 // if id is |kInvaildDisplayID|, it's being deleted. | 126 // if id is |kInvaildDisplayID|, it's being deleted. |
127 DCHECK(id != display::Display::kInvalidDisplayID); | 127 DCHECK(id != display::Display::kInvalidDisplayID); |
128 if (id == display::Display::kInvalidDisplayID) | 128 if (id == display::Display::kInvalidDisplayID) |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 } | 188 } |
189 | 189 |
190 // static | 190 // static |
191 void ScreenAsh::CreateScreenForShutdown() { | 191 void ScreenAsh::CreateScreenForShutdown() { |
192 delete screen_for_shutdown; | 192 delete screen_for_shutdown; |
193 screen_for_shutdown = new ScreenForShutdown(display::Screen::GetScreen()); | 193 screen_for_shutdown = new ScreenForShutdown(display::Screen::GetScreen()); |
194 display::Screen::SetScreenInstance(screen_for_shutdown); | 194 display::Screen::SetScreenInstance(screen_for_shutdown); |
195 } | 195 } |
196 | 196 |
197 } // namespace ash | 197 } // namespace ash |
OLD | NEW |