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

Side by Side Diff: chrome/browser/chromeos/status/input_method_menu.cc

Issue 8198007: Remove PrefService::ScheduleSavePersistentPrefs and SavePersistentPrefs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: '' Created 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 408 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 419
420 void InputMethodMenu::PreferenceUpdateNeeded( 420 void InputMethodMenu::PreferenceUpdateNeeded(
421 InputMethodManager* manager, 421 InputMethodManager* manager,
422 const input_method::InputMethodDescriptor& previous_input_method, 422 const input_method::InputMethodDescriptor& previous_input_method,
423 const input_method::InputMethodDescriptor& current_input_method) { 423 const input_method::InputMethodDescriptor& current_input_method) {
424 if (screen_mode_ == StatusAreaHost::kBrowserMode) { 424 if (screen_mode_ == StatusAreaHost::kBrowserMode) {
425 if (pref_service_) { // make sure we're not in unit tests. 425 if (pref_service_) { // make sure we're not in unit tests.
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();
430 } 429 }
431 } else if (screen_mode_ == StatusAreaHost::kViewsLoginMode || 430 } else if (screen_mode_ == StatusAreaHost::kViewsLoginMode ||
432 screen_mode_ == StatusAreaHost::kWebUILoginMode) { 431 screen_mode_ == StatusAreaHost::kWebUILoginMode) {
433 if (g_browser_process && g_browser_process->local_state()) { 432 if (g_browser_process && g_browser_process->local_state()) {
434 g_browser_process->local_state()->SetString( 433 g_browser_process->local_state()->SetString(
435 language_prefs::kPreferredKeyboardLayout, current_input_method.id()); 434 language_prefs::kPreferredKeyboardLayout, current_input_method.id());
436 g_browser_process->local_state()->SavePersistentPrefs(); 435 g_browser_process->local_state()->CommitPendingWrite();
437 } 436 }
438 } 437 }
439 } 438 }
440 439
441 void InputMethodMenu::PropertyListChanged( 440 void InputMethodMenu::PropertyListChanged(
442 InputMethodManager* manager, 441 InputMethodManager* manager,
443 const input_method::ImePropertyList& current_ime_properties) { 442 const input_method::ImePropertyList& current_ime_properties) {
444 // Usual order of notifications of input method change is: 443 // Usual order of notifications of input method change is:
445 // 1. RegisterProperties(empty) 444 // 1. RegisterProperties(empty)
446 // 2. RegisterProperties(list-of-new-properties) 445 // 2. RegisterProperties(list-of-new-properties)
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
719 if (screen_mode_ == StatusAreaHost::kViewsLoginMode || 718 if (screen_mode_ == StatusAreaHost::kViewsLoginMode ||
720 screen_mode_ == StatusAreaHost::kWebUILoginMode) { 719 screen_mode_ == StatusAreaHost::kWebUILoginMode) {
721 manager->RemovePreLoginPreferenceObserver(this); 720 manager->RemovePreLoginPreferenceObserver(this);
722 } else if (screen_mode_ == StatusAreaHost::kBrowserMode) { 721 } else if (screen_mode_ == StatusAreaHost::kBrowserMode) {
723 manager->RemovePostLoginPreferenceObserver(this); 722 manager->RemovePostLoginPreferenceObserver(this);
724 } 723 }
725 manager->RemoveObserver(this); 724 manager->RemoveObserver(this);
726 } 725 }
727 726
728 } // namespace chromeos 727 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698