OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/signin/chrome_signin_status_metrics_provider_delegate.h
" | 5 #include "chrome/browser/signin/chrome_signin_status_metrics_provider_delegate.h
" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 | 50 |
51 AccountsStatus | 51 AccountsStatus |
52 ChromeSigninStatusMetricsProviderDelegate::GetStatusOfAllAccounts() { | 52 ChromeSigninStatusMetricsProviderDelegate::GetStatusOfAllAccounts() { |
53 ProfileManager* profile_manager = g_browser_process->profile_manager(); | 53 ProfileManager* profile_manager = g_browser_process->profile_manager(); |
54 std::vector<Profile*> profile_list = profile_manager->GetLoadedProfiles(); | 54 std::vector<Profile*> profile_list = profile_manager->GetLoadedProfiles(); |
55 | 55 |
56 AccountsStatus accounts_status; | 56 AccountsStatus accounts_status; |
57 accounts_status.num_accounts = profile_list.size(); | 57 accounts_status.num_accounts = profile_list.size(); |
58 for (Profile* profile : profile_list) { | 58 for (Profile* profile : profile_list) { |
59 #if !defined(OS_ANDROID) && !defined(OS_IOS) | 59 #if !defined(OS_ANDROID) && !defined(OS_IOS) |
60 if (chrome::GetTotalBrowserCountForProfile(profile) == 0) { | 60 if (chrome::GetBrowserCount(profile) == 0) { |
61 // The profile is loaded, but there's no opened browser for this profile. | 61 // The profile is loaded, but there's no opened browser for this profile. |
62 continue; | 62 continue; |
63 } | 63 } |
64 #endif | 64 #endif |
65 accounts_status.num_opened_accounts++; | 65 accounts_status.num_opened_accounts++; |
66 | 66 |
67 SigninManager* manager = | 67 SigninManager* manager = |
68 SigninManagerFactory::GetForProfile(profile->GetOriginalProfile()); | 68 SigninManagerFactory::GetForProfile(profile->GetOriginalProfile()); |
69 if (manager && manager->IsAuthenticated()) | 69 if (manager && manager->IsAuthenticated()) |
70 accounts_status.num_signed_in_accounts++; | 70 accounts_status.num_signed_in_accounts++; |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 // will be reset to |UNKNOWN_SIGNIN_STATUS|. Then this newly added browser | 132 // will be reset to |UNKNOWN_SIGNIN_STATUS|. Then this newly added browser |
133 // is the only opened browser/profile and its signin status represents | 133 // is the only opened browser/profile and its signin status represents |
134 // the whole status. | 134 // the whole status. |
135 owner()->UpdateSigninStatus( | 135 owner()->UpdateSigninStatus( |
136 signed_in | 136 signed_in |
137 ? SigninStatusMetricsProviderBase::ALL_PROFILES_SIGNED_IN | 137 ? SigninStatusMetricsProviderBase::ALL_PROFILES_SIGNED_IN |
138 : SigninStatusMetricsProviderBase::ALL_PROFILES_NOT_SIGNED_IN); | 138 : SigninStatusMetricsProviderBase::ALL_PROFILES_NOT_SIGNED_IN); |
139 } | 139 } |
140 #endif | 140 #endif |
141 } | 141 } |
OLD | NEW |