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

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

Issue 12217120: Add IsInternal property to gfx::Display (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 10 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
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/display_controller.h" 5 #include "ash/display/display_controller.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "ash/ash_switches.h" 9 #include "ash/ash_switches.h"
10 #include "ash/display/display_manager.h" 10 #include "ash/display/display_manager.h"
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 const gfx::Display* primary_candidate = GetDisplayManager()->GetDisplayAt(0); 294 const gfx::Display* primary_candidate = GetDisplayManager()->GetDisplayAt(0);
295 #if defined(OS_CHROMEOS) 295 #if defined(OS_CHROMEOS)
296 if (base::chromeos::IsRunningOnChromeOS()) { 296 if (base::chromeos::IsRunningOnChromeOS()) {
297 internal::DisplayManager* display_manager = GetDisplayManager(); 297 internal::DisplayManager* display_manager = GetDisplayManager();
298 // On ChromeOS device, root windows are stacked vertically, and 298 // On ChromeOS device, root windows are stacked vertically, and
299 // default primary is the one on top. 299 // default primary is the one on top.
300 int count = display_manager->GetNumDisplays(); 300 int count = display_manager->GetNumDisplays();
301 int y = primary_candidate->bounds_in_pixel().y(); 301 int y = primary_candidate->bounds_in_pixel().y();
302 for (int i = 1; i < count; ++i) { 302 for (int i = 1; i < count; ++i) {
303 const gfx::Display* display = display_manager->GetDisplayAt(i); 303 const gfx::Display* display = display_manager->GetDisplayAt(i);
304 if (display_manager->IsInternalDisplayId(display->id())) { 304 if (display->is_internal()) {
305 primary_candidate = display; 305 primary_candidate = display;
306 break; 306 break;
307 } else if (display->bounds_in_pixel().y() < y) { 307 } else if (display->bounds_in_pixel().y() < y) {
308 primary_candidate = display; 308 primary_candidate = display;
309 y = display->bounds_in_pixel().y(); 309 y = display->bounds_in_pixel().y();
310 } 310 }
311 } 311 }
312 } 312 }
313 #endif 313 #endif
314 primary_display_id = primary_candidate->id(); 314 primary_display_id = primary_candidate->id();
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
714 secondary_display->set_bounds( 714 secondary_display->set_bounds(
715 gfx::Rect(new_secondary_origin, secondary_bounds.size())); 715 gfx::Rect(new_secondary_origin, secondary_bounds.size()));
716 secondary_display->UpdateWorkAreaFromInsets(insets); 716 secondary_display->UpdateWorkAreaFromInsets(insets);
717 } 717 }
718 718
719 void DisplayController::NotifyDisplayConfigurationChanging() { 719 void DisplayController::NotifyDisplayConfigurationChanging() {
720 FOR_EACH_OBSERVER(Observer, observers_, OnDisplayConfigurationChanging()); 720 FOR_EACH_OBSERVER(Observer, observers_, OnDisplayConfigurationChanging());
721 } 721 }
722 722
723 } // namespace ash 723 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698