| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/profiles/profile_metrics.h" | 5 #include "chrome/browser/profiles/profile_metrics.h" |
| 6 | 6 |
| 7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 }; | 43 }; |
| 44 | 44 |
| 45 #if !defined(OS_ANDROID) && !defined(OS_IOS) | 45 #if !defined(OS_ANDROID) && !defined(OS_IOS) |
| 46 ProfileOpenState GetProfileOpenState( | 46 ProfileOpenState GetProfileOpenState( |
| 47 ProfileManager* manager, | 47 ProfileManager* manager, |
| 48 const base::FilePath& path) { | 48 const base::FilePath& path) { |
| 49 Profile* profile_switched_to = manager->GetProfileByPath(path); | 49 Profile* profile_switched_to = manager->GetProfileByPath(path); |
| 50 if (!profile_switched_to) | 50 if (!profile_switched_to) |
| 51 return PROFILE_UNOPENED; | 51 return PROFILE_UNOPENED; |
| 52 | 52 |
| 53 if (chrome::GetTotalBrowserCountForProfile(profile_switched_to) > 0) | 53 if (chrome::GetBrowserCount(profile_switched_to) > 0) |
| 54 return PROFILE_OPENED; | 54 return PROFILE_OPENED; |
| 55 | 55 |
| 56 return PROFILE_OPENED_NO_BROWSER; | 56 return PROFILE_OPENED_NO_BROWSER; |
| 57 } | 57 } |
| 58 #endif | 58 #endif |
| 59 | 59 |
| 60 ProfileMetrics::ProfileType GetProfileType( | 60 ProfileMetrics::ProfileType GetProfileType( |
| 61 const base::FilePath& profile_path) { | 61 const base::FilePath& profile_path) { |
| 62 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 62 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 63 ProfileMetrics::ProfileType metric = ProfileMetrics::SECONDARY; | 63 ProfileMetrics::ProfileType metric = ProfileMetrics::SECONDARY; |
| (...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 542 UMA_HISTOGRAM_ENUMERATION("Profile.SyncSignIn", | 542 UMA_HISTOGRAM_ENUMERATION("Profile.SyncSignIn", |
| 543 GetProfileType(profile_path), | 543 GetProfileType(profile_path), |
| 544 NUM_PROFILE_TYPE_METRICS); | 544 NUM_PROFILE_TYPE_METRICS); |
| 545 } | 545 } |
| 546 | 546 |
| 547 void ProfileMetrics::LogProfileUpdate(const base::FilePath& profile_path) { | 547 void ProfileMetrics::LogProfileUpdate(const base::FilePath& profile_path) { |
| 548 UMA_HISTOGRAM_ENUMERATION("Profile.Update", | 548 UMA_HISTOGRAM_ENUMERATION("Profile.Update", |
| 549 GetProfileType(profile_path), | 549 GetProfileType(profile_path), |
| 550 NUM_PROFILE_TYPE_METRICS); | 550 NUM_PROFILE_TYPE_METRICS); |
| 551 } | 551 } |
| OLD | NEW |