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 #include <algorithm> | 8 #include <algorithm> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 1021 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1032 SupervisedUserService* service = SupervisedUserServiceFactory::GetForProfile( | 1032 SupervisedUserService* service = SupervisedUserServiceFactory::GetForProfile( |
1033 user_profile_); | 1033 user_profile_); |
1034 if (service) | 1034 if (service) |
1035 service->RemoveObserver(this); | 1035 service->RemoveObserver(this); |
1036 } | 1036 } |
1037 | 1037 |
1038 void SystemTrayDelegateChromeOS::NotifyIfLastWindowClosed() { | 1038 void SystemTrayDelegateChromeOS::NotifyIfLastWindowClosed() { |
1039 if (!user_profile_) | 1039 if (!user_profile_) |
1040 return; | 1040 return; |
1041 | 1041 |
1042 BrowserList* browser_list = | 1042 BrowserList* browser_list = BrowserList::GetInstance(); |
1043 BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_ASH); | |
1044 for (BrowserList::const_iterator it = browser_list->begin(); | 1043 for (BrowserList::const_iterator it = browser_list->begin(); |
1045 it != browser_list->end(); | 1044 it != browser_list->end(); |
1046 ++it) { | 1045 ++it) { |
1047 if ((*it)->profile()->IsSameProfile(user_profile_)) { | 1046 if ((*it)->profile()->IsSameProfile(user_profile_)) { |
1048 // The current user has at least one open browser window. | 1047 // The current user has at least one open browser window. |
1049 return; | 1048 return; |
1050 } | 1049 } |
1051 } | 1050 } |
1052 | 1051 |
1053 if (!extensions::AppWindowRegistry::Get( | 1052 if (!extensions::AppWindowRegistry::Get( |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1329 LOG(WARNING) << "SystemTrayDelegateChromeOS::GetChildUserMessage call while " | 1328 LOG(WARNING) << "SystemTrayDelegateChromeOS::GetChildUserMessage call while " |
1330 << "ENABLE_SUPERVISED_USERS undefined."; | 1329 << "ENABLE_SUPERVISED_USERS undefined."; |
1331 return base::string16(); | 1330 return base::string16(); |
1332 } | 1331 } |
1333 | 1332 |
1334 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { | 1333 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { |
1335 return new SystemTrayDelegateChromeOS(); | 1334 return new SystemTrayDelegateChromeOS(); |
1336 } | 1335 } |
1337 | 1336 |
1338 } // namespace chromeos | 1337 } // namespace chromeos |
OLD | NEW |