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

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

Issue 1899683003: NTP tiles: Split C++ and Java MostVisitedSites classes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_ANDROID_NTP_MOST_VISITED_SITES_BRIDGE_H_
6 #define CHROME_BROWSER_ANDROID_NTP_MOST_VISITED_SITES_BRIDGE_H_
7
8 #include <jni.h>
9 #include <stddef.h>
10
11 #include <memory>
12 #include <string>
13 #include <vector>
14
15 #include "base/android/scoped_java_ref.h"
16 #include "base/macros.h"
17 #include "chrome/browser/android/ntp/most_visited_sites.h"
18
19 class Profile;
20
21 // Provides the list of most visited sites and their thumbnails to Java.
22 class MostVisitedSitesBridge {
23 public:
24 explicit MostVisitedSitesBridge(Profile* profile);
25
26 void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj);
27
28 void SetMostVisitedURLsObserver(
29 JNIEnv* env,
30 const base::android::JavaParamRef<jobject>& obj,
31 const base::android::JavaParamRef<jobject>& j_observer,
32 jint num_sites);
33
34 void GetURLThumbnail(
35 JNIEnv* env,
36 const base::android::JavaParamRef<jobject>& obj,
37 const base::android::JavaParamRef<jstring>& url,
38 const base::android::JavaParamRef<jobject>& j_callback);
39 void AddOrRemoveBlacklistedUrl(
40 JNIEnv* env,
41 const base::android::JavaParamRef<jobject>& obj,
42 const base::android::JavaParamRef<jstring>& j_url,
43 jboolean add_url);
44 void RecordTileTypeMetrics(
45 JNIEnv* env,
46 const base::android::JavaParamRef<jobject>& obj,
47 const base::android::JavaParamRef<jintArray>& jtile_types);
48 void RecordOpenedMostVisitedItem(
49 JNIEnv* env,
50 const base::android::JavaParamRef<jobject>& obj,
51 jint index,
52 jint tile_type);
53
54 // Registers JNI methods.
55 static bool Register(JNIEnv* env);
56
57 private:
58 ~MostVisitedSitesBridge();
59
60 class Observer;
61 std::unique_ptr<Observer> observer_;
62
63 MostVisitedSites most_visited_;
64
65 DISALLOW_COPY_AND_ASSIGN(MostVisitedSitesBridge);
66 };
67
68 #endif // CHROME_BROWSER_ANDROID_NTP_MOST_VISITED_SITES_BRIDGE_H_
OLDNEW
« no previous file with comments | « chrome/browser/android/ntp/most_visited_sites.cc ('k') | chrome/browser/android/ntp/most_visited_sites_bridge.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698