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