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 29 matching lines...) Expand all Loading... |
40 #include "chrome/browser/profiles/profile_manager.h" | 40 #include "chrome/browser/profiles/profile_manager.h" |
41 #include "chrome/browser/ui/ash/multi_user/multi_user_util.h" | 41 #include "chrome/browser/ui/ash/multi_user/multi_user_util.h" |
42 #include "chrome/browser/ui/ash/networking_config_delegate_chromeos.h" | 42 #include "chrome/browser/ui/ash/networking_config_delegate_chromeos.h" |
43 #include "chrome/browser/ui/ash/system_tray_client.h" | 43 #include "chrome/browser/ui/ash/system_tray_client.h" |
44 #include "chrome/browser/ui/browser.h" | 44 #include "chrome/browser/ui/browser.h" |
45 #include "chrome/browser/ui/browser_list.h" | 45 #include "chrome/browser/ui/browser_list.h" |
46 #include "chrome/browser/ui/chrome_pages.h" | 46 #include "chrome/browser/ui/chrome_pages.h" |
47 #include "chrome/common/chrome_switches.h" | 47 #include "chrome/common/chrome_switches.h" |
48 #include "chrome/common/features.h" | 48 #include "chrome/common/features.h" |
49 #include "chrome/common/pref_names.h" | 49 #include "chrome/common/pref_names.h" |
| 50 #include "chrome/grit/generated_resources.h" |
50 #include "chromeos/login/login_state.h" | 51 #include "chromeos/login/login_state.h" |
51 #include "chromeos/network/portal_detector/network_portal_detector.h" | 52 #include "chromeos/network/portal_detector/network_portal_detector.h" |
52 #include "components/google/core/browser/google_util.h" | 53 #include "components/google/core/browser/google_util.h" |
53 #include "components/prefs/pref_service.h" | 54 #include "components/prefs/pref_service.h" |
54 #include "components/session_manager/core/session_manager.h" | 55 #include "components/session_manager/core/session_manager.h" |
55 #include "components/user_manager/user.h" | 56 #include "components/user_manager/user.h" |
56 #include "components/user_manager/user_manager.h" | 57 #include "components/user_manager/user_manager.h" |
57 #include "components/user_manager/user_type.h" | 58 #include "components/user_manager/user_type.h" |
58 #include "content/public/browser/notification_observer.h" | 59 #include "content/public/browser/notification_observer.h" |
59 #include "content/public/browser/notification_service.h" | 60 #include "content/public/browser/notification_service.h" |
60 #include "ui/base/ime/chromeos/extension_ime_util.h" | 61 #include "ui/base/ime/chromeos/extension_ime_util.h" |
61 #include "ui/base/ime/chromeos/input_method_manager.h" | 62 #include "ui/base/ime/chromeos/input_method_manager.h" |
62 #include "ui/base/ime/chromeos/input_method_util.h" | 63 #include "ui/base/ime/chromeos/input_method_util.h" |
| 64 #include "ui/base/l10n/l10n_util.h" |
| 65 #include "ui/base/l10n/time_format.h" |
63 #include "ui/chromeos/events/pref_names.h" | 66 #include "ui/chromeos/events/pref_names.h" |
64 #include "ui/chromeos/ime/input_method_menu_item.h" | 67 #include "ui/chromeos/ime/input_method_menu_item.h" |
65 #include "ui/chromeos/ime/input_method_menu_manager.h" | 68 #include "ui/chromeos/ime/input_method_menu_manager.h" |
66 | 69 |
67 namespace chromeos { | 70 namespace chromeos { |
68 | 71 |
69 namespace { | 72 namespace { |
70 | 73 |
71 // The minimum session length limit that can be set. | 74 // The minimum session length limit that can be set. |
72 const int kSessionLengthLimitMinMs = 30 * 1000; // 30 seconds. | 75 const int kSessionLengthLimitMinMs = 30 * 1000; // 30 seconds. |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 GetCurrentInputMethodMenuItemList(); | 240 GetCurrentInputMethodMenuItemList(); |
238 for (size_t i = 0; i < menu_list.size(); ++i) { | 241 for (size_t i = 0; i < menu_list.size(); ++i) { |
239 ash::IMEPropertyInfo property; | 242 ash::IMEPropertyInfo property; |
240 property.key = menu_list[i].key; | 243 property.key = menu_list[i].key; |
241 property.name = base::UTF8ToUTF16(menu_list[i].label); | 244 property.name = base::UTF8ToUTF16(menu_list[i].label); |
242 property.selected = menu_list[i].is_selection_item_checked; | 245 property.selected = menu_list[i].is_selection_item_checked; |
243 list->push_back(property); | 246 list->push_back(property); |
244 } | 247 } |
245 } | 248 } |
246 | 249 |
| 250 base::string16 SystemTrayDelegateChromeOS::GetIMEManagedMessage() { |
| 251 auto ime_state = input_method::InputMethodManager::Get()->GetActiveIMEState(); |
| 252 return ime_state->GetAllowedInputMethods().empty() |
| 253 ? base::string16() |
| 254 : l10n_util::GetStringUTF16(IDS_OPTIONS_CONTROLLED_SETTING_POLICY); |
| 255 } |
| 256 |
247 ash::NetworkingConfigDelegate* | 257 ash::NetworkingConfigDelegate* |
248 SystemTrayDelegateChromeOS::GetNetworkingConfigDelegate() const { | 258 SystemTrayDelegateChromeOS::GetNetworkingConfigDelegate() const { |
249 return networking_config_delegate_.get(); | 259 return networking_config_delegate_.get(); |
250 } | 260 } |
251 | 261 |
252 bool SystemTrayDelegateChromeOS::GetSessionStartTime( | 262 bool SystemTrayDelegateChromeOS::GetSessionStartTime( |
253 base::TimeTicks* session_start_time) { | 263 base::TimeTicks* session_start_time) { |
254 *session_start_time = session_start_time_; | 264 *session_start_time = session_start_time_; |
255 return have_session_start_time_; | 265 return have_session_start_time_; |
256 } | 266 } |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
494 | 504 |
495 void SystemTrayDelegateChromeOS::ImeMenuItemsChanged( | 505 void SystemTrayDelegateChromeOS::ImeMenuItemsChanged( |
496 const std::string& engine_id, | 506 const std::string& engine_id, |
497 const std::vector<input_method::InputMethodManager::MenuItem>& items) {} | 507 const std::vector<input_method::InputMethodManager::MenuItem>& items) {} |
498 | 508 |
499 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { | 509 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { |
500 return new SystemTrayDelegateChromeOS(); | 510 return new SystemTrayDelegateChromeOS(); |
501 } | 511 } |
502 | 512 |
503 } // namespace chromeos | 513 } // namespace chromeos |
OLD | NEW |