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 15 matching lines...) Expand all Loading... |
26 #include "base/logging.h" | 26 #include "base/logging.h" |
27 #include "base/memory/ptr_util.h" | 27 #include "base/memory/ptr_util.h" |
28 #include "base/metrics/user_metrics.h" | 28 #include "base/metrics/user_metrics.h" |
29 #include "base/strings/utf_string_conversions.h" | 29 #include "base/strings/utf_string_conversions.h" |
30 #include "base/sys_info.h" | 30 #include "base/sys_info.h" |
31 #include "base/time/time.h" | 31 #include "base/time/time.h" |
32 #include "chrome/browser/browser_process.h" | 32 #include "chrome/browser/browser_process.h" |
33 #include "chrome/browser/chrome_notification_types.h" | 33 #include "chrome/browser/chrome_notification_types.h" |
34 #include "chrome/browser/chromeos/accessibility/magnification_manager.h" | 34 #include "chrome/browser/chromeos/accessibility/magnification_manager.h" |
35 #include "chrome/browser/chromeos/events/system_key_event_listener.h" | 35 #include "chrome/browser/chromeos/events/system_key_event_listener.h" |
| 36 #include "chrome/browser/chromeos/input_method/input_method_switch_recorder.h" |
36 #include "chrome/browser/chromeos/input_method/input_method_util.h" | 37 #include "chrome/browser/chromeos/input_method/input_method_util.h" |
37 #include "chrome/browser/chromeos/login/login_wizard.h" | 38 #include "chrome/browser/chromeos/login/login_wizard.h" |
38 #include "chrome/browser/chromeos/login/ui/user_adding_screen.h" | 39 #include "chrome/browser/chromeos/login/ui/user_adding_screen.h" |
39 #include "chrome/browser/chromeos/profiles/multiprofiles_intro_dialog.h" | 40 #include "chrome/browser/chromeos/profiles/multiprofiles_intro_dialog.h" |
40 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 41 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
41 #include "chrome/browser/profiles/profile_manager.h" | 42 #include "chrome/browser/profiles/profile_manager.h" |
42 #include "chrome/browser/ui/ash/multi_user/multi_user_util.h" | 43 #include "chrome/browser/ui/ash/multi_user/multi_user_util.h" |
43 #include "chrome/browser/ui/ash/networking_config_delegate_chromeos.h" | 44 #include "chrome/browser/ui/ash/networking_config_delegate_chromeos.h" |
44 #include "chrome/browser/ui/ash/system_tray_client.h" | 45 #include "chrome/browser/ui/ash/system_tray_client.h" |
45 #include "chrome/browser/ui/browser.h" | 46 #include "chrome/browser/ui/browser.h" |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 } | 249 } |
249 } | 250 } |
250 | 251 |
251 base::string16 SystemTrayDelegateChromeOS::GetIMEManagedMessage() { | 252 base::string16 SystemTrayDelegateChromeOS::GetIMEManagedMessage() { |
252 auto ime_state = input_method::InputMethodManager::Get()->GetActiveIMEState(); | 253 auto ime_state = input_method::InputMethodManager::Get()->GetActiveIMEState(); |
253 return ime_state->GetAllowedInputMethods().empty() | 254 return ime_state->GetAllowedInputMethods().empty() |
254 ? base::string16() | 255 ? base::string16() |
255 : l10n_util::GetStringUTF16(IDS_OPTIONS_CONTROLLED_SETTING_POLICY); | 256 : l10n_util::GetStringUTF16(IDS_OPTIONS_CONTROLLED_SETTING_POLICY); |
256 } | 257 } |
257 | 258 |
| 259 void SystemTrayDelegateChromeOS::SwitchIME(const std::string& ime_id) { |
| 260 input_method::InputMethodManager::Get() |
| 261 ->GetActiveIMEState() |
| 262 ->ChangeInputMethod(ime_id, false /* show_message */); |
| 263 input_method::InputMethodSwitchRecorder::Get()->RecordSwitch( |
| 264 true /* by_tray_menu */); |
| 265 } |
| 266 |
| 267 void SystemTrayDelegateChromeOS::ActivateIMEProperty(const std::string& key) { |
| 268 input_method::InputMethodManager::Get()->ActivateInputMethodMenuItem(key); |
| 269 } |
| 270 |
258 ash::NetworkingConfigDelegate* | 271 ash::NetworkingConfigDelegate* |
259 SystemTrayDelegateChromeOS::GetNetworkingConfigDelegate() const { | 272 SystemTrayDelegateChromeOS::GetNetworkingConfigDelegate() const { |
260 return networking_config_delegate_.get(); | 273 return networking_config_delegate_.get(); |
261 } | 274 } |
262 | 275 |
263 bool SystemTrayDelegateChromeOS::GetSessionStartTime( | 276 bool SystemTrayDelegateChromeOS::GetSessionStartTime( |
264 base::TimeTicks* session_start_time) { | 277 base::TimeTicks* session_start_time) { |
265 *session_start_time = session_start_time_; | 278 *session_start_time = session_start_time_; |
266 return have_session_start_time_; | 279 return have_session_start_time_; |
267 } | 280 } |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
505 | 518 |
506 void SystemTrayDelegateChromeOS::ImeMenuItemsChanged( | 519 void SystemTrayDelegateChromeOS::ImeMenuItemsChanged( |
507 const std::string& engine_id, | 520 const std::string& engine_id, |
508 const std::vector<input_method::InputMethodManager::MenuItem>& items) {} | 521 const std::vector<input_method::InputMethodManager::MenuItem>& items) {} |
509 | 522 |
510 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { | 523 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { |
511 return new SystemTrayDelegateChromeOS(); | 524 return new SystemTrayDelegateChromeOS(); |
512 } | 525 } |
513 | 526 |
514 } // namespace chromeos | 527 } // namespace chromeos |
OLD | NEW |