| Index: chrome/browser/android/tab_android.cc
|
| diff --git a/chrome/browser/android/tab_android.cc b/chrome/browser/android/tab_android.cc
|
| index f9464507dd05085f9cfdda0cbd7f886914497b1d..533528fc4cc7baac2aacc91704b2207edcc643a2 100644
|
| --- a/chrome/browser/android/tab_android.cc
|
| +++ b/chrome/browser/android/tab_android.cc
|
| @@ -761,10 +761,11 @@ jlong TabAndroid::GetBookmarkId(JNIEnv* env,
|
| web_contents()->GetURL());
|
| Profile* profile = GetProfile();
|
|
|
| - // If the url points to an offline page, it already has a bookmark ID that it
|
| - // is related to.
|
| - int64_t candidate_bookmark_id =
|
| - offline_pages::OfflinePageUtils::GetBookmarkIdForOfflineURL(profile, url);
|
| + // If the url points to an offline page, then we need to get its original URL.
|
| + if (offline_pages::OfflinePageUtils::IsOfflinePage(profile, url)) {
|
| + url = offline_pages::OfflinePageUtils::GetOnlineURLForOfflineURL(profile,
|
| + url);
|
| + }
|
|
|
| // Get all the nodes for |url| and sort them by date added.
|
| std::vector<const bookmarks::BookmarkNode*> nodes;
|
| @@ -773,13 +774,6 @@ jlong TabAndroid::GetBookmarkId(JNIEnv* env,
|
| bookmarks::BookmarkModel* model =
|
| BookmarkModelFactory::GetForProfile(profile);
|
|
|
| - // If we have a candidate bookmark ID from the offline page model and that ID
|
| - // matches an existing bookmark, return it.
|
| - if (candidate_bookmark_id != -1 &&
|
| - bookmarks::GetBookmarkNodeByID(model, candidate_bookmark_id) != nullptr) {
|
| - return candidate_bookmark_id;
|
| - }
|
| -
|
| model->GetNodesByURL(url, &nodes);
|
| std::sort(nodes.begin(), nodes.end(), &bookmarks::MoreRecentlyAdded);
|
|
|
|
|