| 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/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
| 9 #include "chrome/browser/bookmarks/bookmark_model.h" | 9 #include "chrome/browser/bookmarks/bookmark_model.h" |
| 10 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 10 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 | 68 |
| 69 void BookmarksBridge::Destroy(JNIEnv*, jobject) { | 69 void BookmarksBridge::Destroy(JNIEnv*, jobject) { |
| 70 delete this; | 70 delete this; |
| 71 } | 71 } |
| 72 | 72 |
| 73 // static | 73 // static |
| 74 bool BookmarksBridge::RegisterBookmarksBridge(JNIEnv* env) { | 74 bool BookmarksBridge::RegisterBookmarksBridge(JNIEnv* env) { |
| 75 return RegisterNativesImpl(env); | 75 return RegisterNativesImpl(env); |
| 76 } | 76 } |
| 77 | 77 |
| 78 static jint Init(JNIEnv* env, jobject obj, jobject j_profile) { | 78 static jlong Init(JNIEnv* env, jobject obj, jobject j_profile) { |
| 79 BookmarksBridge* delegate = new BookmarksBridge(env, obj, j_profile); | 79 BookmarksBridge* delegate = new BookmarksBridge(env, obj, j_profile); |
| 80 return reinterpret_cast<jint>(delegate); | 80 return reinterpret_cast<intptr_t>(delegate); |
| 81 } | 81 } |
| 82 | 82 |
| 83 static bool IsEditBookmarksEnabled() { | 83 static bool IsEditBookmarksEnabled() { |
| 84 return ProfileManager::GetLastUsedProfile()->GetPrefs()->GetBoolean( | 84 return ProfileManager::GetLastUsedProfile()->GetPrefs()->GetBoolean( |
| 85 prefs::kEditBookmarksEnabled); | 85 prefs::kEditBookmarksEnabled); |
| 86 } | 86 } |
| 87 | 87 |
| 88 static jboolean IsEditBookmarksEnabled(JNIEnv* env, jclass clazz) { | 88 static jboolean IsEditBookmarksEnabled(JNIEnv* env, jclass clazz) { |
| 89 return IsEditBookmarksEnabled(); | 89 return IsEditBookmarksEnabled(); |
| 90 } | 90 } |
| (...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 453 BookmarkModelChanged(); | 453 BookmarkModelChanged(); |
| 454 } | 454 } |
| 455 | 455 |
| 456 void BookmarksBridge::PartnerShimLoaded(PartnerBookmarksShim* shim) { | 456 void BookmarksBridge::PartnerShimLoaded(PartnerBookmarksShim* shim) { |
| 457 NotifyIfDoneLoading(); | 457 NotifyIfDoneLoading(); |
| 458 } | 458 } |
| 459 | 459 |
| 460 void BookmarksBridge::ShimBeingDeleted(PartnerBookmarksShim* shim) { | 460 void BookmarksBridge::ShimBeingDeleted(PartnerBookmarksShim* shim) { |
| 461 partner_bookmarks_shim_ = NULL; | 461 partner_bookmarks_shim_ = NULL; |
| 462 } | 462 } |
| OLD | NEW |