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

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

Issue 11558017: Decouple input_method from BrowserThread (and content/). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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/xkeyboard.h
diff --git a/chrome/browser/chromeos/input_method/xkeyboard.h b/chrome/browser/chromeos/input_method/xkeyboard.h
index ab16015010b13bcf841836f8c9e2f0f8b3b2a342..e72135ed2f437c9cb263627b23678d6475d28204 100644
--- a/chrome/browser/chromeos/input_method/xkeyboard.h
+++ b/chrome/browser/chromeos/input_method/xkeyboard.h
@@ -9,6 +9,11 @@
#include <vector>
#include "base/basictypes.h"
+#include "base/memory/ref_counted.h"
+
+namespace base {
+class SequencedTaskRunner;
+} // namespace base
namespace chromeos {
namespace input_method {
@@ -99,21 +104,18 @@ class XKeyboard {
// Turns on and off the auto-repeat of the keyboard. Returns true on success.
// Do not call the function from non-UI threads.
- // TODO(yusukes): Make this function non-static so we can mock it.
- static bool SetAutoRepeatEnabled(bool enabled);
+ virtual bool SetAutoRepeatEnabled(bool enabled) = 0;
// Sets the auto-repeat rate of the keyboard, initial delay in ms, and repeat
// interval in ms. Returns true on success. Do not call the function from
// non-UI threads.
- // TODO(yusukes): Make this function non-static so we can mock it.
- static bool SetAutoRepeatRate(const AutoRepeatRate& rate);
+ virtual bool SetAutoRepeatRate(const AutoRepeatRate& rate) = 0;
- // Returns true if auto repeat is enabled. This function is protected: for
- // testability.
+ // Returns true if auto repeat is enabled.
static bool GetAutoRepeatEnabledForTesting();
// On success, set current auto repeat rate on |out_rate| and returns true.
- // Returns false otherwise. This function is protected: for testability.
+ // Returns false otherwise.
static bool GetAutoRepeatRateForTesting(AutoRepeatRate* out_rate);
// Returns false if |layout_name| contains a bad character.
@@ -121,7 +123,9 @@ class XKeyboard {
// Note: At this moment, classes other than InputMethodManager should not
// instantiate the XKeyboard class.
- static XKeyboard* Create(const InputMethodUtil& util);
+ static XKeyboard* Create(
+ const InputMethodUtil& util,
+ const scoped_refptr<base::SequencedTaskRunner>& default_task_runner);
};
} // namespace input_method

Powered by Google App Engine
This is Rietveld 408576698