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

Unified Diff: chrome/browser/ui/bookmarks/bookmark_tab_helper.cc

Issue 8135001: Fixed behavior of the bookmark bar visibility. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: DCHECK_EQ instead of DCHECK Created 9 years, 2 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
« no previous file with comments | « chrome/browser/resources/options/browser_options.js ('k') | chrome/browser/ui/browser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/bookmarks/bookmark_tab_helper.cc
diff --git a/chrome/browser/ui/bookmarks/bookmark_tab_helper.cc b/chrome/browser/ui/bookmarks/bookmark_tab_helper.cc
index 7a8cbb1010a47b6da23e79e198d0d2510312bc7a..d72077f63ed105c3816aa0bfe000bf4a965bc951 100644
--- a/chrome/browser/ui/bookmarks/bookmark_tab_helper.cc
+++ b/chrome/browser/ui/bookmarks/bookmark_tab_helper.cc
@@ -15,10 +15,14 @@
#include "content/browser/tab_contents/tab_contents.h"
#include "content/common/notification_service.h"
-static bool ForceBookmarkBarVisible(WebUI* ui) {
- return ui && static_cast<ChromeWebUI*>(ui)->force_bookmark_bar_visible();
+namespace {
+
+bool CanShowBookmarkBar(WebUI* ui) {
+ return ui && static_cast<ChromeWebUI*>(ui)->CanShowBookmarkBar();
}
+} // namespace
+
BookmarkTabHelper::BookmarkTabHelper(TabContentsWrapper* tab_contents)
: TabContentsObserver(tab_contents->tab_contents()),
is_starred_(false),
@@ -47,13 +51,13 @@ bool BookmarkTabHelper::ShouldShowBookmarkBar() {
// does.
if (tab_contents()->controller().GetLastCommittedEntry()) {
// Not the first load, always use the committed Web UI.
- return ForceBookmarkBarVisible(tab_contents()->committed_web_ui());
+ return CanShowBookmarkBar(tab_contents()->committed_web_ui());
}
// When it's the first load, we know either the pending one or the committed
// one will have the Web UI in it (see GetWebUIForCurrentState), and only one
// of them will be valid, so we can just check both.
- return ForceBookmarkBarVisible(tab_contents()->web_ui());
+ return CanShowBookmarkBar(tab_contents()->web_ui());
}
void BookmarkTabHelper::DidNavigateMainFramePostCommit(
« no previous file with comments | « chrome/browser/resources/options/browser_options.js ('k') | chrome/browser/ui/browser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698