Index: chrome/browser/ui/browser_commands.cc |
diff --git a/chrome/browser/ui/browser_commands.cc b/chrome/browser/ui/browser_commands.cc |
index 38cff6b408d594efa8b93cd183bc8a836b59002f..22c2428f6034cbedac711567241e15e30ff4822a 100644 |
--- a/chrome/browser/ui/browser_commands.cc |
+++ b/chrome/browser/ui/browser_commands.cc |
@@ -174,19 +174,22 @@ void BookmarkCurrentPageInternal(Browser* browser) { |
WebContents* web_contents = |
browser->tab_strip_model()->GetActiveWebContents(); |
GetURLAndTitleToBookmark(web_contents, &url, &title); |
- bool was_bookmarked = model->IsBookmarked(url); |
- if (!was_bookmarked && web_contents->GetBrowserContext()->IsOffTheRecord()) { |
+ bool is_bookmarked_by_any = model->IsBookmarked(url); |
+ if (!is_bookmarked_by_any && |
+ web_contents->GetBrowserContext()->IsOffTheRecord()) { |
// If we're incognito the favicon may not have been saved. Save it now |
// so that bookmarks have an icon for the page. |
FaviconTabHelper::FromWebContents(web_contents)->SaveFavicon(); |
} |
+ bool was_bookmarked_by_user = bookmark_utils::IsBookmarkedByUser(model, url); |
bookmark_utils::AddIfNotBookmarked(model, url, title); |
+ bool is_bookmarked_by_user = bookmark_utils::IsBookmarkedByUser(model, url); |
// Make sure the model actually added a bookmark before showing the star. A |
// bookmark isn't created if the url is invalid. |
- if (browser->window()->IsActive() && model->IsBookmarked(url)) { |
+ if (browser->window()->IsActive() && is_bookmarked_by_user) { |
// Only show the bubble if the window is active, otherwise we may get into |
// weird situations where the bubble is deleted as soon as it is shown. |
- browser->window()->ShowBookmarkBubble(url, was_bookmarked); |
+ browser->window()->ShowBookmarkBubble(url, was_bookmarked_by_user); |
} |
} |