Commit 6d3bc6ab authored by samarth@chromium.org's avatar samarth@chromium.org

InstantExtended: better handling of switching between tab and overlay.

This fixes two issues:
1) Set use_tab_for_suggestions_ at the end of OnAutocompleteStart so that it
doesn't get overridden by calls to HideOverlay.
2) If not using tab for suggestions, make sure the overlay is ready to use.

BUG=241835

Review URL: https://chromiumcodereview.appspot.com/15755011

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@202966 0039d316-1c4b-4281-b951-d872f2087c98
parent a76346e1
...@@ -295,14 +295,12 @@ InstantController::~InstantController() { ...@@ -295,14 +295,12 @@ InstantController::~InstantController() {
} }
void InstantController::OnAutocompleteStart() { void InstantController::OnAutocompleteStart() {
if (instant_tab_ && instant_tab_->supports_instant()) { if (UseTabForSuggestions() && instant_tab_->supports_instant()) {
LOG_INSTANT_DEBUG_EVENT( LOG_INSTANT_DEBUG_EVENT(
this, "OnAutocompleteStart: using InstantTab"); this, "OnAutocompleteStart: using InstantTab");
return; return;
} }
use_tab_for_suggestions_ = false;
// Not using |instant_tab_|. Check if overlay is OK to use. // Not using |instant_tab_|. Check if overlay is OK to use.
InstantFallbackReason fallback_reason = ShouldSwitchToLocalOverlay(); InstantFallbackReason fallback_reason = ShouldSwitchToLocalOverlay();
if (fallback_reason != INSTANT_FALLBACK_NONE) { if (fallback_reason != INSTANT_FALLBACK_NONE) {
...@@ -314,6 +312,7 @@ void InstantController::OnAutocompleteStart() { ...@@ -314,6 +312,7 @@ void InstantController::OnAutocompleteStart() {
LOG_INSTANT_DEBUG_EVENT( LOG_INSTANT_DEBUG_EVENT(
this, "OnAutocompleteStart: using existing overlay"); this, "OnAutocompleteStart: using existing overlay");
} }
use_tab_for_suggestions_ = false;
} }
bool InstantController::Update(const AutocompleteMatch& match, bool InstantController::Update(const AutocompleteMatch& match,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment