Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(257)

Side by Side Diff: ash/display/multi_display_manager.cc

Issue 11047012: Wiring metro mouse events to aura viewer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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* root_window = NULL;
263 #if defined(OS_WIN)
264 if (base::win::GetVersion() >= base::win::VERSION_WIN8) {
265 root_window = aura::RemoteRootWindowHostWin::CreateRootWindow(
266 display.bounds_in_pixel());
267 }
268 #endif
269 if (!root_window) {
270 root_window = new RootWindow(
271 RootWindow::CreateParams(display.bounds_in_pixel()));
272 }
Ben Goodger (Google) 2012/10/04 15:48:30 Write this like so: RootWindow::CreateParams pa
cpu_(ooo_6.6-7.5) 2012/10/04 19:57:56 The problem is that I need to update the delegate_
258 // No need to remove RootWindowObserver because 273 // No need to remove RootWindowObserver because
259 // the DisplayManager object outlives RootWindow objects. 274 // the DisplayManager object outlives RootWindow objects.
260 root_window->AddRootWindowObserver(this); 275 root_window->AddRootWindowObserver(this);
261 root_window->SetProperty(kDisplayIdKey, display.id()); 276 root_window->SetProperty(kDisplayIdKey, display.id());
262 root_window->Init(); 277 root_window->Init();
263 return root_window; 278 return root_window;
264 } 279 }
265 280
266 gfx::Display* MultiDisplayManager::GetDisplayAt(size_t index) { 281 gfx::Display* MultiDisplayManager::GetDisplayAt(size_t index) {
267 return index < displays_.size() ? &displays_[index] : NULL; 282 return index < displays_.size() ? &displays_[index] : NULL;
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 for (size_t i = 0; i < output_names.size(); ++i) { 366 for (size_t i = 0; i < output_names.size(); ++i) {
352 if (chromeos::OutputConfigurator::IsInternalOutputName( 367 if (chromeos::OutputConfigurator::IsInternalOutputName(
353 output_names[i])) { 368 output_names[i])) {
354 internal_display_id_ = GetDisplayIdForOutput(outputs[i]); 369 internal_display_id_ = GetDisplayIdForOutput(outputs[i]);
355 break; 370 break;
356 } 371 }
357 } 372 }
358 } 373 }
359 #endif 374 #endif
360 375
376 #if defined(OS_WIN)
377 if (base::win::GetVersion() >= base::win::VERSION_WIN8)
378 set_use_fullscreen_host_window(true);
379 #endif
361 // TODO(oshima): Move this logic to DisplayChangeObserver. 380 // TODO(oshima): Move this logic to DisplayChangeObserver.
362 const string size_str = CommandLine::ForCurrentProcess()->GetSwitchValueASCII( 381 const string size_str = CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
363 switches::kAuraHostWindowSize); 382 switches::kAuraHostWindowSize);
364 vector<string> parts; 383 vector<string> parts;
365 base::SplitString(size_str, ',', &parts); 384 base::SplitString(size_str, ',', &parts);
366 for (vector<string>::const_iterator iter = parts.begin(); 385 for (vector<string>::const_iterator iter = parts.begin();
367 iter != parts.end(); ++iter) { 386 iter != parts.end(); ++iter) {
368 AddDisplayFromSpec(*iter); 387 AddDisplayFromSpec(*iter);
369 } 388 }
370 if (displays_.empty()) 389 if (displays_.empty())
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 DisplayList::iterator iter_to_update = to_update->begin(); 454 DisplayList::iterator iter_to_update = to_update->begin();
436 DisplayList::const_iterator iter = displays_.begin(); 455 DisplayList::const_iterator iter = displays_.begin();
437 for (; iter != displays_.end() && iter_to_update != to_update->end(); 456 for (; iter != displays_.end() && iter_to_update != to_update->end();
438 ++iter, ++iter_to_update) { 457 ++iter, ++iter_to_update) {
439 (*iter_to_update).set_id((*iter).id()); 458 (*iter_to_update).set_id((*iter).id());
440 } 459 }
441 } 460 }
442 461
443 } // namespace internal 462 } // namespace internal
444 } // namespace ash 463 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/metro_viewer/metro_viewer_process_host_win.h » ('j') | ui/aura/remote_root_window_host_win.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698