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

Side by Side Diff: chrome/browser/enhanced_bookmarks/android/enhanced_bookmarks_bridge.h

Issue 896093007: [Android] Open up API in jni bridge to fetch images from tab (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_ENHANCED_BOOKMARKS_ANDROID_ENHANCED_BOOKMARKS_BRIDGE_H_ 5 #ifndef CHROME_BROWSER_ENHANCED_BOOKMARKS_ANDROID_ENHANCED_BOOKMARKS_BRIDGE_H_
6 #define CHROME_BROWSER_ENHANCED_BOOKMARKS_ANDROID_ENHANCED_BOOKMARKS_BRIDGE_H_ 6 #define CHROME_BROWSER_ENHANCED_BOOKMARKS_ANDROID_ENHANCED_BOOKMARKS_BRIDGE_H_
7 7
8 #include "base/android/jni_android.h" 8 #include "base/android/jni_android.h"
9 #include "base/android/jni_weak_ref.h" 9 #include "base/android/jni_weak_ref.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
11 #include "components/bookmarks/browser/bookmark_model.h" 11 #include "components/bookmarks/browser/bookmark_model.h"
12 #include "components/enhanced_bookmarks/bookmark_server_search_service.h" 12 #include "components/enhanced_bookmarks/bookmark_server_search_service.h"
13 #include "components/enhanced_bookmarks/bookmark_server_service.h" 13 #include "components/enhanced_bookmarks/bookmark_server_service.h"
14 14
15 namespace enhanced_bookmarks { 15 namespace enhanced_bookmarks {
16 16
17 class BookmarkServerClusterService; 17 class BookmarkServerClusterService;
18 class BookmarkImageService; 18 class BookmarkImageServiceAndroid;
19 19
20 namespace android { 20 namespace android {
21 21
22 class EnhancedBookmarksBridge : public BookmarkServerServiceObserver { 22 class EnhancedBookmarksBridge : public BookmarkServerServiceObserver {
23 public: 23 public:
24 EnhancedBookmarksBridge(JNIEnv* env, jobject obj, Profile* profile); 24 EnhancedBookmarksBridge(JNIEnv* env, jobject obj, Profile* profile);
25 ~EnhancedBookmarksBridge() override; 25 ~EnhancedBookmarksBridge() override;
26 void Destroy(JNIEnv*, jobject); 26 void Destroy(JNIEnv*, jobject);
27 27
28 void SalientImageForUrl(JNIEnv* env, 28 void SalientImageForUrl(JNIEnv* env,
29 jobject obj, 29 jobject obj,
30 jstring j_url, 30 jstring j_url,
31 jobject j_callback); 31 jobject j_callback);
32 32
33 void FetchImageForTab(JNIEnv* env, jobject obj, jobject j_web_contents);
34
33 base::android::ScopedJavaLocalRef<jstring> GetBookmarkDescription( 35 base::android::ScopedJavaLocalRef<jstring> GetBookmarkDescription(
34 JNIEnv* env, 36 JNIEnv* env,
35 jobject obj, 37 jobject obj,
36 jlong id, 38 jlong id,
37 jint type); 39 jint type);
38 void SetBookmarkDescription(JNIEnv* env, 40 void SetBookmarkDescription(JNIEnv* env,
39 jobject obj, 41 jobject obj,
40 jlong id, 42 jlong id,
41 jint type, 43 jint type,
42 jstring description); 44 jstring description);
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 // BookmarkServerServiceObserver 82 // BookmarkServerServiceObserver
81 // Called on changes to cluster data or search results are returned. 83 // Called on changes to cluster data or search results are returned.
82 void OnChange(BookmarkServerService* service) override; 84 void OnChange(BookmarkServerService* service) override;
83 85
84 private: 86 private:
85 bool IsEditable(const bookmarks::BookmarkNode* node) const; 87 bool IsEditable(const bookmarks::BookmarkNode* node) const;
86 88
87 JavaObjectWeakGlobalRef weak_java_ref_; 89 JavaObjectWeakGlobalRef weak_java_ref_;
88 EnhancedBookmarkModel* enhanced_bookmark_model_; // weak 90 EnhancedBookmarkModel* enhanced_bookmark_model_; // weak
89 BookmarkServerClusterService* cluster_service_; // weak 91 BookmarkServerClusterService* cluster_service_; // weak
90 BookmarkImageService* bookmark_image_service_; // weak 92 BookmarkImageServiceAndroid* bookmark_image_service_; // weak
Kibeom Kim (inactive) 2015/02/09 22:29:44 nit: align or two spaces each? #90-#92
Ian Wen 2015/02/10 00:13:39 Done.
91 scoped_ptr<BookmarkServerSearchService> search_service_; 93 scoped_ptr<BookmarkServerSearchService> search_service_;
92 Profile* profile_; // weak 94 Profile* profile_; // weak
93 DISALLOW_COPY_AND_ASSIGN(EnhancedBookmarksBridge); 95 DISALLOW_COPY_AND_ASSIGN(EnhancedBookmarksBridge);
94 }; 96 };
95 97
96 bool RegisterEnhancedBookmarksBridge(JNIEnv* env); 98 bool RegisterEnhancedBookmarksBridge(JNIEnv* env);
97 99
98 } // namespace android 100 } // namespace android
99 } // namespace enhanced_bookmarks 101 } // namespace enhanced_bookmarks
100 102
101 #endif // CHROME_BROWSER_ENHANCED_BOOKMARKS_ANDROID_ENHANCED_BOOKMARKS_BRIDGE_H _ 103 #endif // CHROME_BROWSER_ENHANCED_BOOKMARKS_ANDROID_ENHANCED_BOOKMARKS_BRIDGE_H _
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698