| 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 #ifndef CHROME_BROWSER_PROFILES_PROFILE_STATISTICS_H_ | 5 #ifndef CHROME_BROWSER_PROFILES_PROFILE_STATISTICS_H_ |
| 6 #define CHROME_BROWSER_PROFILES_PROFILE_STATISTICS_H_ | 6 #define CHROME_BROWSER_PROFILES_PROFILE_STATISTICS_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 // Definition of the return value of |ProfileStatisticsCallback|. | 32 // Definition of the return value of |ProfileStatisticsCallback|. |
| 33 using ProfileCategoryStats = std::vector<ProfileCategoryStat>; | 33 using ProfileCategoryStats = std::vector<ProfileCategoryStat>; |
| 34 | 34 |
| 35 // Definition of the callback function. Note that a copy of | 35 // Definition of the callback function. Note that a copy of |
| 36 // |ProfileCategoryStats| is made each time the callback is called. | 36 // |ProfileCategoryStats| is made each time the callback is called. |
| 37 using ProfileStatisticsCallback = base::Callback<void(ProfileCategoryStats)>; | 37 using ProfileStatisticsCallback = base::Callback<void(ProfileCategoryStats)>; |
| 38 | 38 |
| 39 // This function collects statistical information about |profile| and returns | 39 // This function collects statistical information about |profile| and returns |
| 40 // the information via |callback|. Currently bookmarks, history, logins and | 40 // the information via |callback|. Currently bookmarks, history, logins and |
| 41 // preferences are counted. The callback function will probably be called more | 41 // preferences are counted. The callback function will probably be called more |
| 42 // than once so binding parameters with bind::Passed() is prohibited. | 42 // than once so binding parameters with bind::Passed() is prohibited. The |
| 43 // statistical information are also copied to ProfileInfoCache. |
| 43 void GetProfileStatistics(Profile* profile, | 44 void GetProfileStatistics(Profile* profile, |
| 44 const ProfileStatisticsCallback& callback, | 45 const ProfileStatisticsCallback& callback, |
| 45 base::CancelableTaskTracker* tracker); | 46 base::CancelableTaskTracker* tracker); |
| 46 | 47 |
| 48 // This function collects statistical information about |profile| and sends the |
| 49 // information to ProfileInfoCache. |
| 50 void StoreProfileStatisticsToCache(Profile* profile); |
| 51 |
| 47 } // namespace profiles | 52 } // namespace profiles |
| 48 | 53 |
| 49 #endif // CHROME_BROWSER_PROFILES_PROFILE_STATISTICS_H_ | 54 #endif // CHROME_BROWSER_PROFILES_PROFILE_STATISTICS_H_ |
| OLD | NEW |