| Index: chrome/browser/instant/instant_controller.cc
|
| diff --git a/chrome/browser/instant/instant_controller.cc b/chrome/browser/instant/instant_controller.cc
|
| index ef6bb1306a6e9bfaae299f321845860cd0a70acf..f8bc0f2033545dd15d116a76e1ac1f8bb92c2035 100644
|
| --- a/chrome/browser/instant/instant_controller.cc
|
| +++ b/chrome/browser/instant/instant_controller.cc
|
| @@ -259,12 +259,12 @@ bool InstantController::Update(const AutocompleteMatch& match,
|
|
|
| // TODO(tonyg): This method only fires when the omnibox bounds change. It also
|
| // needs to fire when the preview bounds change (e.g.: open/close info bar).
|
| -void InstantController::SetOmniboxBounds(const gfx::Rect& bounds) {
|
| - if (omnibox_bounds_ == bounds)
|
| +void InstantController::SetPopupBounds(const gfx::Rect& bounds) {
|
| + if (popup_bounds_ == bounds)
|
| return;
|
|
|
| - omnibox_bounds_ = bounds;
|
| - if (omnibox_bounds_.height() > last_omnibox_bounds_.height()) {
|
| + popup_bounds_ = bounds;
|
| + if (popup_bounds_.height() > last_popup_bounds_.height()) {
|
| update_bounds_timer_.Stop();
|
| SendBoundsToPage();
|
| } else if (!update_bounds_timer_.IsRunning()) {
|
| @@ -274,6 +274,16 @@ void InstantController::SetOmniboxBounds(const gfx::Rect& bounds) {
|
| }
|
| }
|
|
|
| +void InstantController::SetOmniboxBounds(const gfx::Rect& bounds) {
|
| + if (omnibox_bounds_ == bounds ||
|
| + model_.preview_state() == InstantModel::NOT_READY ||
|
| + !GetPreviewContents() || loader_->IsPointerDownFromActivate())
|
| + return;
|
| +
|
| + omnibox_bounds_ = bounds;
|
| + loader_->SetOmniboxBounds(bounds);
|
| +}
|
| +
|
| void InstantController::HandleAutocompleteResults(
|
| const std::vector<AutocompleteProvider*>& providers) {
|
| if (mode_ != EXTENDED || !GetPreviewContents())
|
| @@ -716,7 +726,7 @@ void InstantController::DeleteLoader() {
|
| last_verbatim_ = false;
|
| last_suggestion_ = InstantSuggestion();
|
| last_match_was_search_ = false;
|
| - last_omnibox_bounds_ = gfx::Rect();
|
| + last_popup_bounds_ = gfx::Rect();
|
| url_for_history_ = GURL();
|
| if (GetPreviewContents())
|
| model_.SetPreviewState(InstantModel::NOT_READY, 0, INSTANT_SIZE_PERCENT);
|
| @@ -744,14 +754,14 @@ void InstantController::Show(InstantShownReason reason,
|
| }
|
|
|
| void InstantController::SendBoundsToPage() {
|
| - if (last_omnibox_bounds_ == omnibox_bounds_ ||
|
| + if (last_popup_bounds_ == popup_bounds_ ||
|
| model_.preview_state() == InstantModel::NOT_READY ||
|
| !GetPreviewContents() || loader_->IsPointerDownFromActivate())
|
| return;
|
|
|
| - last_omnibox_bounds_ = omnibox_bounds_;
|
| + last_popup_bounds_ = popup_bounds_;
|
| gfx::Rect preview_bounds = browser_->GetInstantBounds();
|
| - gfx::Rect intersection = gfx::IntersectRects(omnibox_bounds_, preview_bounds);
|
| + gfx::Rect intersection = gfx::IntersectRects(popup_bounds_, preview_bounds);
|
|
|
| // Translate into window coordinates.
|
| if (!intersection.IsEmpty()) {
|
| @@ -768,7 +778,7 @@ void InstantController::SendBoundsToPage() {
|
| DCHECK_LE(0, intersection.width());
|
| DCHECK_LE(0, intersection.height());
|
|
|
| - loader_->SetOmniboxBounds(intersection);
|
| + loader_->SetPopupBounds(intersection);
|
| }
|
|
|
| bool InstantController::GetInstantURL(const TemplateURL* template_url,
|
|
|