| 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)
|
|
|