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

Side by Side Diff: chrome/browser/android/ntp/ntp_snippets_launcher.h

Issue 2733283002: Require explicit selection of traits for LazyInstance (Closed)
Patch Set: l10n again Created 3 years, 9 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_ANDROID_NTP_NTP_SNIPPETS_LAUNCHER_H_ 5 #ifndef CHROME_BROWSER_ANDROID_NTP_NTP_SNIPPETS_LAUNCHER_H_
6 #define CHROME_BROWSER_ANDROID_NTP_NTP_SNIPPETS_LAUNCHER_H_ 6 #define CHROME_BROWSER_ANDROID_NTP_NTP_SNIPPETS_LAUNCHER_H_
7 7
8 #include "base/android/jni_android.h" 8 #include "base/android/jni_android.h"
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "base/time/time.h" 11 #include "base/time/time.h"
12 #include "components/ntp_snippets/remote/persistent_scheduler.h" 12 #include "components/ntp_snippets/remote/persistent_scheduler.h"
13 13
14 // Android implementation of ntp_snippets::NTPSnippetsScheduler. 14 // Android implementation of ntp_snippets::NTPSnippetsScheduler.
15 // The NTPSnippetsLauncher singleton owns the Java SnippetsLauncher object, and 15 // The NTPSnippetsLauncher singleton owns the Java SnippetsLauncher object, and
16 // is used to schedule the fetching of snippets. Runs on the UI thread. 16 // is used to schedule the fetching of snippets. Runs on the UI thread.
17 class NTPSnippetsLauncher 17 class NTPSnippetsLauncher
18 : public ntp_snippets::PersistentScheduler { 18 : public ntp_snippets::PersistentScheduler {
19 public: 19 public:
20 static NTPSnippetsLauncher* Get(); 20 static NTPSnippetsLauncher* Get();
21 21
22 // ntp_snippets::NTPSnippetsScheduler implementation. 22 // ntp_snippets::NTPSnippetsScheduler implementation.
23 bool Schedule(base::TimeDelta period_wifi, 23 bool Schedule(base::TimeDelta period_wifi,
24 base::TimeDelta period_fallback) override; 24 base::TimeDelta period_fallback) override;
25 bool Unschedule() override; 25 bool Unschedule() override;
26 26
27 private: 27 private:
28 friend struct base::DefaultLazyInstanceTraits<NTPSnippetsLauncher>; 28 friend struct base::LazyInstanceTraitsBase<NTPSnippetsLauncher>;
29 29
30 // Constructor and destructor marked private to enforce singleton. 30 // Constructor and destructor marked private to enforce singleton.
31 NTPSnippetsLauncher(); 31 NTPSnippetsLauncher();
32 virtual ~NTPSnippetsLauncher(); 32 virtual ~NTPSnippetsLauncher();
33 33
34 base::android::ScopedJavaGlobalRef<jobject> java_launcher_; 34 base::android::ScopedJavaGlobalRef<jobject> java_launcher_;
35 35
36 DISALLOW_COPY_AND_ASSIGN(NTPSnippetsLauncher); 36 DISALLOW_COPY_AND_ASSIGN(NTPSnippetsLauncher);
37 }; 37 };
38 38
39 #endif // CHROME_BROWSER_ANDROID_NTP_NTP_SNIPPETS_LAUNCHER_H_ 39 #endif // CHROME_BROWSER_ANDROID_NTP_NTP_SNIPPETS_LAUNCHER_H_
OLDNEW
« no previous file with comments | « chrome/browser/android/download/download_controller.cc ('k') | chrome/browser/android/ntp/ntp_snippets_launcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698