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

Side by Side Diff: chrome/browser/chromeos/input_method/mock_input_method_manager.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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_CHROMEOS_INPUT_METHOD_MOCK_INPUT_METHOD_MANAGER_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_INPUT_METHOD_MOCK_INPUT_METHOD_MANAGER_H_
6 #define CHROME_BROWSER_CHROMEOS_INPUT_METHOD_MOCK_INPUT_METHOD_MANAGER_H_ 6 #define CHROME_BROWSER_CHROMEOS_INPUT_METHOD_MOCK_INPUT_METHOD_MANAGER_H_
7 7
8 #include "chrome/browser/chromeos/input_method/input_method_manager.h" 8 #include "chrome/browser/chromeos/input_method/input_method_manager.h"
9 #include "chrome/browser/chromeos/input_method/input_method_util.h" 9 #include "chrome/browser/chromeos/input_method/input_method_util.h"
10 #include "chrome/browser/chromeos/input_method/input_method_whitelist.h" 10 #include "chrome/browser/chromeos/input_method/input_method_whitelist.h"
11 #include "chrome/browser/chromeos/input_method/mock_input_method_delegate.h"
11 #include "chrome/browser/chromeos/input_method/mock_xkeyboard.h" 12 #include "chrome/browser/chromeos/input_method/mock_xkeyboard.h"
12 13
13 namespace chromeos { 14 namespace chromeos {
14 namespace input_method { 15 namespace input_method {
15 16
16 // The mock implementation of InputMethodManager for testing. 17 // The mock implementation of InputMethodManager for testing.
17 class MockInputMethodManager : public InputMethodManager { 18 class MockInputMethodManager : public InputMethodManager {
18 public: 19 public:
19 MockInputMethodManager(); 20 MockInputMethodManager();
20 virtual ~MockInputMethodManager(); 21 virtual ~MockInputMethodManager();
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 virtual InputMethodPropertyList 60 virtual InputMethodPropertyList
60 GetCurrentInputMethodProperties() const OVERRIDE; 61 GetCurrentInputMethodProperties() const OVERRIDE;
61 virtual XKeyboard* GetXKeyboard() OVERRIDE; 62 virtual XKeyboard* GetXKeyboard() OVERRIDE;
62 virtual InputMethodUtil* GetInputMethodUtil() OVERRIDE; 63 virtual InputMethodUtil* GetInputMethodUtil() OVERRIDE;
63 64
64 // Sets an input method ID which will be returned by GetCurrentInputMethod(). 65 // Sets an input method ID which will be returned by GetCurrentInputMethod().
65 void SetCurrentInputMethodId(const std::string& input_method_id) { 66 void SetCurrentInputMethodId(const std::string& input_method_id) {
66 current_input_method_id_ = input_method_id; 67 current_input_method_id_ = input_method_id;
67 } 68 }
68 69
70 // Set values that will be provided to the InputMethodUtil.
71 void set_application_locale(const std::string& value);
72 void set_hardware_keyboard_layout(const std::string& value);
73
69 // TODO(yusukes): Add more variables for counting the numbers of the API calls 74 // TODO(yusukes): Add more variables for counting the numbers of the API calls
70 int add_observer_count_; 75 int add_observer_count_;
71 int remove_observer_count_; 76 int remove_observer_count_;
72 int set_state_count_; 77 int set_state_count_;
73 State last_state_; 78 State last_state_;
74 79
75 private: 80 private:
76 // The value GetCurrentInputMethod().id() will return. 81 // The value GetCurrentInputMethod().id() will return.
77 std::string current_input_method_id_; 82 std::string current_input_method_id_;
78 83
79 InputMethodWhitelist whitelist_; 84 InputMethodWhitelist whitelist_;
85 MockInputMethodDelegate delegate_; // used by util_
80 InputMethodUtil util_; 86 InputMethodUtil util_;
81 MockXKeyboard xkeyboard_; 87 MockXKeyboard xkeyboard_;
82 88
83 DISALLOW_COPY_AND_ASSIGN(MockInputMethodManager); 89 DISALLOW_COPY_AND_ASSIGN(MockInputMethodManager);
84 }; 90 };
85 91
86 } // namespace input_method 92 } // namespace input_method
87 } // namespace chromeos 93 } // namespace chromeos
88 94
89 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_MOCK_INPUT_METHOD_MANAGER_H_ 95 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_MOCK_INPUT_METHOD_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698