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" |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 static jlong GetNativeBookmarkModel(JNIEnv* env, | 94 static jlong GetNativeBookmarkModel(JNIEnv* env, |
95 jclass caller, | 95 jclass caller, |
96 jobject j_profile) { | 96 jobject j_profile) { |
97 Profile *profile = ProfileAndroid::FromProfileAndroid(j_profile); | 97 Profile *profile = ProfileAndroid::FromProfileAndroid(j_profile); |
98 BookmarkModel *bookmark_model_ = BookmarkModelFactory::GetForProfile(profile); | 98 BookmarkModel *bookmark_model_ = BookmarkModelFactory::GetForProfile(profile); |
99 return reinterpret_cast<jlong>(bookmark_model_); | 99 return reinterpret_cast<jlong>(bookmark_model_); |
100 } | 100 } |
101 | 101 |
102 static bool IsEditBookmarksEnabled() { | 102 static bool IsEditBookmarksEnabled() { |
103 return ProfileManager::GetLastUsedProfile()->GetPrefs()->GetBoolean( | 103 return ProfileManager::GetLastUsedProfile()->GetPrefs()->GetBoolean( |
104 prefs::kEditBookmarksEnabled); | 104 bookmarks::prefs::kEditBookmarksEnabled); |
105 } | 105 } |
106 | 106 |
107 static jboolean IsEditBookmarksEnabled(JNIEnv* env, jclass clazz) { | 107 static jboolean IsEditBookmarksEnabled(JNIEnv* env, jclass clazz) { |
108 return IsEditBookmarksEnabled(); | 108 return IsEditBookmarksEnabled(); |
109 } | 109 } |
110 | 110 |
111 ScopedJavaLocalRef<jobject> BookmarksBridge::GetBookmarkByID(JNIEnv* env, | 111 ScopedJavaLocalRef<jobject> BookmarksBridge::GetBookmarkByID(JNIEnv* env, |
112 jobject obj, | 112 jobject obj, |
113 jlong id, | 113 jlong id, |
114 jint type) { | 114 jint type) { |
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
652 BookmarkModelChanged(); | 652 BookmarkModelChanged(); |
653 } | 653 } |
654 | 654 |
655 void BookmarksBridge::PartnerShimLoaded(PartnerBookmarksShim* shim) { | 655 void BookmarksBridge::PartnerShimLoaded(PartnerBookmarksShim* shim) { |
656 NotifyIfDoneLoading(); | 656 NotifyIfDoneLoading(); |
657 } | 657 } |
658 | 658 |
659 void BookmarksBridge::ShimBeingDeleted(PartnerBookmarksShim* shim) { | 659 void BookmarksBridge::ShimBeingDeleted(PartnerBookmarksShim* shim) { |
660 partner_bookmarks_shim_ = NULL; | 660 partner_bookmarks_shim_ = NULL; |
661 } | 661 } |
OLD | NEW |