| OLD | NEW |
| 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_ANDROID_ENHANCED_BOOKMARKS_ENHANCED_BOOKMARKS_BRIDGE_H_ | 5 #ifndef CHROME_BROWSER_ENHANCED_BOOKMARKS_ANDROID_ENHANCED_BOOKMARKS_BRIDGE_H_ |
| 6 #define CHROME_BROWSER_ANDROID_ENHANCED_BOOKMARKS_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 | 19 |
| 19 namespace android { | 20 namespace android { |
| 20 | 21 |
| 21 class EnhancedBookmarksBridge : public BookmarkServerServiceObserver { | 22 class EnhancedBookmarksBridge : public BookmarkServerServiceObserver { |
| 22 public: | 23 public: |
| 23 EnhancedBookmarksBridge(JNIEnv* env, jobject obj, Profile* profile); | 24 EnhancedBookmarksBridge(JNIEnv* env, jobject obj, Profile* profile); |
| 24 virtual ~EnhancedBookmarksBridge(); | 25 virtual ~EnhancedBookmarksBridge(); |
| 25 void Destroy(JNIEnv*, jobject); | 26 void Destroy(JNIEnv*, jobject); |
| 26 | 27 |
| 28 void SalientImageForUrl(JNIEnv* env, |
| 29 jobject obj, |
| 30 jstring j_url, |
| 31 jobject j_callback); |
| 32 |
| 27 base::android::ScopedJavaLocalRef<jstring> GetBookmarkDescription( | 33 base::android::ScopedJavaLocalRef<jstring> GetBookmarkDescription( |
| 28 JNIEnv* env, | 34 JNIEnv* env, |
| 29 jobject obj, | 35 jobject obj, |
| 30 jlong id, | 36 jlong id, |
| 31 jint type); | 37 jint type); |
| 32 void SetBookmarkDescription(JNIEnv* env, | 38 void SetBookmarkDescription(JNIEnv* env, |
| 33 jobject obj, | 39 jobject obj, |
| 34 jlong id, | 40 jlong id, |
| 35 jint type, | 41 jint type, |
| 36 jstring description); | 42 jstring description); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 jstring j_query); | 78 jstring j_query); |
| 73 | 79 |
| 74 // BookmarkServerServiceObserver | 80 // BookmarkServerServiceObserver |
| 75 // Called on changes to cluster data or search results are returned. | 81 // Called on changes to cluster data or search results are returned. |
| 76 virtual void OnChange(BookmarkServerService* service) override; | 82 virtual void OnChange(BookmarkServerService* service) override; |
| 77 | 83 |
| 78 private: | 84 private: |
| 79 bool IsEditable(const BookmarkNode* node) const; | 85 bool IsEditable(const BookmarkNode* node) const; |
| 80 | 86 |
| 81 JavaObjectWeakGlobalRef weak_java_ref_; | 87 JavaObjectWeakGlobalRef weak_java_ref_; |
| 82 EnhancedBookmarkModel* enhanced_bookmark_model_; // weak | 88 EnhancedBookmarkModel* enhanced_bookmark_model_; // weak |
| 83 BookmarkServerClusterService* cluster_service_; // weak | 89 BookmarkServerClusterService* cluster_service_; // weak |
| 90 BookmarkImageService* bookmark_image_service_; // weak |
| 84 scoped_ptr<BookmarkServerSearchService> search_service_; | 91 scoped_ptr<BookmarkServerSearchService> search_service_; |
| 85 Profile* profile_; // weak | 92 Profile* profile_; // weak |
| 86 DISALLOW_COPY_AND_ASSIGN(EnhancedBookmarksBridge); | 93 DISALLOW_COPY_AND_ASSIGN(EnhancedBookmarksBridge); |
| 87 }; | 94 }; |
| 88 | 95 |
| 89 bool RegisterEnhancedBookmarksBridge(JNIEnv* env); | 96 bool RegisterEnhancedBookmarksBridge(JNIEnv* env); |
| 90 | 97 |
| 91 } // namespace android | 98 } // namespace android |
| 92 } // namespace enhanced_bookmarks | 99 } // namespace enhanced_bookmarks |
| 93 | 100 |
| 94 #endif // CHROME_BROWSER_ANDROID_ENHANCED_BOOKMARKS_ENHANCED_BOOKMARKS_BRIDGE_H
_ | 101 #endif // CHROME_BROWSER_ENHANCED_BOOKMARKS_ANDROID_ENHANCED_BOOKMARKS_BRIDGE_H
_ |
| OLD | NEW |