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

Side by Side Diff: chrome/browser/chromeos/input_method/browser_state_monitor.cc

Issue 11345008: Remove content::NotificationObserver dependency from most Prefs code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix PrefNotifierImpl Created 8 years, 1 month 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/input_method/browser_state_monitor.h" 5 #include "chrome/browser/chromeos/input_method/browser_state_monitor.h"
6 6
7 #include "chrome/browser/browser_process.h" 7 #include "chrome/browser/browser_process.h"
8 #include "chrome/browser/chromeos/input_method/input_method_util.h" 8 #include "chrome/browser/chromeos/input_method/input_method_util.h"
9 #include "chrome/browser/chromeos/language_preferences.h" 9 #include "chrome/browser/chromeos/language_preferences.h"
10 #include "chrome/browser/prefs/pref_service.h" 10 #include "chrome/browser/prefs/pref_service.h"
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 DVLOG(1) << "Received chrome::NOTIFICATION_SESSION_STARTED"; 146 DVLOG(1) << "Received chrome::NOTIFICATION_SESSION_STARTED";
147 SetState(InputMethodManager::STATE_BROWSER_SCREEN); 147 SetState(InputMethodManager::STATE_BROWSER_SCREEN);
148 break; 148 break;
149 } 149 }
150 case chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED: { 150 case chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED: {
151 const bool is_screen_locked = *content::Details<bool>(details).ptr(); 151 const bool is_screen_locked = *content::Details<bool>(details).ptr();
152 SetState(is_screen_locked ? InputMethodManager::STATE_LOCK_SCREEN : 152 SetState(is_screen_locked ? InputMethodManager::STATE_LOCK_SCREEN :
153 InputMethodManager::STATE_BROWSER_SCREEN); 153 InputMethodManager::STATE_BROWSER_SCREEN);
154 break; 154 break;
155 } 155 }
156 case chrome::NOTIFICATION_PREF_CHANGED: {
157 break; // just ignore the notification.
158 }
Mattias Nissler (ping if slow) 2012/10/31 13:29:35 It seems this is entirely dead code. I guess we sh
Jói 2012/10/31 14:56:26 It's possible they received this in an inheritance
159 default: { 156 default: {
160 NOTREACHED(); 157 NOTREACHED();
161 break; 158 break;
162 } 159 }
163 } 160 }
164 // Note: browser notifications are sent in the following order. 161 // Note: browser notifications are sent in the following order.
165 // 162 //
166 // Normal login: 163 // Normal login:
167 // 1. chrome::NOTIFICATION_LOGIN_USER_CHANGED is sent. 164 // 1. chrome::NOTIFICATION_LOGIN_USER_CHANGED is sent.
168 // 2. Preferences::NotifyPrefChanged() is called. preload_engines (which 165 // 2. Preferences::NotifyPrefChanged() is called. preload_engines (which
(...skipping 16 matching lines...) Expand all
185 182
186 void BrowserStateMonitor::SetState(InputMethodManager::State new_state) { 183 void BrowserStateMonitor::SetState(InputMethodManager::State new_state) {
187 const InputMethodManager::State old_state = state_; 184 const InputMethodManager::State old_state = state_;
188 state_ = new_state; 185 state_ = new_state;
189 if (old_state != state_) 186 if (old_state != state_)
190 manager_->SetState(state_); 187 manager_->SetState(state_);
191 } 188 }
192 189
193 } // namespace input_method 190 } // namespace input_method
194 } // namespace chromeos 191 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698