Commit 0d5bf221 authored by Gauthier Ambard's avatar Gauthier Ambard Committed by Commit Bot

Show bookmark action even if the model isn't loaded

This CL shows the 'Add to Bookmark' action in the activity menu even if
the bookmark model isn't loaded yet.
If the model isn't loaded and the user tries to add the page to the
bookmarks, the action will silently fails.

Bug: 834723
Cq-Include-Trybots: master.tryserver.chromium.mac:ios-simulator-cronet;master.tryserver.chromium.mac:ios-simulator-full-configs
Change-Id: Id4ae21e3c20cdfad5487d95a928b52103614807d
Reviewed-on: https://chromium-review.googlesource.com/1025101
Commit-Queue: Gauthier Ambard <gambard@chromium.org>
Reviewed-by: default avatarRohit Rao <rohitrao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#553158}
parent 3fc9e170
......@@ -256,9 +256,9 @@ NSString* const kActivityServicesSnackbarCategory =
dispatcher:dispatcher];
[applicationActivities addObject:readingListActivity];
if (IsUIRefreshPhase1Enabled() && bookmarkModel &&
bookmarkModel->loaded()) {
BOOL bookmarked = bookmarkModel->IsBookmarked(data.visibleURL);
if (IsUIRefreshPhase1Enabled() && bookmarkModel) {
BOOL bookmarked = bookmarkModel->loaded() &&
bookmarkModel->IsBookmarked(data.visibleURL);
BookmarkActivity* bookmarkActivity =
[[BookmarkActivity alloc] initWithURL:data.visibleURL
bookmarked:bookmarked
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment