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

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

Issue 2720913003: Calls display_configuration_controller to rotate screen in accelerator_controller_delegate_aura (Closed)
Patch Set: Created 3 years, 9 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_delegate_aura.h" 5 #include "ash/accelerators/accelerator_controller_delegate_aura.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 10 matching lines...) Expand all
21 #include "ash/common/wm/window_state.h" 21 #include "ash/common/wm/window_state.h"
22 #include "ash/common/wm/wm_event.h" 22 #include "ash/common/wm/wm_event.h"
23 #include "ash/common/wm_shell.h" 23 #include "ash/common/wm_shell.h"
24 #include "ash/debug.h" 24 #include "ash/debug.h"
25 #include "ash/display/display_configuration_controller.h" 25 #include "ash/display/display_configuration_controller.h"
26 #include "ash/display/window_tree_host_manager.h" 26 #include "ash/display/window_tree_host_manager.h"
27 #include "ash/host/ash_window_tree_host.h" 27 #include "ash/host/ash_window_tree_host.h"
28 #include "ash/magnifier/magnification_controller.h" 28 #include "ash/magnifier/magnification_controller.h"
29 #include "ash/public/cpp/shell_window_ids.h" 29 #include "ash/public/cpp/shell_window_ids.h"
30 #include "ash/root_window_controller.h" 30 #include "ash/root_window_controller.h"
31 #include "ash/rotator/screen_rotation_animator.h" 31 #include "ash/rotator/screen_rotation_animator.h"
bruthig 2017/02/28 19:11:46 nit: Remove this include
wutao 2017/02/28 20:29:09 Done.
32 #include "ash/rotator/window_rotation.h" 32 #include "ash/rotator/window_rotation.h"
33 #include "ash/screenshot_delegate.h" 33 #include "ash/screenshot_delegate.h"
34 #include "ash/shell.h" 34 #include "ash/shell.h"
35 #include "ash/touch/touch_hud_debug.h" 35 #include "ash/touch/touch_hud_debug.h"
36 #include "ash/utility/screenshot_controller.h" 36 #include "ash/utility/screenshot_controller.h"
37 #include "ash/wm/power_button_controller.h" 37 #include "ash/wm/power_button_controller.h"
38 #include "ash/wm/window_state_aura.h" 38 #include "ash/wm/window_state_aura.h"
39 #include "ash/wm/window_util.h" 39 #include "ash/wm/window_util.h"
40 #include "base/memory/ptr_util.h" 40 #include "base/memory/ptr_util.h"
41 #include "base/metrics/histogram_macros.h" 41 #include "base/metrics/histogram_macros.h"
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 void HandleRotateScreen() { 159 void HandleRotateScreen() {
160 if (Shell::GetInstance()->display_manager()->IsInUnifiedMode()) 160 if (Shell::GetInstance()->display_manager()->IsInUnifiedMode())
161 return; 161 return;
162 162
163 base::RecordAction(UserMetricsAction("Accel_Rotate_Window")); 163 base::RecordAction(UserMetricsAction("Accel_Rotate_Window"));
164 gfx::Point point = display::Screen::GetScreen()->GetCursorScreenPoint(); 164 gfx::Point point = display::Screen::GetScreen()->GetCursorScreenPoint();
165 display::Display display = 165 display::Display display =
166 display::Screen::GetScreen()->GetDisplayNearestPoint(point); 166 display::Screen::GetScreen()->GetDisplayNearestPoint(point);
167 const display::ManagedDisplayInfo& display_info = 167 const display::ManagedDisplayInfo& display_info =
168 Shell::GetInstance()->display_manager()->GetDisplayInfo(display.id()); 168 Shell::GetInstance()->display_manager()->GetDisplayInfo(display.id());
169 ScreenRotationAnimator(display.id()) 169 Shell::GetInstance()->display_configuration_controller()->SetDisplayRotation(
bruthig 2017/02/28 19:11:46 Do any SetDisplayRotation() call sites even pass f
wutao 2017/02/28 20:29:09 All 3 call sites pass true, therefore remove the p
170 .Rotate(GetNextRotation(display_info.GetActiveRotation()), 170 display.id(), GetNextRotation(display_info.GetActiveRotation()),
171 display::Display::ROTATION_SOURCE_USER); 171 display::Display::ROTATION_SOURCE_USER, true /*user_action*/);
172 } 172 }
173 173
174 // Rotate the active window. 174 // Rotate the active window.
175 void HandleRotateActiveWindow() { 175 void HandleRotateActiveWindow() {
176 base::RecordAction(UserMetricsAction("Accel_Rotate_Window")); 176 base::RecordAction(UserMetricsAction("Accel_Rotate_Window"));
177 aura::Window* active_window = wm::GetActiveWindow(); 177 aura::Window* active_window = wm::GetActiveWindow();
178 if (active_window) { 178 if (active_window) {
179 // The rotation animation bases its target transform on the current 179 // The rotation animation bases its target transform on the current
180 // rotation and position. Since there could be an animation in progress 180 // rotation and position. Since there could be an animation in progress
181 // right now, queue this animation so when it starts it picks up a neutral 181 // right now, queue this animation so when it starts it picks up a neutral
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 message_center::NotifierId( 481 message_center::NotifierId(
482 message_center::NotifierId::SYSTEM_COMPONENT, 482 message_center::NotifierId::SYSTEM_COMPONENT,
483 system_notifier::kNotifierDeprecatedAccelerator), 483 system_notifier::kNotifierDeprecatedAccelerator),
484 message_center::RichNotificationData(), 484 message_center::RichNotificationData(),
485 new DeprecatedAcceleratorNotificationDelegate)); 485 new DeprecatedAcceleratorNotificationDelegate));
486 message_center::MessageCenter::Get()->AddNotification( 486 message_center::MessageCenter::Get()->AddNotification(
487 std::move(notification)); 487 std::move(notification));
488 } 488 }
489 489
490 } // namespace ash 490 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698