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

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

Issue 11466010: Decompose BrowserStateMonitor into two parts, simplifying unit tests and APIs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix gypi ordering. 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
Index: chrome/browser/chromeos/input_method/input_method_persistence.h
diff --git a/chrome/browser/chromeos/input_method/input_method_persistence.h b/chrome/browser/chromeos/input_method/input_method_persistence.h
new file mode 100644
index 0000000000000000000000000000000000000000..3935572b12d9a4aa1c96780024c4873fb0918aa1
--- /dev/null
+++ b/chrome/browser/chromeos/input_method/input_method_persistence.h
@@ -0,0 +1,45 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_PERSISTENCE_H_
+#define CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_PERSISTENCE_H_
+
+#include <string>
+
+#include "base/basictypes.h"
+#include "base/compiler_specific.h"
+#include "chrome/browser/chromeos/input_method/input_method_manager.h"
+
+namespace chromeos {
+namespace input_method {
+
+// Observes input method and session state changes, and persists input method
+// changes to the BrowserProcess local state or to the user preferences,
+// according to the session state.
+class InputMethodPersistence : public InputMethodManager::Observer {
+ public:
+ // Constructs an instance that will observe input method changes on the
+ // provided InputMethodManager. The client is responsible for calling
+ // OnSessionStateChange whenever the InputMethodManager::State changes.
+ explicit InputMethodPersistence(InputMethodManager* input_method_manager);
+ virtual ~InputMethodPersistence();
+
+ // Receives notification of session state changes.
+ void OnSessionStateChange(InputMethodManager::State new_state);
+
+ // InputMethodManager::Observer overrides.
+ virtual void InputMethodChanged(InputMethodManager* manager,
+ bool show_message) OVERRIDE;
+ virtual void InputMethodPropertyChanged(InputMethodManager* manager) OVERRIDE;
+
+ private:
+ InputMethodManager* input_method_manager_;
+ InputMethodManager::State state_;
+ DISALLOW_COPY_AND_ASSIGN(InputMethodPersistence);
+};
+
+} // namespace input_method
+} // namespace chromeos
+
+#endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_PERSISTENCE_H_

Powered by Google App Engine
This is Rietveld 408576698