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

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

Issue 2833473002: Record NTP.LogoShownTime for timely refreshs only (Closed)
Patch Set: Fix compile errors and comments Created 3 years, 7 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 // Adds a new observer to the service. It'll only be called when the config 51 // Adds a new observer to the service. It'll only be called when the config
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. Returns true if a network request was actually sent.
62 void Refresh(); 62 bool Refresh();
63 63
64 private: 64 private:
65 // Note: Keep in sync with the corresponding enum in histograms.xml. Never 65 // Note: Keep in sync with the corresponding enum in histograms.xml. Never
66 // remove values, and only insert new values at the end. 66 // remove values, and only insert new values at the end.
67 enum DownloadOutcome { 67 enum DownloadOutcome {
68 OUTCOME_NEW_DOODLE = 0, 68 OUTCOME_NEW_DOODLE = 0,
69 OUTCOME_REVALIDATED_DOODLE = 1, 69 OUTCOME_REVALIDATED_DOODLE = 1,
70 OUTCOME_CHANGED_DOODLE = 2, 70 OUTCOME_CHANGED_DOODLE = 2,
71 OUTCOME_NO_DOODLE = 3, 71 OUTCOME_NO_DOODLE = 3,
72 OUTCOME_EXPIRED = 4, 72 OUTCOME_EXPIRED = 4,
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 125
126 // The list of observers to be notified when the DoodleConfig changes. 126 // The list of observers to be notified when the DoodleConfig changes.
127 base::ObserverList<Observer> observers_; 127 base::ObserverList<Observer> observers_;
128 128
129 DISALLOW_COPY_AND_ASSIGN(DoodleService); 129 DISALLOW_COPY_AND_ASSIGN(DoodleService);
130 }; 130 };
131 131
132 } // namespace doodle 132 } // namespace doodle
133 133
134 #endif // COMPONENTS_DOODLE_DOODLE_SERVICE_H_ 134 #endif // COMPONENTS_DOODLE_DOODLE_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698