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

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

Issue 2355063002: Separate ash::test::DisplayManagerTestApi from ash (Closed)
Patch Set: review comment Created 4 years, 2 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
« no previous file with comments | « no previous file | ash/content/display/screen_orientation_controller_chromeos_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 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 13 matching lines...) Expand all
24 #include "ash/common/wm/wm_event.h" 24 #include "ash/common/wm/wm_event.h"
25 #include "ash/common/wm_shell.h" 25 #include "ash/common/wm_shell.h"
26 #include "ash/debug.h" 26 #include "ash/debug.h"
27 #include "ash/display/display_manager.h" 27 #include "ash/display/display_manager.h"
28 #include "ash/display/window_tree_host_manager.h" 28 #include "ash/display/window_tree_host_manager.h"
29 #include "ash/host/ash_window_tree_host.h" 29 #include "ash/host/ash_window_tree_host.h"
30 #include "ash/magnifier/magnification_controller.h" 30 #include "ash/magnifier/magnification_controller.h"
31 #include "ash/root_window_controller.h" 31 #include "ash/root_window_controller.h"
32 #include "ash/rotator/screen_rotation_animator.h" 32 #include "ash/rotator/screen_rotation_animator.h"
33 #include "ash/rotator/window_rotation.h" 33 #include "ash/rotator/window_rotation.h"
34 #include "ash/screen_util.h"
35 #include "ash/screenshot_delegate.h" 34 #include "ash/screenshot_delegate.h"
36 #include "ash/shell.h" 35 #include "ash/shell.h"
37 #include "ash/touch/touch_hud_debug.h" 36 #include "ash/touch/touch_hud_debug.h"
38 #include "ash/utility/screenshot_controller.h" 37 #include "ash/utility/screenshot_controller.h"
39 #include "ash/wm/power_button_controller.h" 38 #include "ash/wm/power_button_controller.h"
40 #include "ash/wm/window_state_aura.h" 39 #include "ash/wm/window_state_aura.h"
41 #include "ash/wm/window_util.h" 40 #include "ash/wm/window_util.h"
42 #include "base/metrics/histogram_macros.h" 41 #include "base/metrics/histogram_macros.h"
43 #include "base/metrics/user_metrics.h" 42 #include "base/metrics/user_metrics.h"
44 #include "base/strings/string_split.h" 43 #include "base/strings/string_split.h"
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 // Returns true only for WINDOW_STATE_TYPE_PINNED. 228 // Returns true only for WINDOW_STATE_TYPE_PINNED.
230 // WINDOW_STATE_TYPE_TRUSTED_PINNED does not accept user's unpin operation. 229 // WINDOW_STATE_TYPE_TRUSTED_PINNED does not accept user's unpin operation.
231 wm::WindowState* window_state = wm::GetActiveWindowState(); 230 wm::WindowState* window_state = wm::GetActiveWindowState();
232 return window_state && 231 return window_state &&
233 window_state->GetStateType() == wm::WINDOW_STATE_TYPE_PINNED; 232 window_state->GetStateType() == wm::WINDOW_STATE_TYPE_PINNED;
234 } 233 }
235 234
236 #if defined(OS_CHROMEOS) 235 #if defined(OS_CHROMEOS)
237 void HandleSwapPrimaryDisplay() { 236 void HandleSwapPrimaryDisplay() {
238 base::RecordAction(UserMetricsAction("Accel_Swap_Primary_Display")); 237 base::RecordAction(UserMetricsAction("Accel_Swap_Primary_Display"));
238
239 // TODO(rjkroege): This is not correct behaviour on devices with more than
240 // two screens. Behave the same as mirroring: fail and notify if there are
241 // three or more screens.
239 Shell::GetInstance()->display_configuration_controller()->SetPrimaryDisplayId( 242 Shell::GetInstance()->display_configuration_controller()->SetPrimaryDisplayId(
240 ScreenUtil::GetSecondaryDisplay().id(), true /* user_action */); 243 Shell::GetInstance()->display_manager()->GetSecondaryDisplay().id(),
244 true /* user_action */);
241 } 245 }
242 246
243 void HandleToggleMirrorMode() { 247 void HandleToggleMirrorMode() {
244 base::RecordAction(UserMetricsAction("Accel_Toggle_Mirror_Mode")); 248 base::RecordAction(UserMetricsAction("Accel_Toggle_Mirror_Mode"));
245 bool mirror = !Shell::GetInstance()->display_manager()->IsInMirrorMode(); 249 bool mirror = !Shell::GetInstance()->display_manager()->IsInMirrorMode();
246 Shell::GetInstance()->display_configuration_controller()->SetMirrorMode( 250 Shell::GetInstance()->display_configuration_controller()->SetMirrorMode(
247 mirror, true /* user_action */); 251 mirror, true /* user_action */);
248 } 252 }
249 253
250 bool CanHandleTouchHud() { 254 bool CanHandleTouchHud() {
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
502 message_center::NotifierId( 506 message_center::NotifierId(
503 message_center::NotifierId::SYSTEM_COMPONENT, 507 message_center::NotifierId::SYSTEM_COMPONENT,
504 system_notifier::kNotifierDeprecatedAccelerator), 508 system_notifier::kNotifierDeprecatedAccelerator),
505 message_center::RichNotificationData(), 509 message_center::RichNotificationData(),
506 new DeprecatedAcceleratorNotificationDelegate)); 510 new DeprecatedAcceleratorNotificationDelegate));
507 message_center::MessageCenter::Get()->AddNotification( 511 message_center::MessageCenter::Get()->AddNotification(
508 std::move(notification)); 512 std::move(notification));
509 } 513 }
510 514
511 } // namespace ash 515 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/content/display/screen_orientation_controller_chromeos_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698