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

Unified Diff: ash/mus/accelerators/accelerator_controller_delegate_mus.cc

Issue 2434923002: Handle modified displays in mustash. (Closed)
Patch Set: Fix PlatformScreenStub for tests. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/mus/accelerators/accelerator_controller_delegate_mus.h ('k') | ash/mus/bridge/wm_shell_mus.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/mus/accelerators/accelerator_controller_delegate_mus.cc
diff --git a/ash/mus/accelerators/accelerator_controller_delegate_mus.cc b/ash/mus/accelerators/accelerator_controller_delegate_mus.cc
index 39a7f232081c991b5dac2ae482a10f303c504e48..7abd2f5e11e09173f68693d09b44a8dc9b130dcf 100644
--- a/ash/mus/accelerators/accelerator_controller_delegate_mus.cc
+++ b/ash/mus/accelerators/accelerator_controller_delegate_mus.cc
@@ -4,8 +4,10 @@
#include "ash/mus/accelerators/accelerator_controller_delegate_mus.h"
+#include "ash/mus/window_manager.h"
#include "base/logging.h"
#include "mash/public/interfaces/launchable.mojom.h"
+#include "services/service_manager/public/cpp/connector.h"
#include "services/ui/public/interfaces/display/display_controller.mojom.h"
#include "services/ui/public/interfaces/display/test_display_controller.mojom.h"
@@ -13,12 +15,12 @@ namespace ash {
namespace mus {
AcceleratorControllerDelegateMus::AcceleratorControllerDelegateMus(
- service_manager::Connector* connector)
- : connector_(connector) {
+ WindowManager* window_manager)
+ : window_manager_(window_manager) {
#if !defined(OS_CHROMEOS)
- // To avoid trybot complaining that |connector_| is not being
- // used in non-ChromeOS.
- connector_ = nullptr;
+ // To avoid trybot complaining that |window_manager_| is not being used in
+ // non-ChromeOS.
+ window_manager_ = nullptr;
#endif
}
@@ -53,10 +55,10 @@ bool AcceleratorControllerDelegateMus::HandlesAction(AcceleratorAction action) {
#if defined(OS_CHROMEOS)
case DEV_ADD_REMOVE_DISPLAY:
+ case DEV_TOGGLE_UNIFIED_DESKTOP:
case SWAP_PRIMARY_DISPLAY:
case TOUCH_HUD_PROJECTION_TOGGLE:
return true;
- case DEV_TOGGLE_UNIFIED_DESKTOP:
case LOCK_PRESSED:
case LOCK_RELEASED:
case POWER_PRESSED:
@@ -81,6 +83,7 @@ bool AcceleratorControllerDelegateMus::CanPerformAction(
#if defined(OS_CHROMEOS)
switch (action) {
case DEV_ADD_REMOVE_DISPLAY:
+ case DEV_TOGGLE_UNIFIED_DESKTOP:
case SWAP_PRIMARY_DISPLAY:
case TOUCH_HUD_PROJECTION_TOGGLE:
return true;
@@ -98,19 +101,28 @@ void AcceleratorControllerDelegateMus::PerformAction(
switch (action) {
case DEV_ADD_REMOVE_DISPLAY: {
display::mojom::TestDisplayControllerPtr test_display_controller;
- connector_->ConnectToInterface("service:ui", &test_display_controller);
+ window_manager_->connector()->ConnectToInterface(
+ "service:ui", &test_display_controller);
test_display_controller->ToggleAddRemoveDisplay();
break;
}
+ case DEV_TOGGLE_UNIFIED_DESKTOP: {
+ // TODO(crbug.com/657816): This is hack. I'm just stealing the shortcut
+ // key to toggle display size in mus. This should be removed by launch.
+ display::mojom::TestDisplayControllerPtr test_display_controller;
+ window_manager_->connector()->ConnectToInterface(
+ "service:ui", &test_display_controller);
+ test_display_controller->ToggleDisplayResolution();
+ break;
+ }
case SWAP_PRIMARY_DISPLAY: {
- display::mojom::DisplayControllerPtr display_controller;
- connector_->ConnectToInterface("service:ui", &display_controller);
- display_controller->SwapPrimaryDisplay();
+ window_manager_->GetDisplayController()->SwapPrimaryDisplay();
break;
}
case TOUCH_HUD_PROJECTION_TOGGLE: {
mash::mojom::LaunchablePtr launchable;
- connector_->ConnectToInterface("service:touch_hud", &launchable);
+ window_manager_->connector()->ConnectToInterface("service:touch_hud",
+ &launchable);
launchable->Launch(mash::mojom::kWindow,
mash::mojom::LaunchMode::DEFAULT);
break;
« no previous file with comments | « ash/mus/accelerators/accelerator_controller_delegate_mus.h ('k') | ash/mus/bridge/wm_shell_mus.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698