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

Unified Diff: chrome/browser/ui/views/frame/instant_overlay_controller_views.cc

Issue 12631008: alternate ntp: implement Show/HideBars API to reduce jank when showing/hiding bars (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed build break Created 7 years, 9 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/ui/search/search_tab_helper.cc ('k') | chrome/common/render_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/frame/instant_overlay_controller_views.cc
diff --git a/chrome/browser/ui/views/frame/instant_overlay_controller_views.cc b/chrome/browser/ui/views/frame/instant_overlay_controller_views.cc
index 097d41593adf896661b44393c58c4b2a8c118da4..047859983ca920158ec7db458b5e0db9cc668954 100644
--- a/chrome/browser/ui/views/frame/instant_overlay_controller_views.cc
+++ b/chrome/browser/ui/views/frame/instant_overlay_controller_views.cc
@@ -5,8 +5,12 @@
#include "chrome/browser/ui/views/frame/instant_overlay_controller_views.h"
#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/search/search.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/search/instant_overlay_model.h"
+#include "chrome/browser/ui/search/search_model.h"
+#include "chrome/browser/ui/search/search_tab_helper.h"
+#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/browser/ui/view_ids.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
#include "chrome/browser/ui/views/frame/contents_container.h"
@@ -25,6 +29,10 @@ InstantOverlayControllerViews::~InstantOverlayControllerViews() {
void InstantOverlayControllerViews::OverlayStateChanged(
const InstantOverlayModel& model) {
+ // Set top bars (bookmark and info bars) visibility if Instant Extended API
+ // is enabled.
+ bool set_top_bars_visibility = chrome::search::IsInstantExtendedAPIEnabled();
+
if (model.mode().is_ntp() || model.mode().is_search_suggestions()) {
// Show the overlay.
if (!overlay_) {
@@ -44,18 +52,26 @@ void InstantOverlayControllerViews::OverlayStateChanged(
overlay_->SetWebContents(NULL);
contents_->SetOverlay(NULL, NULL, 100, INSTANT_SIZE_PERCENT, false);
overlay_.reset();
+ } else {
+ // Don't set top bars visiblility if nothing was done with overlay.
+ set_top_bars_visibility = false;
}
- browser_->MaybeUpdateBookmarkBarStateForInstantOverlay(model.mode());
+ if (set_top_bars_visibility) {
+ // Set top bars visibility for current tab via |SearchTabHelper| of current
+ // active web contents: top bars are hidden if there's overlay.
+ chrome::search::SearchTabHelper* search_tab_helper =
+ chrome::search::SearchTabHelper::FromWebContents(
+ browser_->tab_strip_model()->GetActiveWebContents());
+ if (search_tab_helper)
+ search_tab_helper->model()->SetTopBarsVisible(!overlay_);
+ }
// If an Instant overlay is added during an immersive mode reveal, the reveal
// view needs to stay on top.
- // Notify infobar container of change in overlay state.
if (overlay_) {
BrowserView* browser_view = BrowserView::GetBrowserViewForBrowser(browser_);
- if (browser_view) {
+ if (browser_view)
browser_view->MaybeStackImmersiveRevealAtTop();
- browser_view->infobar_container()->OverlayStateChanged(model);
- }
}
}
« no previous file with comments | « chrome/browser/ui/search/search_tab_helper.cc ('k') | chrome/common/render_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698