Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3165)

Unified Diff: chrome/browser/search_engines/search_terms_data.cc

Issue 12386019: Instant: Use only one hidden WebContents per profile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/search_engines/search_terms_data.cc
diff --git a/chrome/browser/search_engines/search_terms_data.cc b/chrome/browser/search_engines/search_terms_data.cc
index a1adfc9f4c8ae633b65957e100c7a54fb1dd74a4..2ae6da8bbffdfa99aad473822d95809aed69eb69 100644
--- a/chrome/browser/search_engines/search_terms_data.cc
+++ b/chrome/browser/search_engines/search_terms_data.cc
@@ -11,7 +11,6 @@
#include "chrome/browser/google/google_url_tracker.h"
#include "chrome/browser/google/google_util.h"
#include "chrome/browser/profiles/profile.h"
-#include "chrome/browser/ui/browser_instant_controller.h"
#include "chrome/browser/ui/search/search.h"
#include "content/public/browser/browser_thread.h"
#include "googleurl/src/gurl.h"
@@ -130,26 +129,20 @@ std::string UIThreadSearchTermsData::GetSearchClient() const {
std::string UIThreadSearchTermsData::InstantEnabledParam() const {
DCHECK(!BrowserThread::IsWellKnownThread(BrowserThread::UI) ||
BrowserThread::CurrentlyOn(BrowserThread::UI));
- if (profile_) {
- uint32 instant_extended_api_version =
- chrome::search::EmbeddedSearchPageVersion(profile_);
- if (instant_extended_api_version == 0 &&
- chrome::BrowserInstantController::IsInstantEnabled(profile_))
- return "ion=1&";
- }
+ if (chrome::search::IsInstantPrefEnabled(profile_) &&
+ !chrome::search::IsInstantExtendedAPIEnabled(profile_))
+ return "ion=1&";
return std::string();
}
std::string UIThreadSearchTermsData::InstantExtendedEnabledParam() const {
DCHECK(!BrowserThread::IsWellKnownThread(BrowserThread::UI) ||
BrowserThread::CurrentlyOn(BrowserThread::UI));
- if (profile_) {
- uint32 instant_extended_api_version =
- chrome::search::EmbeddedSearchPageVersion(profile_);
- if (instant_extended_api_version != 0) {
- return std::string(google_util::kInstantExtendedAPIParam) + "=" +
- base::Uint64ToString(instant_extended_api_version) + "&";
- }
+ uint64 instant_extended_api_version =
+ chrome::search::EmbeddedSearchPageVersion(profile_);
+ if (instant_extended_api_version) {
+ return std::string(google_util::kInstantExtendedAPIParam) + "=" +
+ base::Uint64ToString(instant_extended_api_version) + "&";
}
return std::string();
}

Powered by Google App Engine
This is Rietveld 408576698