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

Unified Diff: ash/mus/bridge/wm_shell_mus.cc

Issue 2777223002: Gets chrome --mus some what working (Closed)
Patch Set: fix mac 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/mus/bridge/wm_shell_mus.h ('k') | ash/mus/test/wm_test_helper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/mus/bridge/wm_shell_mus.cc
diff --git a/ash/mus/bridge/wm_shell_mus.cc b/ash/mus/bridge/wm_shell_mus.cc
index 35d1ac39eeb9d6ce2f451cad32ec5a6a16784888..f9d2445a5756ac294bd67fa96cae161312de29f0 100644
--- a/ash/mus/bridge/wm_shell_mus.cc
+++ b/ash/mus/bridge/wm_shell_mus.cc
@@ -6,6 +6,7 @@
#include <utility>
+#include "ash/accelerators/accelerator_controller_delegate_aura.h"
#include "ash/common/accelerators/accelerator_controller.h"
#include "ash/common/key_event_watcher.h"
#include "ash/common/session/session_state_delegate.h"
@@ -27,6 +28,7 @@
#include "ash/mus/keyboard_ui_mus.h"
#include "ash/mus/screen_mus.h"
#include "ash/mus/window_manager.h"
+#include "ash/public/cpp/config.h"
#include "ash/root_window_controller.h"
#include "ash/root_window_settings.h"
#include "ash/shared/immersive_fullscreen_controller.h"
@@ -89,7 +91,8 @@ WmShellMus::WmShellMus(
session_state_delegate_ = base::MakeUnique<SessionStateDelegateStub>();
DCHECK(primary_root_window_);
- immersive_handler_factory_.reset(new ImmersiveHandlerFactoryMus);
+ if (GetConfig() == Config::MASH)
+ immersive_handler_factory_ = base::MakeUnique<ImmersiveHandlerFactoryMus>();
}
WmShellMus::~WmShellMus() {
@@ -97,6 +100,8 @@ WmShellMus::~WmShellMus() {
// static
WmShellMus* WmShellMus::Get() {
+ const ash::Config config = WmShell::Get()->GetConfig();
+ CHECK(config == Config::MUS || config == Config::MASH);
return static_cast<WmShellMus*>(WmShell::Get());
}
@@ -124,7 +129,11 @@ void WmShellMus::Shutdown() {
}
bool WmShellMus::IsRunningInMash() const {
- return true;
+ return GetConfig() == Config::MASH;
+}
+
+Config WmShellMus::GetConfig() const {
+ return window_manager_->config();
}
WmWindow* WmShellMus::GetFocusedWindow() {
@@ -353,6 +362,13 @@ void WmShellMus::InitHosts(const ShellInitParams& init_params) {
std::unique_ptr<AcceleratorController>
WmShellMus::CreateAcceleratorController() {
DCHECK(!accelerator_controller_delegate_);
+ if (GetConfig() == Config::MUS) {
+ accelerator_controller_delegate_classic_ =
+ base::MakeUnique<AcceleratorControllerDelegateAura>();
+ return base::MakeUnique<AcceleratorController>(
+ accelerator_controller_delegate_classic_.get(), nullptr);
+ }
+
uint16_t accelerator_namespace_id = 0u;
const bool add_result =
window_manager_->GetNextAcceleratorNamespaceId(&accelerator_namespace_id);
« no previous file with comments | « ash/mus/bridge/wm_shell_mus.h ('k') | ash/mus/test/wm_test_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698