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

Side by Side Diff: components/doodle/doodle_service.h

Issue 2838833005: Move NewTabPage.LogoShownTime metrics recording into LogoBridge (Closed)
Patch Set: Remove file without real changes Created 3 years, 8 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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 COMPONENTS_DOODLE_DOODLE_SERVICE_H_ 5 #ifndef COMPONENTS_DOODLE_DOODLE_SERVICE_H_
6 #define COMPONENTS_DOODLE_DOODLE_SERVICE_H_ 6 #define COMPONENTS_DOODLE_DOODLE_SERVICE_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 // changes; to get the current (cached) config, call |config()|. 52 // changes; to get the current (cached) config, call |config()|.
53 void AddObserver(Observer* observer); 53 void AddObserver(Observer* observer);
54 54
55 // Prevents |observer| from receiving future updates. This is safe to call 55 // Prevents |observer| from receiving future updates. This is safe to call
56 // even when the observer is being notified of an update. 56 // even when the observer is being notified of an update.
57 void RemoveObserver(Observer* observer); 57 void RemoveObserver(Observer* observer);
58 58
59 // Requests an asynchronous refresh of the DoodleConfig from the network. 59 // Requests an asynchronous refresh of the DoodleConfig from the network.
60 // After the update completes, the observers will be notified only if the 60 // After the update completes, the observers will be notified only if the
61 // config changed. 61 // config changed.
62 void Refresh(); 62 // Returns false if no fetch was issued because the service has fresh data in
63 // it's cache.
64 bool Refresh();
63 65
64 private: 66 private:
65 // Note: Keep in sync with the corresponding enum in histograms.xml. Never 67 // Note: Keep in sync with the corresponding enum in histograms.xml. Never
66 // remove values, and only insert new values at the end. 68 // remove values, and only insert new values at the end.
67 enum DownloadOutcome { 69 enum DownloadOutcome {
68 OUTCOME_NEW_DOODLE = 0, 70 OUTCOME_NEW_DOODLE = 0,
69 OUTCOME_REVALIDATED_DOODLE = 1, 71 OUTCOME_REVALIDATED_DOODLE = 1,
70 OUTCOME_CHANGED_DOODLE = 2, 72 OUTCOME_CHANGED_DOODLE = 2,
71 OUTCOME_NO_DOODLE = 3, 73 OUTCOME_NO_DOODLE = 3,
72 OUTCOME_EXPIRED = 4, 74 OUTCOME_EXPIRED = 4,
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 127
126 // The list of observers to be notified when the DoodleConfig changes. 128 // The list of observers to be notified when the DoodleConfig changes.
127 base::ObserverList<Observer> observers_; 129 base::ObserverList<Observer> observers_;
128 130
129 DISALLOW_COPY_AND_ASSIGN(DoodleService); 131 DISALLOW_COPY_AND_ASSIGN(DoodleService);
130 }; 132 };
131 133
132 } // namespace doodle 134 } // namespace doodle
133 135
134 #endif // COMPONENTS_DOODLE_DOODLE_SERVICE_H_ 136 #endif // COMPONENTS_DOODLE_DOODLE_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698