| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/partner_bookmarks_reader.h" | 5 #include "chrome/browser/android/bookmarks/partner_bookmarks_reader.h" |
| 6 | 6 |
| 7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
| 8 #include "base/android/jni_string.h" | 8 #include "base/android/jni_string.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "chrome/browser/android/bookmarks/partner_bookmarks_shim.h" | 10 #include "chrome/browser/android/bookmarks/partner_bookmarks_shim.h" |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 const_cast<BookmarkNode*>(parent)->Add(node, parent->child_count()); | 176 const_cast<BookmarkNode*>(parent)->Add(node, parent->child_count()); |
| 177 } else { | 177 } else { |
| 178 node = new BookmarkPermanentNode(wip_next_available_id_++); | 178 node = new BookmarkPermanentNode(wip_next_available_id_++); |
| 179 node->SetTitle(title); | 179 node->SetTitle(title); |
| 180 wip_partner_bookmarks_root_.reset(node); | 180 wip_partner_bookmarks_root_.reset(node); |
| 181 } | 181 } |
| 182 return node->id(); | 182 return node->id(); |
| 183 } | 183 } |
| 184 | 184 |
| 185 // static | 185 // static |
| 186 static void DisablePartnerBookmarksEditing(JNIEnv* env, jclass clazz) { | 186 static void DisablePartnerBookmarksEditing(JNIEnv* env, |
| 187 const JavaParamRef<jclass>& clazz) { |
| 187 PartnerBookmarksShim::DisablePartnerBookmarksEditing(); | 188 PartnerBookmarksShim::DisablePartnerBookmarksEditing(); |
| 188 } | 189 } |
| 189 | 190 |
| 190 // static | 191 // static |
| 191 bool PartnerBookmarksReader::RegisterPartnerBookmarksReader(JNIEnv* env) { | 192 bool PartnerBookmarksReader::RegisterPartnerBookmarksReader(JNIEnv* env) { |
| 192 return RegisterNativesImpl(env); | 193 return RegisterNativesImpl(env); |
| 193 } | 194 } |
| 194 | 195 |
| 195 // ---------------------------------------------------------------- | 196 // ---------------------------------------------------------------- |
| 196 | 197 |
| 197 static jlong Init(JNIEnv* env, jobject obj) { | 198 static jlong Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { |
| 198 Profile* profile = ProfileManager::GetActiveUserProfile(); | 199 Profile* profile = ProfileManager::GetActiveUserProfile(); |
| 199 PartnerBookmarksShim* partner_bookmarks_shim = | 200 PartnerBookmarksShim* partner_bookmarks_shim = |
| 200 PartnerBookmarksShim::BuildForBrowserContext(profile); | 201 PartnerBookmarksShim::BuildForBrowserContext(profile); |
| 201 PartnerBookmarksReader* reader = new PartnerBookmarksReader( | 202 PartnerBookmarksReader* reader = new PartnerBookmarksReader( |
| 202 partner_bookmarks_shim, profile); | 203 partner_bookmarks_shim, profile); |
| 203 return reinterpret_cast<intptr_t>(reader); | 204 return reinterpret_cast<intptr_t>(reader); |
| 204 } | 205 } |
| OLD | NEW |