| 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/multi_display_manager.h" | 5 #include "ash/display/multi_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 13 matching lines...) Expand all Loading... |
| 24 | 24 |
| 25 #if defined(USE_X11) | 25 #if defined(USE_X11) |
| 26 #include "ui/base/x/x11_util.h" | 26 #include "ui/base/x/x11_util.h" |
| 27 #endif | 27 #endif |
| 28 | 28 |
| 29 #if defined(OS_CHROMEOS) | 29 #if defined(OS_CHROMEOS) |
| 30 #include "base/chromeos/chromeos_version.h" | 30 #include "base/chromeos/chromeos_version.h" |
| 31 #include "chromeos/display/output_configurator.h" | 31 #include "chromeos/display/output_configurator.h" |
| 32 #endif | 32 #endif |
| 33 | 33 |
| 34 #if defined(OS_WIN) |
| 35 #include "base/win/windows_version.h" |
| 36 #include "ui/aura/remote_root_window_host_win.h" |
| 37 #endif |
| 38 |
| 34 DECLARE_WINDOW_PROPERTY_TYPE(int64); | 39 DECLARE_WINDOW_PROPERTY_TYPE(int64); |
| 35 typedef std::vector<gfx::Display> DisplayList; | 40 typedef std::vector<gfx::Display> DisplayList; |
| 36 | 41 |
| 37 namespace ash { | 42 namespace ash { |
| 38 namespace internal { | 43 namespace internal { |
| 39 namespace { | 44 namespace { |
| 40 | 45 |
| 41 struct DisplaySortFunctor { | 46 struct DisplaySortFunctor { |
| 42 bool operator()(const gfx::Display& a, const gfx::Display& b) { | 47 bool operator()(const gfx::Display& a, const gfx::Display& b) { |
| 43 return a.id() < b.id(); | 48 return a.id() < b.id(); |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 | 251 |
| 247 for (DisplayList::const_reverse_iterator iter = removed_displays.rbegin(); | 252 for (DisplayList::const_reverse_iterator iter = removed_displays.rbegin(); |
| 248 iter != removed_displays.rend(); ++iter) { | 253 iter != removed_displays.rend(); ++iter) { |
| 249 NotifyDisplayRemoved(displays_.back()); | 254 NotifyDisplayRemoved(displays_.back()); |
| 250 displays_.pop_back(); | 255 displays_.pop_back(); |
| 251 } | 256 } |
| 252 } | 257 } |
| 253 | 258 |
| 254 RootWindow* MultiDisplayManager::CreateRootWindowForDisplay( | 259 RootWindow* MultiDisplayManager::CreateRootWindowForDisplay( |
| 255 const gfx::Display& display) { | 260 const gfx::Display& display) { |
| 256 RootWindow* root_window = | 261 |
| 257 new RootWindow(RootWindow::CreateParams(display.bounds_in_pixel())); | 262 RootWindow::CreateParams params(display.bounds_in_pixel()); |
| 263 #if defined(OS_WIN) |
| 264 if (base::win::GetVersion() >= base::win::VERSION_WIN8) { |
| 265 params.host = aura::RemoteRootWindowHostWin::Create( |
| 266 display.bounds_in_pixel()); |
| 267 } |
| 268 #endif |
| 269 aura::RootWindow* root_window = new aura::RootWindow(params); |
| 258 // No need to remove RootWindowObserver because | 270 // No need to remove RootWindowObserver because |
| 259 // the DisplayManager object outlives RootWindow objects. | 271 // the DisplayManager object outlives RootWindow objects. |
| 260 root_window->AddRootWindowObserver(this); | 272 root_window->AddRootWindowObserver(this); |
| 261 root_window->SetProperty(kDisplayIdKey, display.id()); | 273 root_window->SetProperty(kDisplayIdKey, display.id()); |
| 262 root_window->Init(); | 274 root_window->Init(); |
| 263 return root_window; | 275 return root_window; |
| 264 } | 276 } |
| 265 | 277 |
| 266 gfx::Display* MultiDisplayManager::GetDisplayAt(size_t index) { | 278 gfx::Display* MultiDisplayManager::GetDisplayAt(size_t index) { |
| 267 return index < displays_.size() ? &displays_[index] : NULL; | 279 return index < displays_.size() ? &displays_[index] : NULL; |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 for (size_t i = 0; i < output_names.size(); ++i) { | 363 for (size_t i = 0; i < output_names.size(); ++i) { |
| 352 if (chromeos::OutputConfigurator::IsInternalOutputName( | 364 if (chromeos::OutputConfigurator::IsInternalOutputName( |
| 353 output_names[i])) { | 365 output_names[i])) { |
| 354 internal_display_id_ = GetDisplayIdForOutput(outputs[i]); | 366 internal_display_id_ = GetDisplayIdForOutput(outputs[i]); |
| 355 break; | 367 break; |
| 356 } | 368 } |
| 357 } | 369 } |
| 358 } | 370 } |
| 359 #endif | 371 #endif |
| 360 | 372 |
| 373 #if defined(OS_WIN) |
| 374 if (base::win::GetVersion() >= base::win::VERSION_WIN8) |
| 375 set_use_fullscreen_host_window(true); |
| 376 #endif |
| 361 // TODO(oshima): Move this logic to DisplayChangeObserver. | 377 // TODO(oshima): Move this logic to DisplayChangeObserver. |
| 362 const string size_str = CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | 378 const string size_str = CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
| 363 switches::kAuraHostWindowSize); | 379 switches::kAuraHostWindowSize); |
| 364 vector<string> parts; | 380 vector<string> parts; |
| 365 base::SplitString(size_str, ',', &parts); | 381 base::SplitString(size_str, ',', &parts); |
| 366 for (vector<string>::const_iterator iter = parts.begin(); | 382 for (vector<string>::const_iterator iter = parts.begin(); |
| 367 iter != parts.end(); ++iter) { | 383 iter != parts.end(); ++iter) { |
| 368 AddDisplayFromSpec(*iter); | 384 AddDisplayFromSpec(*iter); |
| 369 } | 385 } |
| 370 if (displays_.empty()) | 386 if (displays_.empty()) |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 435 DisplayList::iterator iter_to_update = to_update->begin(); | 451 DisplayList::iterator iter_to_update = to_update->begin(); |
| 436 DisplayList::const_iterator iter = displays_.begin(); | 452 DisplayList::const_iterator iter = displays_.begin(); |
| 437 for (; iter != displays_.end() && iter_to_update != to_update->end(); | 453 for (; iter != displays_.end() && iter_to_update != to_update->end(); |
| 438 ++iter, ++iter_to_update) { | 454 ++iter, ++iter_to_update) { |
| 439 (*iter_to_update).set_id((*iter).id()); | 455 (*iter_to_update).set_id((*iter).id()); |
| 440 } | 456 } |
| 441 } | 457 } |
| 442 | 458 |
| 443 } // namespace internal | 459 } // namespace internal |
| 444 } // namespace ash | 460 } // namespace ash |
| OLD | NEW |