Index: chrome/browser/infobars/infobar_container.cc |
diff --git a/chrome/browser/infobars/infobar_container.cc b/chrome/browser/infobars/infobar_container.cc |
index b601744e09fac3f45aca280186dab6b1d419ac9d..687956c71988b80f0ec5937afd61c8da2a0698a4 100644 |
--- a/chrome/browser/infobars/infobar_container.cc |
+++ b/chrome/browser/infobars/infobar_container.cc |
@@ -1,4 +1,4 @@ |
-// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
+// Copyright 2012 The Chromium Authors. All rights reserved. |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
@@ -15,7 +15,6 @@ |
#include "chrome/browser/api/infobars/infobar_delegate.h" |
#include "chrome/browser/api/infobars/infobar_service.h" |
#include "chrome/browser/infobars/infobar.h" |
-#include "chrome/browser/instant/instant_overlay_model.h" |
#include "chrome/browser/ui/search/search_model.h" |
#include "chrome/common/chrome_notification_types.h" |
#include "content/public/browser/notification_details.h" |
@@ -121,6 +120,13 @@ void InfoBarContainer::RemoveInfoBar(InfoBar* infobar) { |
infobars_.erase(i); |
} |
+void InfoBarContainer::InstantOverlayShown() { |
+ // Suggestions are being shown on a |DEFAULT| page. Hide the infobars now. |
+ // See comments for ModeChanged() for explanation. |
+ HideAllInfoBars(); |
+ OnInfoBarStateChanged(false); |
+} |
+ |
void InfoBarContainer::RemoveAllInfoBarsForDestruction() { |
// Before we remove any children, we reset |delegate_|, so that no removals |
// will result in us trying to call |
@@ -179,8 +185,8 @@ void InfoBarContainer::ModeChanged(const chrome::search::Mode& old_mode, |
// Hide infobars when showing Instant Extended suggestions. |
if (new_mode.is_search_suggestions()) { |
// If suggestions are being shown on a |DEFAULT| page, delay the hiding |
- // until notification that Instant overlay is ready is received via |
- // OverlayStateChanged(); this prevents jankiness caused by infobars hiding |
+ // until a notification that the Instant overlay is ready is received via |
+ // InstantOverlayShown(); this prevents jankiness caused by infobars hiding |
// followed by suggestions appearing. |
if (new_mode.is_origin_default()) |
return; |
@@ -192,16 +198,6 @@ void InfoBarContainer::ModeChanged(const chrome::search::Mode& old_mode, |
} |
} |
-void InfoBarContainer::OverlayStateChanged(const InstantOverlayModel& model) { |
- // If suggestions are being shown on a |DEFAULT| page, hide the infobars now. |
- // See comments for ModeChanged() for explanation. |
- if (model.mode().is_search_suggestions() && |
- model.mode().is_origin_default()) { |
- HideAllInfoBars(); |
- OnInfoBarStateChanged(false); |
- } |
-} |
- |
size_t InfoBarContainer::HideInfoBar(InfoBarDelegate* delegate, |
bool use_animation) { |
bool should_animate = use_animation && |