| 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> |
| 11 #include <set> | 11 #include <set> |
| 12 #include <string> | 12 #include <string> |
| 13 #include <utility> | 13 #include <utility> |
| 14 #include <vector> | 14 #include <vector> |
| 15 | 15 |
| 16 #include "ash/login_status.h" | 16 #include "ash/login_status.h" |
| 17 #include "ash/shell.h" | 17 #include "ash/shell.h" |
| 18 #include "ash/shell_delegate.h" | 18 #include "ash/shell_delegate.h" |
| 19 #include "ash/system/date/clock_observer.h" | 19 #include "ash/system/date/clock_observer.h" |
| 20 #include "ash/system/ime/ime_observer.h" | 20 #include "ash/system/ime/ime_observer.h" |
| 21 #include "ash/system/power/power_status.h" | 21 #include "ash/system/power/power_status.h" |
| 22 #include "ash/system/rotation/tray_rotation_lock.h" | |
| 23 #include "ash/system/session/logout_button_observer.h" | 22 #include "ash/system/session/logout_button_observer.h" |
| 24 #include "ash/system/tray/system_tray_notifier.h" | 23 #include "ash/system/tray/system_tray_notifier.h" |
| 25 #include "ash/system/tray_accessibility.h" | 24 #include "ash/system/tray_accessibility.h" |
| 26 #include "base/callback.h" | 25 #include "base/callback.h" |
| 27 #include "base/logging.h" | 26 #include "base/logging.h" |
| 28 #include "base/memory/ptr_util.h" | 27 #include "base/memory/ptr_util.h" |
| 29 #include "base/metrics/user_metrics.h" | 28 #include "base/metrics/user_metrics.h" |
| 30 #include "base/strings/utf_string_conversions.h" | 29 #include "base/strings/utf_string_conversions.h" |
| 31 #include "base/sys_info.h" | 30 #include "base/sys_info.h" |
| 32 #include "base/time/time.h" | 31 #include "base/time/time.h" |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 } | 286 } |
| 288 | 287 |
| 289 void SystemTrayDelegateChromeOS::ActiveUserWasChanged() { | 288 void SystemTrayDelegateChromeOS::ActiveUserWasChanged() { |
| 290 SetProfile(ProfileManager::GetActiveUserProfile()); | 289 SetProfile(ProfileManager::GetActiveUserProfile()); |
| 291 } | 290 } |
| 292 | 291 |
| 293 bool SystemTrayDelegateChromeOS::IsSearchKeyMappedToCapsLock() { | 292 bool SystemTrayDelegateChromeOS::IsSearchKeyMappedToCapsLock() { |
| 294 return search_key_mapped_to_ == input_method::kCapsLockKey; | 293 return search_key_mapped_to_ == input_method::kCapsLockKey; |
| 295 } | 294 } |
| 296 | 295 |
| 297 std::unique_ptr<ash::SystemTrayItem> | |
| 298 SystemTrayDelegateChromeOS::CreateRotationLockTrayItem(ash::SystemTray* tray) { | |
| 299 return base::MakeUnique<ash::TrayRotationLock>(tray); | |
| 300 } | |
| 301 | |
| 302 ash::SystemTrayNotifier* SystemTrayDelegateChromeOS::GetSystemTrayNotifier() { | 296 ash::SystemTrayNotifier* SystemTrayDelegateChromeOS::GetSystemTrayNotifier() { |
| 303 return ash::Shell::Get()->system_tray_notifier(); | 297 return ash::Shell::Get()->system_tray_notifier(); |
| 304 } | 298 } |
| 305 | 299 |
| 306 void SystemTrayDelegateChromeOS::SetProfile(Profile* profile) { | 300 void SystemTrayDelegateChromeOS::SetProfile(Profile* profile) { |
| 307 // Stop observing the AppWindowRegistry of the current |user_profile_|. | 301 // Stop observing the AppWindowRegistry of the current |user_profile_|. |
| 308 StopObservingAppWindowRegistry(); | 302 StopObservingAppWindowRegistry(); |
| 309 | 303 |
| 310 user_profile_ = profile; | 304 user_profile_ = profile; |
| 311 | 305 |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 524 | 518 |
| 525 void SystemTrayDelegateChromeOS::ImeMenuItemsChanged( | 519 void SystemTrayDelegateChromeOS::ImeMenuItemsChanged( |
| 526 const std::string& engine_id, | 520 const std::string& engine_id, |
| 527 const std::vector<input_method::InputMethodManager::MenuItem>& items) {} | 521 const std::vector<input_method::InputMethodManager::MenuItem>& items) {} |
| 528 | 522 |
| 529 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { | 523 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { |
| 530 return new SystemTrayDelegateChromeOS(); | 524 return new SystemTrayDelegateChromeOS(); |
| 531 } | 525 } |
| 532 | 526 |
| 533 } // namespace chromeos | 527 } // namespace chromeos |
| OLD | NEW |