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" |
| 11 #include "ash/host/root_window_host_factory.h" |
11 #include "ash/screen_ash.h" | 12 #include "ash/screen_ash.h" |
12 #include "ash/shell.h" | 13 #include "ash/shell.h" |
13 #include "base/command_line.h" | 14 #include "base/command_line.h" |
14 #include "base/stl_util.h" | 15 #include "base/stl_util.h" |
15 #include "base/string_split.h" | 16 #include "base/string_split.h" |
16 #include "base/stringprintf.h" | 17 #include "base/stringprintf.h" |
17 #include "base/utf_string_conversions.h" | 18 #include "base/utf_string_conversions.h" |
18 #include "grit/ash_strings.h" | 19 #include "grit/ash_strings.h" |
19 #include "ui/aura/aura_switches.h" | 20 #include "ui/aura/aura_switches.h" |
20 #include "ui/aura/client/screen_position_client.h" | 21 #include "ui/aura/client/screen_position_client.h" |
(...skipping 292 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 params.host = Shell::GetInstance()->root_window_host_factory()-> |
324 if (base::win::GetVersion() >= base::win::VERSION_WIN8) { | 325 CreateRootWindowHost(display.bounds_in_pixel()); |
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 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
581 DisplayList::iterator iter_to_update = to_update->begin(); | 578 DisplayList::iterator iter_to_update = to_update->begin(); |
582 DisplayList::const_iterator iter = displays_.begin(); | 579 DisplayList::const_iterator iter = displays_.begin(); |
583 for (; iter != displays_.end() && iter_to_update != to_update->end(); | 580 for (; iter != displays_.end() && iter_to_update != to_update->end(); |
584 ++iter, ++iter_to_update) { | 581 ++iter, ++iter_to_update) { |
585 (*iter_to_update).set_id((*iter).id()); | 582 (*iter_to_update).set_id((*iter).id()); |
586 } | 583 } |
587 } | 584 } |
588 | 585 |
589 } // namespace internal | 586 } // namespace internal |
590 } // namespace ash | 587 } // namespace ash |
OLD | NEW |