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/profiles/multiprofiles_intro_dialog.h" | 70 #include "chrome/browser/chromeos/profiles/multiprofiles_intro_dialog.h" |
71 #include "chrome/browser/chromeos/settings/cros_settings.h" | 71 #include "chrome/browser/chromeos/settings/cros_settings.h" |
72 #include "chrome/browser/chromeos/sim_dialog_delegate.h" | 72 #include "chrome/browser/chromeos/sim_dialog_delegate.h" |
73 #include "chrome/browser/chromeos/ui/choose_mobile_network_dialog.h" | 73 #include "chrome/browser/chromeos/ui/choose_mobile_network_dialog.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/user_accounts_delegate_chromeos.h" |
81 #include "chrome/browser/ui/ash/volume_controller_chromeos.h" | 81 #include "chrome/browser/ui/ash/volume_controller_chromeos.h" |
82 #include "chrome/browser/ui/browser.h" | 82 #include "chrome/browser/ui/browser.h" |
83 #include "chrome/browser/ui/browser_finder.h" | 83 #include "chrome/browser/ui/browser_finder.h" |
84 #include "chrome/browser/ui/browser_list.h" | 84 #include "chrome/browser/ui/browser_list.h" |
85 #include "chrome/browser/ui/chrome_pages.h" | 85 #include "chrome/browser/ui/chrome_pages.h" |
86 #include "chrome/browser/ui/host_desktop.h" | 86 #include "chrome/browser/ui/host_desktop.h" |
87 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" | 87 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" |
88 #include "chrome/browser/ui/singleton_tabs.h" | 88 #include "chrome/browser/ui/singleton_tabs.h" |
89 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 89 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
90 #include "chrome/browser/ui/webui/chromeos/charger_replacement_handler.h" | 90 #include "chrome/browser/ui/webui/chromeos/charger_replacement_handler.h" |
(...skipping 821 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
912 } | 912 } |
913 | 913 |
914 bool SystemTrayDelegateChromeOS::IsSearchKeyMappedToCapsLock() { | 914 bool SystemTrayDelegateChromeOS::IsSearchKeyMappedToCapsLock() { |
915 return search_key_mapped_to_ == input_method::kCapsLockKey; | 915 return search_key_mapped_to_ == input_method::kCapsLockKey; |
916 } | 916 } |
917 | 917 |
918 ash::tray::UserAccountsDelegate* | 918 ash::tray::UserAccountsDelegate* |
919 SystemTrayDelegateChromeOS::GetUserAccountsDelegate( | 919 SystemTrayDelegateChromeOS::GetUserAccountsDelegate( |
920 const std::string& user_id) { | 920 const std::string& user_id) { |
921 if (!accounts_delegates_.contains(user_id)) { | 921 if (!accounts_delegates_.contains(user_id)) { |
922 // TODO(dzhioev): replace stub with real implementation. | 922 const User* user = UserManager::Get()->FindUser(user_id); |
923 accounts_delegates_.set(user_id, | 923 Profile* user_profile = UserManager::Get()->GetProfileByUser(user); |
924 scoped_ptr<ash::tray::UserAccountsDelegate>( | 924 CHECK(user_profile); |
925 new StubUserAccountsDelegate(user_id))); | 925 accounts_delegates_.set( |
926 static_cast<StubUserAccountsDelegate*>(accounts_delegates_.get(user_id)) | 926 user_id, |
927 ->AddAccount("secondary_account1@gmail.com"); | 927 scoped_ptr<ash::tray::UserAccountsDelegate>( |
928 static_cast<StubUserAccountsDelegate*>(accounts_delegates_.get(user_id)) | 928 new UserAccountsDelegateChromeOS(user_profile))); |
929 ->AddAccount("very_long_account_name_for_user@gmail.com"); | |
930 static_cast<StubUserAccountsDelegate*>(accounts_delegates_.get(user_id)) | |
931 ->AddAccount("secondary_account2@gmail.com"); | |
932 static_cast<StubUserAccountsDelegate*>(accounts_delegates_.get(user_id)) | |
933 ->AddAccount("very_very_very_long_account_name_for_user@gmail.com"); | |
934 } | 929 } |
935 return accounts_delegates_.get(user_id); | 930 return accounts_delegates_.get(user_id); |
936 } | 931 } |
937 | 932 |
938 ash::SystemTray* SystemTrayDelegateChromeOS::GetPrimarySystemTray() { | 933 ash::SystemTray* SystemTrayDelegateChromeOS::GetPrimarySystemTray() { |
939 return ash::Shell::GetInstance()->GetPrimarySystemTray(); | 934 return ash::Shell::GetInstance()->GetPrimarySystemTray(); |
940 } | 935 } |
941 | 936 |
942 ash::SystemTrayNotifier* SystemTrayDelegateChromeOS::GetSystemTrayNotifier() { | 937 ash::SystemTrayNotifier* SystemTrayDelegateChromeOS::GetSystemTrayNotifier() { |
943 return ash::Shell::GetInstance()->system_tray_notifier(); | 938 return ash::Shell::GetInstance()->system_tray_notifier(); |
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1419 accessibility_subscription_.reset(); | 1414 accessibility_subscription_.reset(); |
1420 else | 1415 else |
1421 OnAccessibilityModeChanged(details.notify); | 1416 OnAccessibilityModeChanged(details.notify); |
1422 } | 1417 } |
1423 | 1418 |
1424 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { | 1419 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { |
1425 return new SystemTrayDelegateChromeOS(); | 1420 return new SystemTrayDelegateChromeOS(); |
1426 } | 1421 } |
1427 | 1422 |
1428 } // namespace chromeos | 1423 } // namespace chromeos |
OLD | NEW |