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

Side by Side Diff: ui/base/ime/chromeos/mock_input_method_manager.cc

Issue 2953033002: Hide handwriting and voice buttons when keyboard is in restricted state (Closed)
Patch Set: Add InputMethodManager::FeaturesRestrictedState Created 3 years, 6 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 unified diff | Download patch
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 #include "ui/base/ime/chromeos/mock_input_method_manager.h" 5 #include "ui/base/ime/chromeos/mock_input_method_manager.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 namespace chromeos { 9 namespace chromeos {
10 namespace input_method { 10 namespace input_method {
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 return true; 104 return true;
105 } 105 }
106 106
107 const std::vector<std::string>& 107 const std::vector<std::string>&
108 MockInputMethodManager::State::GetAllowedInputMethods() { 108 MockInputMethodManager::State::GetAllowedInputMethods() {
109 return allowed_input_method_ids_; 109 return allowed_input_method_ids_;
110 } 110 }
111 111
112 MockInputMethodManager::State::~State() {} 112 MockInputMethodManager::State::~State() {}
113 113
114 MockInputMethodManager::MockInputMethodManager() {} 114 MockInputMethodManager::MockInputMethodManager()
115 : features_restricted_state_(FeaturesRestrictedState::RESTRICTED_NONE) {}
115 116
116 MockInputMethodManager::~MockInputMethodManager() {} 117 MockInputMethodManager::~MockInputMethodManager() {}
117 118
118 InputMethodManager::UISessionState MockInputMethodManager::GetUISessionState() { 119 InputMethodManager::UISessionState MockInputMethodManager::GetUISessionState() {
119 return InputMethodManager::STATE_BROWSER_SCREEN; 120 return InputMethodManager::STATE_BROWSER_SCREEN;
120 } 121 }
121 122
122 void MockInputMethodManager::AddObserver( 123 void MockInputMethodManager::AddObserver(
123 InputMethodManager::Observer* observer) {} 124 InputMethodManager::Observer* observer) {}
124 125
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 196
196 void MockInputMethodManager::MaybeNotifyImeMenuActivationChanged() {} 197 void MockInputMethodManager::MaybeNotifyImeMenuActivationChanged() {}
197 198
198 void MockInputMethodManager::OverrideKeyboardUrlRef(const std::string& keyset) { 199 void MockInputMethodManager::OverrideKeyboardUrlRef(const std::string& keyset) {
199 } 200 }
200 201
201 bool MockInputMethodManager::IsEmojiHandwritingVoiceOnImeMenuEnabled() { 202 bool MockInputMethodManager::IsEmojiHandwritingVoiceOnImeMenuEnabled() {
202 return true; 203 return true;
203 } 204 }
204 205
206 void MockInputMethodManager::SetFeaturesRestrictedState(
207 FeaturesRestrictedState feature,
208 bool restricted) {
209 if (restricted) {
210 features_restricted_state_ |= feature;
211 } else {
212 features_restricted_state_ &= (~feature);
213 }
214 }
215
216 uint32_t MockInputMethodManager::GetFeaturesRestrictedState() {
217 return features_restricted_state_;
218 }
219
205 } // namespace input_method 220 } // namespace input_method
206 } // namespace chromeos 221 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698