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

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

Issue 1869023002: [NTP Snippets] SnippetsBridge: register as SnippetsObserver only when we get a Java observer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@snippets_service_cleanup
Patch Set: rebase Created 4 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
« no previous file with comments | « no previous file | chrome/browser/android/ntp/ntp_snippets_bridge.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_BRIDGE_H_ 5 #ifndef CHROME_BROWSER_ANDROID_NTP_NTP_SNIPPETS_BRIDGE_H_
6 #define CHROME_BROWSER_ANDROID_NTP_NTP_SNIPPETS_BRIDGE_H_ 6 #define CHROME_BROWSER_ANDROID_NTP_NTP_SNIPPETS_BRIDGE_H_
7 7
8 #include <jni.h> 8 #include <jni.h>
9 9
10 #include "base/android/scoped_java_ref.h" 10 #include "base/android/scoped_java_ref.h"
(...skipping 16 matching lines...) Expand all
27 void DiscardSnippet(JNIEnv* env, 27 void DiscardSnippet(JNIEnv* env,
28 const base::android::JavaParamRef<jobject>& obj, 28 const base::android::JavaParamRef<jobject>& obj,
29 const base::android::JavaParamRef<jstring>& url); 29 const base::android::JavaParamRef<jstring>& url);
30 30
31 static bool Register(JNIEnv* env); 31 static bool Register(JNIEnv* env);
32 32
33 private: 33 private:
34 ~NTPSnippetsBridge() override; 34 ~NTPSnippetsBridge() override;
35 35
36 // NTPSnippetsServiceObserver overrides 36 // NTPSnippetsServiceObserver overrides
37 void NTPSnippetsServiceLoaded( 37 void NTPSnippetsServiceLoaded() override;
38 ntp_snippets::NTPSnippetsService* service) override; 38 void NTPSnippetsServiceShutdown() override;
39 void NTPSnippetsServiceShutdown(
40 ntp_snippets::NTPSnippetsService* service) override;
41 39
42 ntp_snippets::NTPSnippetsService* ntp_snippets_service_; 40 ntp_snippets::NTPSnippetsService* ntp_snippets_service_;
43 41
44 // Used to notify the Java side when new snippets have been fetched. 42 // Used to notify the Java side when new snippets have been fetched.
45 base::android::ScopedJavaGlobalRef<jobject> observer_; 43 base::android::ScopedJavaGlobalRef<jobject> observer_;
46 ScopedObserver<ntp_snippets::NTPSnippetsService, 44 ScopedObserver<ntp_snippets::NTPSnippetsService,
47 ntp_snippets::NTPSnippetsServiceObserver> 45 ntp_snippets::NTPSnippetsServiceObserver>
48 snippet_service_observer_; 46 snippet_service_observer_;
49 47
50 DISALLOW_COPY_AND_ASSIGN(NTPSnippetsBridge); 48 DISALLOW_COPY_AND_ASSIGN(NTPSnippetsBridge);
51 }; 49 };
52 50
53 #endif // CHROME_BROWSER_ANDROID_NTP_NTP_SNIPPETS_BRIDGE_H_ 51 #endif // CHROME_BROWSER_ANDROID_NTP_NTP_SNIPPETS_BRIDGE_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/android/ntp/ntp_snippets_bridge.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698