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

Side by Side Diff: chrome/browser/chromeos/input_method/input_method_manager_impl.cc

Issue 2953033002: Hide handwriting and voice buttons when keyboard is in restricted state (Closed)
Patch Set: Add FEATURE_ALL Created 3 years, 5 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 "chrome/browser/chromeos/input_method/input_method_manager_impl.h" 5 #include "chrome/browser/chromeos/input_method/input_method_manager_impl.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <algorithm> // std::find 9 #include <algorithm> // std::find
10 #include <memory> 10 #include <memory>
(...skipping 841 matching lines...) Expand 10 before | Expand all | Expand 10 after
852 852
853 InputMethodManagerImpl::InputMethodManagerImpl( 853 InputMethodManagerImpl::InputMethodManagerImpl(
854 std::unique_ptr<InputMethodDelegate> delegate, 854 std::unique_ptr<InputMethodDelegate> delegate,
855 bool enable_extension_loading) 855 bool enable_extension_loading)
856 : delegate_(std::move(delegate)), 856 : delegate_(std::move(delegate)),
857 ui_session_(STATE_LOGIN_SCREEN), 857 ui_session_(STATE_LOGIN_SCREEN),
858 state_(NULL), 858 state_(NULL),
859 util_(delegate_.get()), 859 util_(delegate_.get()),
860 component_extension_ime_manager_(new ComponentExtensionIMEManager()), 860 component_extension_ime_manager_(new ComponentExtensionIMEManager()),
861 enable_extension_loading_(enable_extension_loading), 861 enable_extension_loading_(enable_extension_loading),
862 is_ime_menu_activated_(false) { 862 is_ime_menu_activated_(false),
863 features_enabled_state_(InputMethodManager::FEATURE_ALL) {
863 if (IsRunningAsSystemCompositor()) { 864 if (IsRunningAsSystemCompositor()) {
864 #if defined(USE_OZONE) 865 #if defined(USE_OZONE)
865 keyboard_ = base::MakeUnique<ImeKeyboardMus>( 866 keyboard_ = base::MakeUnique<ImeKeyboardMus>(
866 g_browser_process->platform_part()->GetInputDeviceControllerClient()); 867 g_browser_process->platform_part()->GetInputDeviceControllerClient());
867 #else 868 #else
868 keyboard_.reset(ImeKeyboard::Create()); 869 keyboard_.reset(ImeKeyboard::Create());
869 #endif 870 #endif
870 } else { 871 } else {
871 keyboard_.reset(new FakeImeKeyboard()); 872 keyboard_.reset(new FakeImeKeyboard());
872 } 873 }
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
1268 keyboard::KeyboardController* keyboard_controller = 1269 keyboard::KeyboardController* keyboard_controller =
1269 keyboard::KeyboardController::GetInstance(); 1270 keyboard::KeyboardController::GetInstance();
1270 if (keyboard_controller) 1271 if (keyboard_controller)
1271 keyboard_controller->Reload(); 1272 keyboard_controller->Reload();
1272 } 1273 }
1273 1274
1274 bool InputMethodManagerImpl::IsEmojiHandwritingVoiceOnImeMenuEnabled() { 1275 bool InputMethodManagerImpl::IsEmojiHandwritingVoiceOnImeMenuEnabled() {
1275 return base::FeatureList::IsEnabled(features::kEHVInputOnImeMenu); 1276 return base::FeatureList::IsEnabled(features::kEHVInputOnImeMenu);
1276 } 1277 }
1277 1278
1279 void InputMethodManagerImpl::SetImeMenuFeatureEnabled(ImeMenuFeature feature,
1280 bool enabled) {
1281 if (enabled)
1282 features_enabled_state_ |= feature;
1283 else
1284 features_enabled_state_ &= ~feature;
1285 }
1286
1287 bool InputMethodManagerImpl::GetImeMenuFeatureEnabled(
1288 ImeMenuFeature feature) const {
1289 return features_enabled_state_ & feature;
1290 }
1291
1278 } // namespace input_method 1292 } // namespace input_method
1279 } // namespace chromeos 1293 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698