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

Unified Diff: ash/shell.cc

Issue 2861173002: Add --use-ime-service command line flag to enable InputMethodMus in --mus. (Closed)
Patch Set: Refactor the condition for using ime service. Created 3 years, 7 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
« ash/shell.h ('K') | « ash/shell.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shell.cc
diff --git a/ash/shell.cc b/ash/shell.cc
index 4ba0a582088f1b42b8aaae87dea89723fe347fd0..437aa136586232f431bc66495ad7128e2aea5fc6 100644
--- a/ash/shell.cc
+++ b/ash/shell.cc
@@ -16,6 +16,7 @@
#include "ash/accessibility_delegate.h"
#include "ash/app_list/app_list_delegate_impl.h"
#include "ash/ash_constants.h"
+#include "ash/ash_switches.h"
#include "ash/aura/shell_port_classic.h"
#include "ash/autoclick/autoclick_controller.h"
#include "ash/cast_config_controller.h"
@@ -309,6 +310,14 @@ Config Shell::GetAshConfig() {
return Get()->shell_port_->GetAshConfig();
}
+// static
+bool Shell::UseIMEService() {
+ return Shell::GetAshConfig() == Config::MASH ||
+ (Shell::GetAshConfig() == Config::MUS &&
+ base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kUseIMEService));
+}
+
views::NonClientFrameView* Shell::CreateDefaultNonClientFrameView(
views::Widget* widget) {
// Use translucent-style window frames for dialogs.
@@ -935,8 +944,9 @@ void Shell::Init(const ShellInitParams& init_params) {
accelerator_controller_ = shell_port_->CreateAcceleratorController();
maximize_mode_controller_ = base::MakeUnique<MaximizeModeController>();
- if (config == Config::CLASSIC || config == Config::MUS) {
- // Not applicable to mash as events are already routed to InputMethod first.
+ if (!UseIMEService()) {
+ // Not applicable when using IME service as events are already routed to
+ // InputMethod first.
AddPreTargetHandler(
window_tree_host_manager_->input_method_event_handler());
}
« ash/shell.h ('K') | « ash/shell.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698