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

Unified Diff: chrome/browser/ui/browser_commands.cc

Issue 302313005: Show the Managed Bookmarks folder in the views UI. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix mac browser_Tests Created 6 years, 6 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/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);
}
}
« no previous file with comments | « chrome/browser/ui/bookmarks/bookmark_drag_drop.cc ('k') | chrome/browser/ui/cocoa/view_id_util_browsertest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698