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

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

Issue 11594008: Revert 173477 (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
===================================================================
--- chrome/browser/chromeos/input_method/xkeyboard.h (revision 173477)
+++ chrome/browser/chromeos/input_method/xkeyboard.h (working copy)
@@ -9,12 +9,7 @@
#include <vector>
#include "base/basictypes.h"
-#include "base/memory/ref_counted.h"
-namespace base {
-class SequencedTaskRunner;
-} // namespace base
-
namespace chromeos {
namespace input_method {
@@ -104,31 +99,29 @@
// Turns on and off the auto-repeat of the keyboard. Returns true on success.
// Do not call the function from non-UI threads.
- virtual bool SetAutoRepeatEnabled(bool enabled) = 0;
+ // TODO(yusukes): Make this function non-static so we can mock it.
+ static bool SetAutoRepeatEnabled(bool enabled);
// 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.
- virtual bool SetAutoRepeatRate(const AutoRepeatRate& rate) = 0;
+ // TODO(yusukes): Make this function non-static so we can mock it.
+ static bool SetAutoRepeatRate(const AutoRepeatRate& rate);
- // Returns true if auto repeat is enabled.
+ // Returns true if auto repeat is enabled. This function is protected: for
+ // testability.
static bool GetAutoRepeatEnabledForTesting();
// On success, set current auto repeat rate on |out_rate| and returns true.
- // Returns false otherwise.
+ // Returns false otherwise. This function is protected: for testability.
static bool GetAutoRepeatRateForTesting(AutoRepeatRate* out_rate);
// Returns false if |layout_name| contains a bad character.
static bool CheckLayoutNameForTesting(const std::string& layout_name);
- // Creates an instance of XKeyboard. |default_task_runner| is used to verify
- // thread-safe usage (all methods must be invoked in the context of
- // default_task_runner).
// Note: At this moment, classes other than InputMethodManager should not
// instantiate the XKeyboard class.
- static XKeyboard* Create(
- const InputMethodUtil& util,
- const scoped_refptr<base::SequencedTaskRunner>& default_task_runner);
+ static XKeyboard* Create(const InputMethodUtil& util);
};
} // namespace input_method
« no previous file with comments | « chrome/browser/chromeos/input_method/mock_xkeyboard.cc ('k') | chrome/browser/chromeos/input_method/xkeyboard.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698