Don't allow invalid Instant suggestions.

Don't allow the page to set Instant suggestions when inappropriate. This
typically happens because the page is reacting slowly, when the user has
already moved on by typing or clearing more text in the omnibox.

Also:
+ SearchProvider is needed in extended mode whether or not Instant is
  enabled, so make sure SearchProvider::done_ reflects that.
+ Check for "if (!extended_enabled_)" (or "... && !instant_enabled_") at
  the top of every public method, even if sometimes it's redundant. Such
  a pattern helps ensure that Instant doesn't accidentally do anything
  when disabled.

BUG=162303,162130
[email protected],[email protected]
TEST=See bugs.


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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@169487 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/autocomplete/search_provider.cc b/chrome/browser/autocomplete/search_provider.cc
index 32e2147..b428e0f5 100644
--- a/chrome/browser/autocomplete/search_provider.cc
+++ b/chrome/browser/autocomplete/search_provider.cc
@@ -1259,5 +1259,6 @@
   // pending, and we're not waiting on instant.
   done_ = (!timer_.IsRunning() && (suggest_results_pending_ == 0) &&
            (instant_finalized_ ||
-            !chrome::BrowserInstantController::IsInstantEnabled(profile_)));
+            (!chrome::BrowserInstantController::IsInstantEnabled(profile_) &&
+             !chrome::search::IsInstantExtendedAPIEnabled(profile_))));
 }