| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "chrome/browser/android/bookmarks/bookmarks_bridge.h" | 5 #include "chrome/browser/android/bookmarks/bookmarks_bridge.h" |
| 6 | 6 |
| 7 #include "base/android/jni_string.h" | 7 #include "base/android/jni_string.h" |
| 8 #include "base/containers/stack_container.h" | 8 #include "base/containers/stack_container.h" |
| 9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
| 10 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 10 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
| 11 #include "chrome/browser/bookmarks/chrome_bookmark_client_factory.h" | 11 #include "chrome/browser/bookmarks/chrome_bookmark_client_factory.h" |
| 12 #include "chrome/browser/bookmarks/enhanced_bookmarks_features.h" |
| 12 #include "chrome/browser/profiles/incognito_helpers.h" | 13 #include "chrome/browser/profiles/incognito_helpers.h" |
| 13 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
| 14 #include "chrome/browser/profiles/profile_android.h" | 15 #include "chrome/browser/profiles/profile_android.h" |
| 15 #include "chrome/browser/profiles/profile_manager.h" | 16 #include "chrome/browser/profiles/profile_manager.h" |
| 16 #include "chrome/browser/signin/signin_manager_factory.h" | 17 #include "chrome/browser/signin/signin_manager_factory.h" |
| 17 #include "chrome/common/pref_names.h" | 18 #include "chrome/common/pref_names.h" |
| 18 #include "components/bookmarks/browser/bookmark_model.h" | 19 #include "components/bookmarks/browser/bookmark_model.h" |
| 19 #include "components/bookmarks/browser/bookmark_utils.h" | 20 #include "components/bookmarks/browser/bookmark_utils.h" |
| 20 #include "components/bookmarks/common/android/bookmark_type.h" | 21 #include "components/bookmarks/common/android/bookmark_type.h" |
| 21 #include "components/signin/core/browser/signin_manager.h" | 22 #include "components/signin/core/browser/signin_manager.h" |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 | 102 |
| 102 static bool IsEditBookmarksEnabled() { | 103 static bool IsEditBookmarksEnabled() { |
| 103 return ProfileManager::GetLastUsedProfile()->GetPrefs()->GetBoolean( | 104 return ProfileManager::GetLastUsedProfile()->GetPrefs()->GetBoolean( |
| 104 prefs::kEditBookmarksEnabled); | 105 prefs::kEditBookmarksEnabled); |
| 105 } | 106 } |
| 106 | 107 |
| 107 static jboolean IsEditBookmarksEnabled(JNIEnv* env, jclass clazz) { | 108 static jboolean IsEditBookmarksEnabled(JNIEnv* env, jclass clazz) { |
| 108 return IsEditBookmarksEnabled(); | 109 return IsEditBookmarksEnabled(); |
| 109 } | 110 } |
| 110 | 111 |
| 112 |
| 113 static jboolean IsEnhancedBookmarksEnabled(JNIEnv* env, jclass clazz) { |
| 114 return IsEnhancedBookmarksExperimentEnabled(); |
| 115 } |
| 116 |
| 111 ScopedJavaLocalRef<jobject> BookmarksBridge::GetBookmarkByID(JNIEnv* env, | 117 ScopedJavaLocalRef<jobject> BookmarksBridge::GetBookmarkByID(JNIEnv* env, |
| 112 jobject obj, | 118 jobject obj, |
| 113 jlong id, | 119 jlong id, |
| 114 jint type) { | 120 jint type) { |
| 115 DCHECK(IsLoaded()); | 121 DCHECK(IsLoaded()); |
| 116 return CreateJavaBookmark(GetNodeByID(id, type)); | 122 return CreateJavaBookmark(GetNodeByID(id, type)); |
| 117 } | 123 } |
| 118 | 124 |
| 119 void BookmarksBridge::GetPermanentNodeIDs(JNIEnv* env, | 125 void BookmarksBridge::GetPermanentNodeIDs(JNIEnv* env, |
| 120 jobject obj, | 126 jobject obj, |
| (...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 652 BookmarkModelChanged(); | 658 BookmarkModelChanged(); |
| 653 } | 659 } |
| 654 | 660 |
| 655 void BookmarksBridge::PartnerShimLoaded(PartnerBookmarksShim* shim) { | 661 void BookmarksBridge::PartnerShimLoaded(PartnerBookmarksShim* shim) { |
| 656 NotifyIfDoneLoading(); | 662 NotifyIfDoneLoading(); |
| 657 } | 663 } |
| 658 | 664 |
| 659 void BookmarksBridge::ShimBeingDeleted(PartnerBookmarksShim* shim) { | 665 void BookmarksBridge::ShimBeingDeleted(PartnerBookmarksShim* shim) { |
| 660 partner_bookmarks_shim_ = NULL; | 666 partner_bookmarks_shim_ = NULL; |
| 661 } | 667 } |
| OLD | NEW |