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 "ash/display/display_manager.h" | 5 #include "ash/display/display_manager.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ash/display/display_controller.h" | 10 #include "ash/display/display_controller.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 } // namespace | 74 } // namespace |
75 | 75 |
76 using aura::RootWindow; | 76 using aura::RootWindow; |
77 using aura::Window; | 77 using aura::Window; |
78 using std::string; | 78 using std::string; |
79 using std::vector; | 79 using std::vector; |
80 | 80 |
81 DEFINE_WINDOW_PROPERTY_KEY(int64, kDisplayIdKey, | 81 DEFINE_WINDOW_PROPERTY_KEY(int64, kDisplayIdKey, |
82 gfx::Display::kInvalidDisplayID); | 82 gfx::Display::kInvalidDisplayID); |
83 | 83 |
84 DisplayManager::DisplayManager() : | 84 DisplayManager::DisplayManager(DisplayManagerDelegate* delegate) : |
85 internal_display_id_(gfx::Display::kInvalidDisplayID), | 85 internal_display_id_(gfx::Display::kInvalidDisplayID), |
86 force_bounds_changed_(false) { | 86 force_bounds_changed_(false), |
| 87 delegate_(delegate) { |
87 Init(); | 88 Init(); |
88 } | 89 } |
89 | 90 |
90 DisplayManager::~DisplayManager() { | 91 DisplayManager::~DisplayManager() { |
91 } | 92 } |
92 | 93 |
93 // static | 94 // static |
94 void DisplayManager::CycleDisplay() { | 95 void DisplayManager::CycleDisplay() { |
95 Shell::GetInstance()->display_manager()->CycleDisplayImpl(); | 96 Shell::GetInstance()->display_manager()->CycleDisplayImpl(); |
96 } | 97 } |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 | 314 |
314 #if defined(USE_X11) && defined(OS_CHROMEOS) | 315 #if defined(USE_X11) && defined(OS_CHROMEOS) |
315 if (!changed_display_indices.empty() && base::chromeos::IsRunningOnChromeOS()) | 316 if (!changed_display_indices.empty() && base::chromeos::IsRunningOnChromeOS()) |
316 ui::ClearX11DefaultRootWindow(); | 317 ui::ClearX11DefaultRootWindow(); |
317 #endif | 318 #endif |
318 } | 319 } |
319 | 320 |
320 RootWindow* DisplayManager::CreateRootWindowForDisplay( | 321 RootWindow* DisplayManager::CreateRootWindowForDisplay( |
321 const gfx::Display& display) { | 322 const gfx::Display& display) { |
322 RootWindow::CreateParams params(display.bounds_in_pixel()); | 323 RootWindow::CreateParams params(display.bounds_in_pixel()); |
323 #if defined(OS_WIN) | 324 DCHECK(delegate_); |
324 if (base::win::GetVersion() >= base::win::VERSION_WIN8) { | 325 params.delegate = delegate_->CreateRootWindowDelegate(); |
325 params.host = aura::RemoteRootWindowHostWin::Create( | |
326 display.bounds_in_pixel()); | |
327 } | |
328 #endif | |
329 aura::RootWindow* root_window = new aura::RootWindow(params); | 326 aura::RootWindow* root_window = new aura::RootWindow(params); |
330 // No need to remove RootWindowObserver because | 327 // No need to remove RootWindowObserver because |
331 // the DisplayManager object outlives RootWindow objects. | 328 // the DisplayManager object outlives RootWindow objects. |
332 root_window->AddRootWindowObserver(this); | 329 root_window->AddRootWindowObserver(this); |
333 root_window->SetProperty(kDisplayIdKey, display.id()); | 330 root_window->SetProperty(kDisplayIdKey, display.id()); |
334 root_window->Init(); | 331 root_window->Init(); |
335 return root_window; | 332 return root_window; |
336 } | 333 } |
337 | 334 |
338 gfx::Display* DisplayManager::GetDisplayAt(size_t index) { | 335 gfx::Display* DisplayManager::GetDisplayAt(size_t index) { |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
575 DisplayList::iterator iter_to_update = to_update->begin(); | 572 DisplayList::iterator iter_to_update = to_update->begin(); |
576 DisplayList::const_iterator iter = displays_.begin(); | 573 DisplayList::const_iterator iter = displays_.begin(); |
577 for (; iter != displays_.end() && iter_to_update != to_update->end(); | 574 for (; iter != displays_.end() && iter_to_update != to_update->end(); |
578 ++iter, ++iter_to_update) { | 575 ++iter, ++iter_to_update) { |
579 (*iter_to_update).set_id((*iter).id()); | 576 (*iter_to_update).set_id((*iter).id()); |
580 } | 577 } |
581 } | 578 } |
582 | 579 |
583 } // namespace internal | 580 } // namespace internal |
584 } // namespace ash | 581 } // namespace ash |
OLD | NEW |