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

Unified Diff: chrome/browser/chromeos/input_method/browser_state_monitor.h

Issue 11415266: Extract a delegate interface from c/b/input_method to permit decoupling from c/b. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Class comment. Created 8 years 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/input_method/browser_state_monitor.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/input_method/browser_state_monitor.h
diff --git a/chrome/browser/chromeos/input_method/browser_state_monitor.h b/chrome/browser/chromeos/input_method/browser_state_monitor.h
index 5043de4189ec27797bd515611ca1e641f93ed2e8..e74f8cae4f6deaa6bbcdd4108e3f0b63b5c40386 100644
--- a/chrome/browser/chromeos/input_method/browser_state_monitor.h
+++ b/chrome/browser/chromeos/input_method/browser_state_monitor.h
@@ -7,38 +7,32 @@
#include <string>
-#include "chrome/browser/api/prefs/pref_member.h"
+#include "base/basictypes.h"
+#include "base/compiler_specific.h"
#include "chrome/browser/chromeos/input_method/input_method_manager.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
#include "content/public/browser/notification_types.h"
-class PrefService;
-
namespace chromeos {
namespace input_method {
+class InputMethodDelegate;
+
// A class which monitors a notification from the browser to keep track of the
// browser state (not logged in, logged in, etc.) and notify the current state
// to the input method manager. The class also updates the appropriate Chrome
-// prefs (~/Local\ State or ~/Preferences) depending on the current browser
-// state.
+// prefs via the InputMethodDelegate, depending on the current browser state.
class BrowserStateMonitor : public content::NotificationObserver,
public InputMethodManager::Observer {
public:
- explicit BrowserStateMonitor(InputMethodManager* manager);
+ BrowserStateMonitor(InputMethodManager* manager,
+ InputMethodDelegate* delegate);
virtual ~BrowserStateMonitor();
InputMethodManager::State state() const { return state_; }
- void SetPrefServiceForTesting(PrefService* pref_service);
-
protected:
- // Updates ~/Local\ State file. protected: for testing.
- virtual void UpdateLocalState(const std::string& current_input_method);
- // Updates ~/Preferences file. protected: for testing.
- virtual void UpdateUserPreferences(const std::string& current_input_method);
-
// InputMethodManager::Observer overrides:
virtual void InputMethodChanged(InputMethodManager* manager,
bool show_message) OVERRIDE;
@@ -51,17 +45,14 @@ class BrowserStateMonitor : public content::NotificationObserver,
private:
void SetState(InputMethodManager::State new_state);
- void InitializePrefMembers();
InputMethodManager* manager_;
+ InputMethodDelegate* delegate_;
InputMethodManager::State state_;
// This is used to register this object to some browser notifications.
content::NotificationRegistrar notification_registrar_;
- // For testing.
- PrefService* pref_service_;
-
DISALLOW_COPY_AND_ASSIGN(BrowserStateMonitor);
};
« no previous file with comments | « no previous file | chrome/browser/chromeos/input_method/browser_state_monitor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698