OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/chromeos/status/input_method_menu.h" | 5 #include "chrome/browser/chromeos/status/input_method_menu.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/string_split.h" | 10 #include "base/string_split.h" |
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
426 // Sometimes (e.g. initial boot) |previous_input_method.id()| is empty. | 426 // Sometimes (e.g. initial boot) |previous_input_method.id()| is empty. |
427 previous_input_method_pref_.SetValue(previous_input_method.id()); | 427 previous_input_method_pref_.SetValue(previous_input_method.id()); |
428 current_input_method_pref_.SetValue(current_input_method.id()); | 428 current_input_method_pref_.SetValue(current_input_method.id()); |
429 pref_service_->ScheduleSavePersistentPrefs(); | 429 pref_service_->ScheduleSavePersistentPrefs(); |
430 } | 430 } |
431 } else if (screen_mode_ == StatusAreaHost::kViewsLoginMode || | 431 } else if (screen_mode_ == StatusAreaHost::kViewsLoginMode || |
432 screen_mode_ == StatusAreaHost::kWebUILoginMode) { | 432 screen_mode_ == StatusAreaHost::kWebUILoginMode) { |
433 if (g_browser_process && g_browser_process->local_state()) { | 433 if (g_browser_process && g_browser_process->local_state()) { |
434 g_browser_process->local_state()->SetString( | 434 g_browser_process->local_state()->SetString( |
435 language_prefs::kPreferredKeyboardLayout, current_input_method.id()); | 435 language_prefs::kPreferredKeyboardLayout, current_input_method.id()); |
436 g_browser_process->local_state()->SavePersistentPrefs(); | 436 g_browser_process->local_state()->ScheduleSavePersistentPrefs(); |
437 } | 437 } |
438 } | 438 } |
439 } | 439 } |
440 | 440 |
441 void InputMethodMenu::PropertyListChanged( | 441 void InputMethodMenu::PropertyListChanged( |
442 InputMethodManager* manager, | 442 InputMethodManager* manager, |
443 const input_method::ImePropertyList& current_ime_properties) { | 443 const input_method::ImePropertyList& current_ime_properties) { |
444 // Usual order of notifications of input method change is: | 444 // Usual order of notifications of input method change is: |
445 // 1. RegisterProperties(empty) | 445 // 1. RegisterProperties(empty) |
446 // 2. RegisterProperties(list-of-new-properties) | 446 // 2. RegisterProperties(list-of-new-properties) |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
724 if (screen_mode_ == StatusAreaHost::kViewsLoginMode || | 724 if (screen_mode_ == StatusAreaHost::kViewsLoginMode || |
725 screen_mode_ == StatusAreaHost::kWebUILoginMode) { | 725 screen_mode_ == StatusAreaHost::kWebUILoginMode) { |
726 manager->RemovePreLoginPreferenceObserver(this); | 726 manager->RemovePreLoginPreferenceObserver(this); |
727 } else if (screen_mode_ == StatusAreaHost::kBrowserMode) { | 727 } else if (screen_mode_ == StatusAreaHost::kBrowserMode) { |
728 manager->RemovePostLoginPreferenceObserver(this); | 728 manager->RemovePostLoginPreferenceObserver(this); |
729 } | 729 } |
730 manager->RemoveObserver(this); | 730 manager->RemoveObserver(this); |
731 } | 731 } |
732 | 732 |
733 } // namespace chromeos | 733 } // namespace chromeos |
OLD | NEW |