| 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/settings/cros_settings.h" | 70 #include "chrome/browser/chromeos/settings/cros_settings.h" |
| 71 #include "chrome/browser/chromeos/sim_dialog_delegate.h" | 71 #include "chrome/browser/chromeos/sim_dialog_delegate.h" |
| 72 #include "chrome/browser/chromeos/ui/choose_mobile_network_dialog.h" | 72 #include "chrome/browser/chromeos/ui/choose_mobile_network_dialog.h" |
| 73 #include "chrome/browser/drive/drive_service_interface.h" | 73 #include "chrome/browser/drive/drive_service_interface.h" |
| 74 #include "chrome/browser/feedback/tracing_manager.h" | 74 #include "chrome/browser/feedback/tracing_manager.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 814 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 904 } | 904 } |
| 905 | 905 |
| 906 bool SystemTrayDelegateChromeOS::IsSearchKeyMappedToCapsLock() { | 906 bool SystemTrayDelegateChromeOS::IsSearchKeyMappedToCapsLock() { |
| 907 return search_key_mapped_to_ == input_method::kCapsLockKey; | 907 return search_key_mapped_to_ == input_method::kCapsLockKey; |
| 908 } | 908 } |
| 909 | 909 |
| 910 ash::tray::UserAccountsDelegate* | 910 ash::tray::UserAccountsDelegate* |
| 911 SystemTrayDelegateChromeOS::GetUserAccountsDelegate( | 911 SystemTrayDelegateChromeOS::GetUserAccountsDelegate( |
| 912 const std::string& user_id) { | 912 const std::string& user_id) { |
| 913 if (!accounts_delegates_.contains(user_id)) { | 913 if (!accounts_delegates_.contains(user_id)) { |
| 914 // TODO(dzhioev): replace stub with real implementation. | 914 const User* user = UserManager::Get()->FindUser(user_id); |
| 915 accounts_delegates_.set(user_id, | 915 Profile* user_profile = UserManager::Get()->GetProfileByUser(user); |
| 916 scoped_ptr<ash::tray::UserAccountsDelegate>( | 916 CHECK(user_profile); |
| 917 new StubUserAccountsDelegate(user_id))); | 917 accounts_delegates_.set( |
| 918 static_cast<StubUserAccountsDelegate*>(accounts_delegates_.get(user_id)) | 918 user_id, |
| 919 ->AddAccount("secondary_account1@gmail.com"); | 919 scoped_ptr<ash::tray::UserAccountsDelegate>( |
| 920 static_cast<StubUserAccountsDelegate*>(accounts_delegates_.get(user_id)) | 920 new UserAccountsDelegateChromeOS(user_profile))); |
| 921 ->AddAccount("very_long_account_name_for_user@gmail.com"); | |
| 922 static_cast<StubUserAccountsDelegate*>(accounts_delegates_.get(user_id)) | |
| 923 ->AddAccount("secondary_account2@gmail.com"); | |
| 924 static_cast<StubUserAccountsDelegate*>(accounts_delegates_.get(user_id)) | |
| 925 ->AddAccount("very_very_very_long_account_name_for_user@gmail.com"); | |
| 926 } | 921 } |
| 927 return accounts_delegates_.get(user_id); | 922 return accounts_delegates_.get(user_id); |
| 928 } | 923 } |
| 929 | 924 |
| 930 ash::SystemTray* SystemTrayDelegateChromeOS::GetPrimarySystemTray() { | 925 ash::SystemTray* SystemTrayDelegateChromeOS::GetPrimarySystemTray() { |
| 931 return ash::Shell::GetInstance()->GetPrimarySystemTray(); | 926 return ash::Shell::GetInstance()->GetPrimarySystemTray(); |
| 932 } | 927 } |
| 933 | 928 |
| 934 ash::SystemTrayNotifier* SystemTrayDelegateChromeOS::GetSystemTrayNotifier() { | 929 ash::SystemTrayNotifier* SystemTrayDelegateChromeOS::GetSystemTrayNotifier() { |
| 935 return ash::Shell::GetInstance()->system_tray_notifier(); | 930 return ash::Shell::GetInstance()->system_tray_notifier(); |
| (...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1411 accessibility_subscription_.reset(); | 1406 accessibility_subscription_.reset(); |
| 1412 else | 1407 else |
| 1413 OnAccessibilityModeChanged(details.notify); | 1408 OnAccessibilityModeChanged(details.notify); |
| 1414 } | 1409 } |
| 1415 | 1410 |
| 1416 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { | 1411 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { |
| 1417 return new SystemTrayDelegateChromeOS(); | 1412 return new SystemTrayDelegateChromeOS(); |
| 1418 } | 1413 } |
| 1419 | 1414 |
| 1420 } // namespace chromeos | 1415 } // namespace chromeos |
| OLD | NEW |