| 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 auto ime_state = input_method::InputMethodManager::Get()->GetActiveIMEState(); |
| 483 return ime_state->GetAllowedInputMethods().empty() |
| 484 ? base::string16() |
| 485 : l10n_util::GetStringUTF16(IDS_OPTIONS_CONTROLLED_SETTING_POLICY); |
| 486 } |
| 487 |
| 481 void SystemTrayDelegateChromeOS::SwitchIME(const std::string& ime_id) { | 488 void SystemTrayDelegateChromeOS::SwitchIME(const std::string& ime_id) { |
| 482 input_method::InputMethodManager::Get() | 489 input_method::InputMethodManager::Get() |
| 483 ->GetActiveIMEState() | 490 ->GetActiveIMEState() |
| 484 ->ChangeInputMethod(ime_id, false /* show_message */); | 491 ->ChangeInputMethod(ime_id, false /* show_message */); |
| 485 input_method::InputMethodSwitchRecorder::Get()->RecordSwitch( | 492 input_method::InputMethodSwitchRecorder::Get()->RecordSwitch( |
| 486 true /* by_tray_menu */); | 493 true /* by_tray_menu */); |
| 487 } | 494 } |
| 488 | 495 |
| 489 void SystemTrayDelegateChromeOS::ActivateIMEProperty(const std::string& key) { | 496 void SystemTrayDelegateChromeOS::ActivateIMEProperty(const std::string& key) { |
| 490 input_method::InputMethodManager::Get()->ActivateInputMethodMenuItem(key); | 497 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 " | 961 LOG(WARNING) << "SystemTrayDelegateChromeOS::GetChildUserMessage call while " |
| 955 << "ENABLE_SUPERVISED_USERS undefined."; | 962 << "ENABLE_SUPERVISED_USERS undefined."; |
| 956 return base::string16(); | 963 return base::string16(); |
| 957 } | 964 } |
| 958 | 965 |
| 959 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { | 966 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { |
| 960 return new SystemTrayDelegateChromeOS(); | 967 return new SystemTrayDelegateChromeOS(); |
| 961 } | 968 } |
| 962 | 969 |
| 963 } // namespace chromeos | 970 } // namespace chromeos |
| OLD | NEW |