| Index: chrome/browser/ui/cocoa/tab_contents/instant_overlay_controller_mac.mm
|
| diff --git a/chrome/browser/ui/cocoa/tab_contents/instant_overlay_controller_mac.mm b/chrome/browser/ui/cocoa/tab_contents/instant_overlay_controller_mac.mm
|
| index 13bad50e89dc6abbbe84705b758654737cc3c42c..68006c7a7f36a98032a5f96483dc19c511b0030a 100644
|
| --- a/chrome/browser/ui/cocoa/tab_contents/instant_overlay_controller_mac.mm
|
| +++ b/chrome/browser/ui/cocoa/tab_contents/instant_overlay_controller_mac.mm
|
| @@ -2,11 +2,17 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| +#include "chrome/browser/ui/cocoa/tab_contents/instant_overlay_controller_mac.h"
|
| +
|
| +#include "chrome/browser/search/search.h"
|
| #include "chrome/browser/ui/browser.h"
|
| #import "chrome/browser/ui/cocoa/browser_window_controller.h"
|
| #include "chrome/browser/ui/cocoa/tab_contents/instant_overlay_controller_mac.h"
|
| #import "chrome/browser/ui/cocoa/tab_contents/overlayable_contents_controller.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"
|
|
|
| InstantOverlayControllerMac::InstantOverlayControllerMac(
|
| Browser* browser,
|
| @@ -22,6 +28,11 @@ InstantOverlayControllerMac::~InstantOverlayControllerMac() {
|
|
|
| void InstantOverlayControllerMac::OverlayStateChanged(
|
| const InstantOverlayModel& model) {
|
| + // TODO(sail): migrate from InstantOverlayControllerViews::OverlayStateChanged
|
| + // to only call SetTopBarsVisible if we did something with overlay; this
|
| + // prevents the top bars from flashing in this transition
|
| + // DEFAULT->SUGGESTIONS->SERP.
|
| + bool has_overlay = false;
|
| if (model.mode().is_ntp() || model.mode().is_search_suggestions()) {
|
| // Drop shadow is only needed if search mode is not |NTP| and overlay does
|
| // not fill up the entire contents page.
|
| @@ -32,12 +43,24 @@ void InstantOverlayControllerMac::OverlayStateChanged(
|
| height:model.height()
|
| heightUnits:model.height_units()
|
| drawDropShadow:drawDropShadow];
|
| + has_overlay = true;
|
| } else {
|
| [overlay_ setOverlay:NULL
|
| height:0
|
| heightUnits:INSTANT_SIZE_PIXELS
|
| drawDropShadow:NO];
|
| }
|
| - browser_->MaybeUpdateBookmarkBarStateForInstantOverlay(model.mode());
|
| +
|
| + if (chrome::search::IsInstantExtendedAPIEnabled()) {
|
| + // Set top bars (bookmark and info 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(!has_overlay);
|
| + }
|
| +
|
| [window_ updateBookmarkBarStateForInstantOverlay];
|
| }
|
|
|