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

Unified Diff: chrome/browser/tab_contents/tab_contents.cc

Issue 175017: Experiment with dislodging the Extension Shelf and having it only appear on t... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 4 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/tab_contents/tab_contents.h ('k') | chrome/browser/views/extensions/extension_shelf.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/tab_contents/tab_contents.cc
===================================================================
--- chrome/browser/tab_contents/tab_contents.cc (revision 24842)
+++ chrome/browser/tab_contents/tab_contents.cc (working copy)
@@ -958,6 +958,27 @@
return false; // Default.
}
+bool TabContents::IsExtensionShelfAlwaysVisible() {
+ // See GetDOMUIForCurrentState() comment for more info. This case is very
+ // similar, but for non-first loads, we want to use the committed entry. This
+ // is so the bookmarks bar disappears at the same time the page does.
+ if (controller_.GetLastCommittedEntry()) {
+ // Not the first load, always use the committed DOM UI.
+ if (render_manager_.dom_ui())
+ return render_manager_.dom_ui()->force_extension_shelf_visible();
+ return false; // Default.
+ }
+
+ // When it's the first load, we know either the pending one or the committed
+ // one will have the DOM UI in it (see GetDOMUIForCurrentState), and only one
+ // of them will be valid, so we can just check both.
+ if (render_manager_.pending_dom_ui())
+ return render_manager_.pending_dom_ui()->force_extension_shelf_visible();
+ if (render_manager_.dom_ui())
+ return render_manager_.dom_ui()->force_extension_shelf_visible();
+ return false; // Default.
+}
+
void TabContents::ToolbarSizeChanged(bool is_animating) {
TabContentsDelegate* d = delegate();
if (d)
« no previous file with comments | « chrome/browser/tab_contents/tab_contents.h ('k') | chrome/browser/views/extensions/extension_shelf.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698