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 <algorithm> | 7 #include <algorithm> |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 #include "chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.h" | 70 #include "chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.h" |
71 #include "chrome/browser/chromeos/profiles/multiprofiles_intro_dialog.h" | 71 #include "chrome/browser/chromeos/profiles/multiprofiles_intro_dialog.h" |
72 #include "chrome/browser/chromeos/settings/cros_settings.h" | 72 #include "chrome/browser/chromeos/settings/cros_settings.h" |
73 #include "chrome/browser/chromeos/sim_dialog_delegate.h" | 73 #include "chrome/browser/chromeos/sim_dialog_delegate.h" |
74 #include "chrome/browser/drive/drive_service_interface.h" | 74 #include "chrome/browser/drive/drive_service_interface.h" |
75 #include "chrome/browser/feedback/tracing_manager.h" | 75 #include "chrome/browser/feedback/tracing_manager.h" |
76 #include "chrome/browser/google/google_util.h" | 76 #include "chrome/browser/google/google_util.h" |
77 #include "chrome/browser/lifetime/application_lifetime.h" | 77 #include "chrome/browser/lifetime/application_lifetime.h" |
78 #include "chrome/browser/profiles/profile_manager.h" | 78 #include "chrome/browser/profiles/profile_manager.h" |
79 #include "chrome/browser/ui/ash/multi_user/multi_user_util.h" | 79 #include "chrome/browser/ui/ash/multi_user/multi_user_util.h" |
| 80 #include "chrome/browser/ui/ash/stub_user_accounts_delegate.h" |
80 #include "chrome/browser/ui/ash/volume_controller_chromeos.h" | 81 #include "chrome/browser/ui/ash/volume_controller_chromeos.h" |
81 #include "chrome/browser/ui/browser.h" | 82 #include "chrome/browser/ui/browser.h" |
82 #include "chrome/browser/ui/browser_finder.h" | 83 #include "chrome/browser/ui/browser_finder.h" |
83 #include "chrome/browser/ui/browser_list.h" | 84 #include "chrome/browser/ui/browser_list.h" |
84 #include "chrome/browser/ui/chrome_pages.h" | 85 #include "chrome/browser/ui/chrome_pages.h" |
85 #include "chrome/browser/ui/host_desktop.h" | 86 #include "chrome/browser/ui/host_desktop.h" |
86 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" | 87 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" |
87 #include "chrome/browser/ui/singleton_tabs.h" | 88 #include "chrome/browser/ui/singleton_tabs.h" |
88 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 89 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
89 #include "chrome/browser/ui/webui/chromeos/charger_replacement_handler.h" | 90 #include "chrome/browser/ui/webui/chromeos/charger_replacement_handler.h" |
(...skipping 819 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
909 const std::string& service_path) const { | 910 const std::string& service_path) const { |
910 NetworkPortalDetector::CaptivePortalState state = | 911 NetworkPortalDetector::CaptivePortalState state = |
911 NetworkPortalDetector::Get()->GetCaptivePortalState(service_path); | 912 NetworkPortalDetector::Get()->GetCaptivePortalState(service_path); |
912 return state.status == NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_PORTAL; | 913 return state.status == NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_PORTAL; |
913 } | 914 } |
914 | 915 |
915 bool SystemTrayDelegateChromeOS::IsSearchKeyMappedToCapsLock() { | 916 bool SystemTrayDelegateChromeOS::IsSearchKeyMappedToCapsLock() { |
916 return search_key_mapped_to_ == input_method::kCapsLockKey; | 917 return search_key_mapped_to_ == input_method::kCapsLockKey; |
917 } | 918 } |
918 | 919 |
| 920 ash::tray::UserAccountsDelegate* |
| 921 SystemTrayDelegateChromeOS::GetUserAccountsDelegate( |
| 922 const std::string& user_id) { |
| 923 if (!accounts_delegates_.contains(user_id)) { |
| 924 // TODO(dzhioev): replace stub with real implementation. |
| 925 accounts_delegates_.set(user_id, |
| 926 scoped_ptr<ash::tray::UserAccountsDelegate>( |
| 927 new StubUserAccountsDelegate(user_id))); |
| 928 static_cast<StubUserAccountsDelegate*>(accounts_delegates_.get(user_id)) |
| 929 ->AddAccount("secondary_account1@gmail.com"); |
| 930 static_cast<StubUserAccountsDelegate*>(accounts_delegates_.get(user_id)) |
| 931 ->AddAccount("very_long_account_name_for_user@gmail.com"); |
| 932 static_cast<StubUserAccountsDelegate*>(accounts_delegates_.get(user_id)) |
| 933 ->AddAccount("secondary_account2@gmail.com"); |
| 934 static_cast<StubUserAccountsDelegate*>(accounts_delegates_.get(user_id)) |
| 935 ->AddAccount("very_very_very_long_account_name_for_user@gmail.com"); |
| 936 } |
| 937 return accounts_delegates_.get(user_id); |
| 938 } |
| 939 |
919 ash::SystemTray* SystemTrayDelegateChromeOS::GetPrimarySystemTray() { | 940 ash::SystemTray* SystemTrayDelegateChromeOS::GetPrimarySystemTray() { |
920 return ash::Shell::GetInstance()->GetPrimarySystemTray(); | 941 return ash::Shell::GetInstance()->GetPrimarySystemTray(); |
921 } | 942 } |
922 | 943 |
923 ash::SystemTrayNotifier* SystemTrayDelegateChromeOS::GetSystemTrayNotifier() { | 944 ash::SystemTrayNotifier* SystemTrayDelegateChromeOS::GetSystemTrayNotifier() { |
924 return ash::Shell::GetInstance()->system_tray_notifier(); | 945 return ash::Shell::GetInstance()->system_tray_notifier(); |
925 } | 946 } |
926 | 947 |
927 void SystemTrayDelegateChromeOS::SetProfile(Profile* profile) { | 948 void SystemTrayDelegateChromeOS::SetProfile(Profile* profile) { |
928 // Stop observing the Drive integration status and the AppWindowRegistry of | 949 // Stop observing the Drive integration status and the AppWindowRegistry of |
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1399 accessibility_subscription_.reset(); | 1420 accessibility_subscription_.reset(); |
1400 else | 1421 else |
1401 OnAccessibilityModeChanged(details.notify); | 1422 OnAccessibilityModeChanged(details.notify); |
1402 } | 1423 } |
1403 | 1424 |
1404 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { | 1425 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { |
1405 return new SystemTrayDelegateChromeOS(); | 1426 return new SystemTrayDelegateChromeOS(); |
1406 } | 1427 } |
1407 | 1428 |
1408 } // namespace chromeos | 1429 } // namespace chromeos |
OLD | NEW |