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

Side by Side Diff: chrome/browser/search_engines/search_terms_data.cc

Issue 10879043: Centralize logic around Instant modes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: renamed to CreateInstant; fixed ordering Created 8 years, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/search_engines/search_terms_data.h" 5 #include "chrome/browser/search_engines/search_terms_data.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/metrics/field_trial.h" 8 #include "base/metrics/field_trial.h"
9 #include "chrome/browser/browser_process.h" 9 #include "chrome/browser/browser_process.h"
10 #include "chrome/browser/google/google_url_tracker.h" 10 #include "chrome/browser/google/google_url_tracker.h"
11 #include "chrome/browser/google/google_util.h" 11 #include "chrome/browser/google/google_util.h"
12 #include "chrome/browser/instant/instant_controller.h" 12 #include "chrome/browser/instant/instant_controller.h"
13 #include "chrome/browser/profiles/profile.h" 13 #include "chrome/browser/profiles/profile.h"
14 #include "chrome/browser/ui/search/search.h"
15 #include "content/public/browser/browser_thread.h" 14 #include "content/public/browser/browser_thread.h"
16 #include "googleurl/src/gurl.h" 15 #include "googleurl/src/gurl.h"
17 16
18 #if defined(ENABLE_RLZ) 17 #if defined(ENABLE_RLZ)
19 #include "chrome/browser/google/google_util.h" 18 #include "chrome/browser/google/google_util.h"
20 #include "chrome/browser/rlz/rlz.h" 19 #include "chrome/browser/rlz/rlz.h"
21 #endif 20 #endif
22 21
23 using content::BrowserThread; 22 using content::BrowserThread;
24 23
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 // search might not send the RLZ data but this is not really a problem. 104 // search might not send the RLZ data but this is not really a problem.
106 RLZTracker::GetAccessPointRlz(rlz_lib::CHROME_OMNIBOX, &rlz_string); 105 RLZTracker::GetAccessPointRlz(rlz_lib::CHROME_OMNIBOX, &rlz_string);
107 } 106 }
108 return rlz_string; 107 return rlz_string;
109 } 108 }
110 #endif 109 #endif
111 110
112 std::string UIThreadSearchTermsData::InstantEnabledParam() const { 111 std::string UIThreadSearchTermsData::InstantEnabledParam() const {
113 DCHECK(!BrowserThread::IsWellKnownThread(BrowserThread::UI) || 112 DCHECK(!BrowserThread::IsWellKnownThread(BrowserThread::UI) ||
114 BrowserThread::CurrentlyOn(BrowserThread::UI)); 113 BrowserThread::CurrentlyOn(BrowserThread::UI));
115 if (InstantController::IsEnabled(profile_)) { 114 if (InstantController::IsExtendedAPIEnabled(profile_))
116 return std::string(chrome::search::IsInstantExtendedAPIEnabled(profile_) ? 115 return std::string(google_util::kInstantExtendedAPIParam) + "=1&";
117 google_util::kInstantExtendedAPIParam : "ion") + "=1&"; 116 if (InstantController::IsInstantEnabled(profile_))
118 } 117 return "ion=1&";
119 return std::string(); 118 return std::string();
120 } 119 }
121 120
122 // static 121 // static
123 void UIThreadSearchTermsData::SetGoogleBaseURL(const std::string& base_url) { 122 void UIThreadSearchTermsData::SetGoogleBaseURL(const std::string& base_url) {
124 delete google_base_url_; 123 delete google_base_url_;
125 google_base_url_ = base_url.empty() ? NULL : new std::string(base_url); 124 google_base_url_ = base_url.empty() ? NULL : new std::string(base_url);
126 } 125 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698