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

Side by Side Diff: ash/accelerators/accelerator_controller.cc

Issue 1071353003: Prevent DisplayPreferences from saving incorrect rotations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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/accelerators/accelerator_controller.h" 5 #include "ash/accelerators/accelerator_controller.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <string> 9 #include <string>
10 10
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 } 288 }
289 289
290 // Rotates the screen. 290 // Rotates the screen.
291 void HandleRotateScreen() { 291 void HandleRotateScreen() {
292 base::RecordAction(UserMetricsAction("Accel_Rotate_Window")); 292 base::RecordAction(UserMetricsAction("Accel_Rotate_Window"));
293 gfx::Point point = Shell::GetScreen()->GetCursorScreenPoint(); 293 gfx::Point point = Shell::GetScreen()->GetCursorScreenPoint();
294 gfx::Display display = Shell::GetScreen()->GetDisplayNearestPoint(point); 294 gfx::Display display = Shell::GetScreen()->GetDisplayNearestPoint(point);
295 const DisplayInfo& display_info = 295 const DisplayInfo& display_info =
296 Shell::GetInstance()->display_manager()->GetDisplayInfo(display.id()); 296 Shell::GetInstance()->display_manager()->GetDisplayInfo(display.id());
297 ash::ScreenRotationAnimator(display.id()) 297 ash::ScreenRotationAnimator(display.id())
298 .Rotate(GetNextRotation(display_info.rotation())); 298 .Rotate(GetNextRotation(
299 display_info.Rotation(gfx::Display::ROTATION_SOURCE_ACTIVE)),
300 gfx::Display::ROTATION_SOURCE_USER);
299 } 301 }
300 302
301 // Rotate the active window. 303 // Rotate the active window.
302 void HandleRotateActiveWindow() { 304 void HandleRotateActiveWindow() {
303 base::RecordAction(UserMetricsAction("Accel_Rotate_Window")); 305 base::RecordAction(UserMetricsAction("Accel_Rotate_Window"));
304 aura::Window* active_window = wm::GetActiveWindow(); 306 aura::Window* active_window = wm::GetActiveWindow();
305 if (active_window) { 307 if (active_window) {
306 // The rotation animation bases its target transform on the current 308 // The rotation animation bases its target transform on the current
307 // rotation and position. Since there could be an animation in progress 309 // rotation and position. Since there could be an animation in progress
308 // right now, queue this animation so when it starts it picks up a neutral 310 // right now, queue this animation so when it starts it picks up a neutral
(...skipping 1020 matching lines...) Expand 10 before | Expand all | Expand 10 after
1329 } 1331 }
1330 1332
1331 void AcceleratorController::SetKeyboardBrightnessControlDelegate( 1333 void AcceleratorController::SetKeyboardBrightnessControlDelegate(
1332 scoped_ptr<KeyboardBrightnessControlDelegate> 1334 scoped_ptr<KeyboardBrightnessControlDelegate>
1333 keyboard_brightness_control_delegate) { 1335 keyboard_brightness_control_delegate) {
1334 keyboard_brightness_control_delegate_ = 1336 keyboard_brightness_control_delegate_ =
1335 keyboard_brightness_control_delegate.Pass(); 1337 keyboard_brightness_control_delegate.Pass();
1336 } 1338 }
1337 1339
1338 } // namespace ash 1340 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698