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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 #include "chrome/browser/chromeos/profiles/multiprofiles_intro_dialog.h" | 69 #include "chrome/browser/chromeos/profiles/multiprofiles_intro_dialog.h" |
70 #include "chrome/browser/chromeos/set_time_dialog.h" | 70 #include "chrome/browser/chromeos/set_time_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/google/google_util.h" | 75 #include "chrome/browser/google/google_util.h" |
76 #include "chrome/browser/lifetime/application_lifetime.h" | 76 #include "chrome/browser/lifetime/application_lifetime.h" |
77 #include "chrome/browser/profiles/profile_manager.h" | 77 #include "chrome/browser/profiles/profile_manager.h" |
78 #include "chrome/browser/ui/ash/multi_user/multi_user_util.h" | 78 #include "chrome/browser/ui/ash/multi_user/multi_user_util.h" |
79 #include "chrome/browser/ui/ash/stub_user_accounts_delegate.h" | 79 #include "chrome/browser/ui/ash/user_accounts_delegate_chromeos.h" |
80 #include "chrome/browser/ui/ash/volume_controller_chromeos.h" | 80 #include "chrome/browser/ui/ash/volume_controller_chromeos.h" |
81 #include "chrome/browser/ui/browser.h" | 81 #include "chrome/browser/ui/browser.h" |
82 #include "chrome/browser/ui/browser_finder.h" | 82 #include "chrome/browser/ui/browser_finder.h" |
83 #include "chrome/browser/ui/browser_list.h" | 83 #include "chrome/browser/ui/browser_list.h" |
84 #include "chrome/browser/ui/chrome_pages.h" | 84 #include "chrome/browser/ui/chrome_pages.h" |
85 #include "chrome/browser/ui/host_desktop.h" | 85 #include "chrome/browser/ui/host_desktop.h" |
86 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" | 86 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" |
87 #include "chrome/browser/ui/singleton_tabs.h" | 87 #include "chrome/browser/ui/singleton_tabs.h" |
88 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 88 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
89 #include "chrome/browser/ui/webui/chromeos/charger_replacement_handler.h" | 89 #include "chrome/browser/ui/webui/chromeos/charger_replacement_handler.h" |
(...skipping 818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
908 } | 908 } |
909 | 909 |
910 bool SystemTrayDelegateChromeOS::IsSearchKeyMappedToCapsLock() { | 910 bool SystemTrayDelegateChromeOS::IsSearchKeyMappedToCapsLock() { |
911 return search_key_mapped_to_ == input_method::kCapsLockKey; | 911 return search_key_mapped_to_ == input_method::kCapsLockKey; |
912 } | 912 } |
913 | 913 |
914 ash::tray::UserAccountsDelegate* | 914 ash::tray::UserAccountsDelegate* |
915 SystemTrayDelegateChromeOS::GetUserAccountsDelegate( | 915 SystemTrayDelegateChromeOS::GetUserAccountsDelegate( |
916 const std::string& user_id) { | 916 const std::string& user_id) { |
917 if (!accounts_delegates_.contains(user_id)) { | 917 if (!accounts_delegates_.contains(user_id)) { |
918 // TODO(dzhioev): replace stub with real implementation. | 918 const User* user = UserManager::Get()->FindUser(user_id); |
919 accounts_delegates_.set(user_id, | 919 Profile* user_profile = UserManager::Get()->GetProfileByUser(user); |
920 scoped_ptr<ash::tray::UserAccountsDelegate>( | 920 CHECK(user_profile); |
921 new StubUserAccountsDelegate(user_id))); | 921 accounts_delegates_.set( |
922 static_cast<StubUserAccountsDelegate*>(accounts_delegates_.get(user_id)) | 922 user_id, |
923 ->AddAccount("secondary_account1@gmail.com"); | 923 scoped_ptr<ash::tray::UserAccountsDelegate>( |
924 static_cast<StubUserAccountsDelegate*>(accounts_delegates_.get(user_id)) | 924 new UserAccountsDelegateChromeOS(user_profile))); |
925 ->AddAccount("very_long_account_name_for_user@gmail.com"); | |
926 static_cast<StubUserAccountsDelegate*>(accounts_delegates_.get(user_id)) | |
927 ->AddAccount("secondary_account2@gmail.com"); | |
928 static_cast<StubUserAccountsDelegate*>(accounts_delegates_.get(user_id)) | |
929 ->AddAccount("very_very_very_long_account_name_for_user@gmail.com"); | |
930 } | 925 } |
931 return accounts_delegates_.get(user_id); | 926 return accounts_delegates_.get(user_id); |
932 } | 927 } |
933 | 928 |
934 ash::SystemTray* SystemTrayDelegateChromeOS::GetPrimarySystemTray() { | 929 ash::SystemTray* SystemTrayDelegateChromeOS::GetPrimarySystemTray() { |
935 return ash::Shell::GetInstance()->GetPrimarySystemTray(); | 930 return ash::Shell::GetInstance()->GetPrimarySystemTray(); |
936 } | 931 } |
937 | 932 |
938 ash::SystemTrayNotifier* SystemTrayDelegateChromeOS::GetSystemTrayNotifier() { | 933 ash::SystemTrayNotifier* SystemTrayDelegateChromeOS::GetSystemTrayNotifier() { |
939 return ash::Shell::GetInstance()->system_tray_notifier(); | 934 return ash::Shell::GetInstance()->system_tray_notifier(); |
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1409 accessibility_subscription_.reset(); | 1404 accessibility_subscription_.reset(); |
1410 else | 1405 else |
1411 OnAccessibilityModeChanged(details.notify); | 1406 OnAccessibilityModeChanged(details.notify); |
1412 } | 1407 } |
1413 | 1408 |
1414 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { | 1409 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { |
1415 return new SystemTrayDelegateChromeOS(); | 1410 return new SystemTrayDelegateChromeOS(); |
1416 } | 1411 } |
1417 | 1412 |
1418 } // namespace chromeos | 1413 } // namespace chromeos |
OLD | NEW |