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

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 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 "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 911 matching lines...) Expand 10 before | Expand all | Expand 10 after
922 922
923 InputMethodManagerImpl::InputMethodManagerImpl( 923 InputMethodManagerImpl::InputMethodManagerImpl(
924 std::unique_ptr<InputMethodDelegate> delegate, 924 std::unique_ptr<InputMethodDelegate> delegate,
925 bool enable_extension_loading) 925 bool enable_extension_loading)
926 : delegate_(std::move(delegate)), 926 : delegate_(std::move(delegate)),
927 ui_session_(STATE_LOGIN_SCREEN), 927 ui_session_(STATE_LOGIN_SCREEN),
928 state_(NULL), 928 state_(NULL),
929 util_(delegate_.get()), 929 util_(delegate_.get()),
930 component_extension_ime_manager_(new ComponentExtensionIMEManager()), 930 component_extension_ime_manager_(new ComponentExtensionIMEManager()),
931 enable_extension_loading_(enable_extension_loading), 931 enable_extension_loading_(enable_extension_loading),
932 is_ime_menu_activated_(false) { 932 is_ime_menu_activated_(false),
933 features_restricted_state_(FeaturesRestrictedState::RESTRICTED_NONE) {
933 if (IsRunningAsSystemCompositor()) { 934 if (IsRunningAsSystemCompositor()) {
934 #if defined(USE_OZONE) 935 #if defined(USE_OZONE)
935 keyboard_ = base::MakeUnique<ImeKeyboardMus>( 936 keyboard_ = base::MakeUnique<ImeKeyboardMus>(
936 g_browser_process->platform_part()->GetInputDeviceControllerClient()); 937 g_browser_process->platform_part()->GetInputDeviceControllerClient());
937 #else 938 #else
938 keyboard_.reset(ImeKeyboard::Create()); 939 keyboard_.reset(ImeKeyboard::Create());
939 #endif 940 #endif
940 } else { 941 } else {
941 keyboard_.reset(new FakeImeKeyboard()); 942 keyboard_.reset(new FakeImeKeyboard());
942 } 943 }
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
1338 keyboard::KeyboardController* keyboard_controller = 1339 keyboard::KeyboardController* keyboard_controller =
1339 keyboard::KeyboardController::GetInstance(); 1340 keyboard::KeyboardController::GetInstance();
1340 if (keyboard_controller) 1341 if (keyboard_controller)
1341 keyboard_controller->Reload(); 1342 keyboard_controller->Reload();
1342 } 1343 }
1343 1344
1344 bool InputMethodManagerImpl::IsEmojiHandwritingVoiceOnImeMenuEnabled() { 1345 bool InputMethodManagerImpl::IsEmojiHandwritingVoiceOnImeMenuEnabled() {
1345 return base::FeatureList::IsEnabled(features::kEHVInputOnImeMenu); 1346 return base::FeatureList::IsEnabled(features::kEHVInputOnImeMenu);
1346 } 1347 }
1347 1348
1349 void InputMethodManagerImpl::SetFeaturesRestrictedState(
1350 FeaturesRestrictedState feature,
1351 bool restricted) {
1352 if (restricted) {
sky 2017/06/26 15:55:12 no {}
Azure Wei 2017/06/27 14:27:15 Done.
1353 features_restricted_state_ |= feature;
1354 } else {
1355 features_restricted_state_ &= (~feature);
1356 }
1357 }
1358
1359 uint32_t InputMethodManagerImpl::GetFeaturesRestrictedState() {
1360 return features_restricted_state_;
1361 }
1362
1348 } // namespace input_method 1363 } // namespace input_method
1349 } // namespace chromeos 1364 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698