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

Unified Diff: ui/keyboard/keyboard_controller.h

Issue 219503003: Make keyboard controller a singleton. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix root window controller unittets. Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: ui/keyboard/keyboard_controller.h
diff --git a/ui/keyboard/keyboard_controller.h b/ui/keyboard/keyboard_controller.h
index ea30da0cf1d377d966dc7ed2afad7b04b86ba039..2ebec9eda963c4811453901164ac407e860d20a5 100644
--- a/ui/keyboard/keyboard_controller.h
+++ b/ui/keyboard/keyboard_controller.h
@@ -81,6 +81,14 @@ class KEYBOARD_EXPORT KeyboardController : public ui::InputMethodObserver,
// Force the keyboard to show up if not showing and lock the keyboard.
void ShowAndLockKeyboard();
+ // Sets the active keyboard controller. KeyboardController takes ownership of
+ // the instance. Calling ResetIntance with a new instance destroys the
+ // previous one. May be called with NULL to clear the instance.
+ static void ResetInstance(KeyboardController* controller);
+
+ // Retrieve the active keyboard controller.
+ static KeyboardController* GetInstance();
+
// Returns true if keyboard is currently visible.
bool keyboard_visible() { return keyboard_visible_; }
@@ -131,6 +139,8 @@ class KEYBOARD_EXPORT KeyboardController : public ui::InputMethodObserver,
base::WeakPtrFactory<KeyboardController> weak_factory_;
+ static KeyboardController* instance_;
+
DISALLOW_COPY_AND_ASSIGN(KeyboardController);
};
« no previous file with comments | « chrome/browser/ui/views/ash/chrome_browser_main_extra_parts_ash.cc ('k') | ui/keyboard/keyboard_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698