Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(792)

Side by Side Diff: chrome/browser/browsing_data/hosted_apps_counter.h

Issue 2084903002: Moved BrowsingDataCounter and part of BrowsingDataCounterUtils to components. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_BROWSING_DATA_HOSTED_APPS_COUNTER_H_ 5 #ifndef CHROME_BROWSER_BROWSING_DATA_HOSTED_APPS_COUNTER_H_
6 #define CHROME_BROWSER_BROWSING_DATA_HOSTED_APPS_COUNTER_H_ 6 #define CHROME_BROWSER_BROWSING_DATA_HOSTED_APPS_COUNTER_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "chrome/browser/browsing_data/browsing_data_counter.h" 11 #include "components/browsing_data/counters/browsing_data_counter.h"
12
13 class Profile;
12 14
13 // A BrowsingDataCounter that returns the number of hosted apps and names 15 // A BrowsingDataCounter that returns the number of hosted apps and names
14 // of up to two of them as examples. 16 // of up to two of them as examples.
15 class HostedAppsCounter: public BrowsingDataCounter { 17 class HostedAppsCounter : public browsing_data::BrowsingDataCounter {
16 public: 18 public:
17 class HostedAppsResult : public FinishedResult { 19 class HostedAppsResult : public FinishedResult {
18 public: 20 public:
19 HostedAppsResult(const HostedAppsCounter* source, 21 HostedAppsResult(const HostedAppsCounter* source,
20 ResultInt num_apps, 22 ResultInt num_apps,
21 const std::vector<std::string>& examples); 23 const std::vector<std::string>& examples);
22 ~HostedAppsResult() override; 24 ~HostedAppsResult() override;
23 25
24 const std::vector<std::string>& examples() const { return examples_; } 26 const std::vector<std::string>& examples() const { return examples_; }
25 27
26 private: 28 private:
27 const std::vector<std::string> examples_; 29 const std::vector<std::string> examples_;
28 30
29 DISALLOW_COPY_AND_ASSIGN(HostedAppsResult); 31 DISALLOW_COPY_AND_ASSIGN(HostedAppsResult);
30 }; 32 };
31 33
32 HostedAppsCounter(); 34 explicit HostedAppsCounter(Profile* profile);
33 ~HostedAppsCounter() override; 35 ~HostedAppsCounter() override;
34 36
35 // BrowsingDataCounter:
36 const std::string& GetPrefName() const override;
37
38 private: 37 private:
39 // BrowsingDataCounter: 38 // BrowsingDataCounter:
40 void Count() override; 39 void Count() override;
41 40
42 const std::string pref_name_; 41 Profile* profile_;
43 42
44 DISALLOW_COPY_AND_ASSIGN(HostedAppsCounter); 43 DISALLOW_COPY_AND_ASSIGN(HostedAppsCounter);
45 }; 44 };
46 45
47 #endif // CHROME_BROWSER_BROWSING_DATA_HOSTED_APPS_COUNTER_H_ 46 #endif // CHROME_BROWSER_BROWSING_DATA_HOSTED_APPS_COUNTER_H_
OLDNEW
« no previous file with comments | « chrome/browser/browsing_data/history_counter_browsertest.cc ('k') | chrome/browser/browsing_data/hosted_apps_counter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698