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

Unified Diff: ui/base/ime/input_method_win.cc

Issue 1234193002: Simplify InputMethodWin initialization. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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
Index: ui/base/ime/input_method_win.cc
diff --git a/ui/base/ime/input_method_win.cc b/ui/base/ime/input_method_win.cc
index 6fbb497a55c8debfc07eea6598e0359e9149e102..68573c8b2d8679502b12ab54f3587e3d191b7a7f 100644
--- a/ui/base/ime/input_method_win.cc
+++ b/ui/base/ime/input_method_win.cc
@@ -29,13 +29,12 @@ InputMethodWin::InputMethodWin(internal::InputMethodDelegate* delegate,
: toplevel_window_handle_(toplevel_window_handle),
pending_requested_direction_(base::i18n::UNKNOWN_DIRECTION),
accept_carriage_return_(false),
- active_(false),
enabled_(false),
is_candidate_popup_open_(false),
composing_window_handle_(NULL),
- default_input_language_initialized_(false),
suppress_next_char_(false) {
SetDelegate(delegate);
+ OnInputLocaleChanged();
}
void InputMethodWin::OnFocus() {
@@ -60,11 +59,6 @@ bool InputMethodWin::OnUntranslatedIMEMessage(
LRESULT original_result = 0;
BOOL handled = FALSE;
- if (!default_input_language_initialized_) {
- // Gets the initial input locale.
- OnInputLocaleChanged();
- }
-
switch (event.message) {
case WM_IME_SETCONTEXT:
original_result = OnImeSetContext(
@@ -179,8 +173,6 @@ void InputMethodWin::CancelComposition(const TextInputClient* client) {
}
void InputMethodWin::OnInputLocaleChanged() {
- default_input_language_initialized_ = true;
- active_ = imm32_manager_.SetInputLanguage();
locale_ = imm32_manager_.GetInputLanguageName();
OnInputMethodChanged();
}
@@ -189,10 +181,6 @@ std::string InputMethodWin::GetInputLocale() {
return locale_;
}
-bool InputMethodWin::IsActive() {
- return active_;
-}
-
bool InputMethodWin::IsCandidatePopupOpen() const {
return is_candidate_popup_open_;
}

Powered by Google App Engine
This is Rietveld 408576698