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

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

Issue 10827237: Enabling Extended Deskop by default. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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
« no previous file with comments | « ash/display/display_controller.h ('k') | 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 "ash/ash_switches.h" 7 #include "ash/ash_switches.h"
8 #include "ash/display/multi_display_manager.h" 8 #include "ash/display/multi_display_manager.h"
9 #include "ash/root_window_controller.h" 9 #include "ash/root_window_controller.h"
10 #include "ash/screen_ash.h" 10 #include "ash/screen_ash.h"
11 #include "ash/shell.h" 11 #include "ash/shell.h"
12 #include "ash/wm/coordinate_conversion.h" 12 #include "ash/wm/coordinate_conversion.h"
13 #include "ash/wm/property_util.h" 13 #include "ash/wm/property_util.h"
14 #include "ash/wm/window_util.h" 14 #include "ash/wm/window_util.h"
15 #include "base/command_line.h" 15 #include "base/command_line.h"
16 #include "ui/aura/client/screen_position_client.h" 16 #include "ui/aura/client/screen_position_client.h"
17 #include "ui/aura/env.h" 17 #include "ui/aura/env.h"
18 #include "ui/aura/root_window.h" 18 #include "ui/aura/root_window.h"
19 #include "ui/aura/window.h" 19 #include "ui/aura/window.h"
20 #include "ui/gfx/display.h" 20 #include "ui/gfx/display.h"
21 #include "ui/gfx/screen.h" 21 #include "ui/gfx/screen.h"
22 22
23 namespace ash { 23 namespace ash {
24 namespace internal { 24 namespace internal {
25 namespace {
26 // True if the extended desktop mode is enabled.
27 bool extended_desktop_enabled = false;
28 } // namespace
29 25
30 DisplayController::DisplayController() 26 DisplayController::DisplayController()
31 : secondary_display_layout_(RIGHT), 27 : secondary_display_layout_(RIGHT),
32 dont_warp_mouse_(false) { 28 dont_warp_mouse_(false) {
33 aura::Env::GetInstance()->display_manager()->AddObserver(this); 29 aura::Env::GetInstance()->display_manager()->AddObserver(this);
34 } 30 }
35 31
36 DisplayController::~DisplayController() { 32 DisplayController::~DisplayController() {
37 aura::Env::GetInstance()->display_manager()->RemoveObserver(this); 33 aura::Env::GetInstance()->display_manager()->RemoveObserver(this);
38 // Delete all root window controllers, which deletes root window 34 // Delete all root window controllers, which deletes root window
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 controller->MoveWindowsTo(Shell::GetPrimaryRootWindow()); 200 controller->MoveWindowsTo(Shell::GetPrimaryRootWindow());
205 delete controller; 201 delete controller;
206 } else { 202 } else {
207 delete root; 203 delete root;
208 } 204 }
209 } 205 }
210 } 206 }
211 207
212 // static 208 // static
213 bool DisplayController::IsExtendedDesktopEnabled(){ 209 bool DisplayController::IsExtendedDesktopEnabled(){
214 return extended_desktop_enabled || 210 static bool extended_desktop_disabled =
215 CommandLine::ForCurrentProcess()->HasSwitch( 211 CommandLine::ForCurrentProcess()->HasSwitch(
216 switches::kAshExtendedDesktop); 212 switches::kAshExtendedDesktopDisabled);
217 } 213 return !extended_desktop_disabled;
218
219 // static
220 void DisplayController::SetExtendedDesktopEnabled(bool enabled) {
221 extended_desktop_enabled = enabled;
222 } 214 }
223 215
224 aura::RootWindow* DisplayController::AddRootWindowForDisplay( 216 aura::RootWindow* DisplayController::AddRootWindowForDisplay(
225 const gfx::Display& display) { 217 const gfx::Display& display) {
226 aura::RootWindow* root = aura::Env::GetInstance()->display_manager()-> 218 aura::RootWindow* root = aura::Env::GetInstance()->display_manager()->
227 CreateRootWindowForDisplay(display); 219 CreateRootWindowForDisplay(display);
228 root_windows_[display.id()] = root; 220 root_windows_[display.id()] = root;
229 // Confine the cursor within the window if 221 // Confine the cursor within the window if
230 // 1) Extended desktop is enabled or 222 // 1) Extended desktop is enabled or
231 // 2) the display is primary display and the host window 223 // 2) the display is primary display and the host window
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 break; 258 break;
267 } 259 }
268 gfx::Insets insets = secondary_display->GetWorkAreaInsets(); 260 gfx::Insets insets = secondary_display->GetWorkAreaInsets();
269 secondary_display->set_bounds( 261 secondary_display->set_bounds(
270 gfx::Rect(new_secondary_origin, secondary_bounds.size())); 262 gfx::Rect(new_secondary_origin, secondary_bounds.size()));
271 secondary_display->UpdateWorkAreaFromInsets(insets); 263 secondary_display->UpdateWorkAreaFromInsets(insets);
272 } 264 }
273 265
274 } // namespace internal 266 } // namespace internal
275 } // namespace ash 267 } // namespace ash
OLDNEW
« no previous file with comments | « ash/display/display_controller.h ('k') | ash/display/display_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698