Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Unified Diff: chrome/browser/android/bookmark/edit_bookmark_helper.cc

Issue 1141283003: Upstream oodles of Chrome for Android code into Chromium. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: final patch? Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/android/bookmark/edit_bookmark_helper.cc
diff --git a/chrome/browser/android/bookmark/edit_bookmark_helper.cc b/chrome/browser/android/bookmark/edit_bookmark_helper.cc
new file mode 100644
index 0000000000000000000000000000000000000000..c3f1341ed4413fa591ebd0e02a3bd23880395c22
--- /dev/null
+++ b/chrome/browser/android/bookmark/edit_bookmark_helper.cc
@@ -0,0 +1,41 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/android/bookmark/edit_bookmark_helper.h"
+
+#include "base/android/jni_android.h"
+#include "base/android/jni_string.h"
+#include "chrome/browser/android/bookmarks/partner_bookmarks_shim.h"
+#include "chrome/browser/profiles/incognito_helpers.h"
+#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/profiles/profile_android.h"
+#include "jni/EditBookmarkHelper_jni.h"
+
+using bookmarks::BookmarkNode;
+
+void SetPartnerBookmarkTitle(JNIEnv* env,
+ jclass clazz,
+ jobject jprofile,
+ jlong bookmark_id,
+ jstring new_title) {
+ PartnerBookmarksShim* partner_bookmarks_shim =
+ PartnerBookmarksShim::BuildForBrowserContext(
+ chrome::GetBrowserContextRedirectedInIncognito(
+ ProfileAndroid::FromProfileAndroid(jprofile)));
+ if (!partner_bookmarks_shim)
+ return;
+
+ const BookmarkNode* node = partner_bookmarks_shim->GetNodeByID(bookmark_id);
+ if (!node)
+ return;
+
+ partner_bookmarks_shim->RenameBookmark(
+ node,
+ base::android::ConvertJavaStringToUTF16(env, new_title));
+}
+
+// static
+bool RegisterEditBookmarkHelper(JNIEnv* env) {
+ return RegisterNativesImpl(env);
+}
« no previous file with comments | « chrome/browser/android/bookmark/edit_bookmark_helper.h ('k') | chrome/browser/android/chrome_entry_point.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698