OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/ui/ash/system_tray_delegate_chromeos.h" | 5 #include "chrome/browser/ui/ash/system_tray_delegate_chromeos.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <memory> | 10 #include <memory> |
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
471 GetCurrentInputMethodMenuItemList(); | 471 GetCurrentInputMethodMenuItemList(); |
472 for (size_t i = 0; i < menu_list.size(); ++i) { | 472 for (size_t i = 0; i < menu_list.size(); ++i) { |
473 ash::IMEPropertyInfo property; | 473 ash::IMEPropertyInfo property; |
474 property.key = menu_list[i].key; | 474 property.key = menu_list[i].key; |
475 property.name = base::UTF8ToUTF16(menu_list[i].label); | 475 property.name = base::UTF8ToUTF16(menu_list[i].label); |
476 property.selected = menu_list[i].is_selection_item_checked; | 476 property.selected = menu_list[i].is_selection_item_checked; |
477 list->push_back(property); | 477 list->push_back(property); |
478 } | 478 } |
479 } | 479 } |
480 | 480 |
481 base::string16 SystemTrayDelegateChromeOS::GetIMEManagedMessage() { | |
482 input_method::InputMethodManager* manager = | |
483 input_method::InputMethodManager::Get(); | |
484 if (manager->GetActiveIMEState() | |
485 ->GetAllowedKeyboardLayoutInputMethods() | |
486 .empty()) | |
487 return base::string16(); | |
488 else | |
489 return l10n_util::GetStringUTF16(IDS_OPTIONS_CONTROLLED_SETTING_POLICY); | |
Peter Kasting
2017/01/25 22:09:30
Nit: Shorter, and avoids else after return:
aut
pmarko
2017/01/26 12:32:58
Thanks, done.
| |
490 } | |
491 | |
481 void SystemTrayDelegateChromeOS::SwitchIME(const std::string& ime_id) { | 492 void SystemTrayDelegateChromeOS::SwitchIME(const std::string& ime_id) { |
482 input_method::InputMethodManager::Get() | 493 input_method::InputMethodManager::Get() |
483 ->GetActiveIMEState() | 494 ->GetActiveIMEState() |
484 ->ChangeInputMethod(ime_id, false /* show_message */); | 495 ->ChangeInputMethod(ime_id, false /* show_message */); |
485 input_method::InputMethodSwitchRecorder::Get()->RecordSwitch( | 496 input_method::InputMethodSwitchRecorder::Get()->RecordSwitch( |
486 true /* by_tray_menu */); | 497 true /* by_tray_menu */); |
487 } | 498 } |
488 | 499 |
489 void SystemTrayDelegateChromeOS::ActivateIMEProperty(const std::string& key) { | 500 void SystemTrayDelegateChromeOS::ActivateIMEProperty(const std::string& key) { |
490 input_method::InputMethodManager::Get()->ActivateInputMethodMenuItem(key); | 501 input_method::InputMethodManager::Get()->ActivateInputMethodMenuItem(key); |
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
954 LOG(WARNING) << "SystemTrayDelegateChromeOS::GetChildUserMessage call while " | 965 LOG(WARNING) << "SystemTrayDelegateChromeOS::GetChildUserMessage call while " |
955 << "ENABLE_SUPERVISED_USERS undefined."; | 966 << "ENABLE_SUPERVISED_USERS undefined."; |
956 return base::string16(); | 967 return base::string16(); |
957 } | 968 } |
958 | 969 |
959 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { | 970 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { |
960 return new SystemTrayDelegateChromeOS(); | 971 return new SystemTrayDelegateChromeOS(); |
961 } | 972 } |
962 | 973 |
963 } // namespace chromeos | 974 } // namespace chromeos |
OLD | NEW |