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

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

Issue 11417121: Undo all existing overscan settings before updating to a new overscan settings (2nd) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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
« no previous file with comments | « no previous file | ash/display/display_controller_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 431 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 // Update the layout. 442 // Update the layout.
443 SetLayoutForDisplayName( 443 SetLayoutForDisplayName(
444 display_manager->GetDisplayNameFor(old_primary_display), 444 display_manager->GetDisplayNameFor(old_primary_display),
445 GetLayoutForDisplay(new_primary_display).Invert()); 445 GetLayoutForDisplay(new_primary_display).Invert());
446 446
447 // Update the dispay manager with new display info. 447 // Update the dispay manager with new display info.
448 std::vector<gfx::Display> displays; 448 std::vector<gfx::Display> displays;
449 displays.push_back(display_manager->GetDisplayForId(primary_display_id)); 449 displays.push_back(display_manager->GetDisplayForId(primary_display_id));
450 displays.push_back(*GetSecondaryDisplay()); 450 displays.push_back(*GetSecondaryDisplay());
451 GetDisplayManager()->set_force_bounds_changed(true); 451 GetDisplayManager()->set_force_bounds_changed(true);
452 GetDisplayManager()->OnNativeDisplaysChanged(displays); 452 GetDisplayManager()->UpdateDisplays(displays);
453 GetDisplayManager()->set_force_bounds_changed(false); 453 GetDisplayManager()->set_force_bounds_changed(false);
454 } 454 }
455 455
456 gfx::Display* DisplayController::GetSecondaryDisplay() { 456 gfx::Display* DisplayController::GetSecondaryDisplay() {
457 internal::DisplayManager* display_manager = GetDisplayManager(); 457 internal::DisplayManager* display_manager = GetDisplayManager();
458 CHECK_EQ(2U, display_manager->GetNumDisplays()); 458 CHECK_EQ(2U, display_manager->GetNumDisplays());
459 return display_manager->GetDisplayAt(0)->id() == primary_display_id ? 459 return display_manager->GetDisplayAt(0)->id() == primary_display_id ?
460 display_manager->GetDisplayAt(1) : display_manager->GetDisplayAt(0); 460 display_manager->GetDisplayAt(1) : display_manager->GetDisplayAt(0);
461 } 461 }
462 462
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
576 secondary_display->set_bounds( 576 secondary_display->set_bounds(
577 gfx::Rect(new_secondary_origin, secondary_bounds.size())); 577 gfx::Rect(new_secondary_origin, secondary_bounds.size()));
578 secondary_display->UpdateWorkAreaFromInsets(insets); 578 secondary_display->UpdateWorkAreaFromInsets(insets);
579 } 579 }
580 580
581 void DisplayController::NotifyDisplayConfigurationChanging() { 581 void DisplayController::NotifyDisplayConfigurationChanging() {
582 FOR_EACH_OBSERVER(Observer, observers_, OnDisplayConfigurationChanging()); 582 FOR_EACH_OBSERVER(Observer, observers_, OnDisplayConfigurationChanging());
583 } 583 }
584 584
585 } // namespace ash 585 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/display/display_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698