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

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

Issue 1238683003: Unpunycode search keywords and short names. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Restrict IDN-decoding to keywords generated from URL; Use prefs::kAcceptLanguages for IDN-decoding Created 5 years, 5 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/ui_thread_search_terms_data.h" 5 #include "chrome/browser/search_engines/ui_thread_search_terms_data.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/metrics/field_trial.h" 9 #include "base/metrics/field_trial.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
11 #include "chrome/browser/browser_process.h" 11 #include "chrome/browser/browser_process.h"
12 #include "chrome/browser/google/google_brand.h" 12 #include "chrome/browser/google/google_brand.h"
13 #include "chrome/browser/google/google_url_tracker_factory.h" 13 #include "chrome/browser/google/google_url_tracker_factory.h"
14 #include "chrome/browser/profiles/profile.h" 14 #include "chrome/browser/profiles/profile.h"
15 #include "chrome/browser/search/instant_service.h" 15 #include "chrome/browser/search/instant_service.h"
16 #include "chrome/browser/search/instant_service_factory.h" 16 #include "chrome/browser/search/instant_service_factory.h"
17 #include "chrome/browser/search/search.h" 17 #include "chrome/browser/search/search.h"
18 #include "chrome/browser/themes/theme_service.h" 18 #include "chrome/browser/themes/theme_service.h"
19 #include "chrome/browser/themes/theme_service_factory.h" 19 #include "chrome/browser/themes/theme_service_factory.h"
20 #include "chrome/common/chrome_switches.h" 20 #include "chrome/common/chrome_switches.h"
21 #include "chrome/common/chrome_version_info.h" 21 #include "chrome/common/chrome_version_info.h"
22 #include "chrome/common/pref_names.h"
22 #include "components/google/core/browser/google_url_tracker.h" 23 #include "components/google/core/browser/google_url_tracker.h"
23 #include "components/google/core/browser/google_util.h" 24 #include "components/google/core/browser/google_util.h"
24 #include "components/omnibox/browser/omnibox_field_trial.h" 25 #include "components/omnibox/browser/omnibox_field_trial.h"
25 #include "components/search/search.h" 26 #include "components/search/search.h"
26 #include "content/public/browser/browser_thread.h" 27 #include "content/public/browser/browser_thread.h"
27 #include "ui/base/device_form_factor.h" 28 #include "ui/base/device_form_factor.h"
28 #include "url/gurl.h" 29 #include "url/gurl.h"
29 30
30 #if defined(ENABLE_RLZ) 31 #if defined(ENABLE_RLZ)
31 #include "components/rlz/rlz_tracker.h" 32 #include "components/rlz/rlz_tracker.h"
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 std::string version(version_info.Name() + " " + version_info.Version()); 175 std::string version(version_info.Name() + " " + version_info.Version());
175 if (version_info.IsOfficialBuild()) 176 if (version_info.IsOfficialBuild())
176 version += " (Official)"; 177 version += " (Official)";
177 version += " " + version_info.OSType(); 178 version += " " + version_info.OSType();
178 std::string modifier(version_info.GetVersionStringModifier()); 179 std::string modifier(version_info.GetVersionStringModifier());
179 if (!modifier.empty()) 180 if (!modifier.empty())
180 version += " " + modifier; 181 version += " " + modifier;
181 return version; 182 return version;
182 } 183 }
183 184
185 std::string UIThreadSearchTermsData::GetAcceptedLanguages() const {
186 if (!profile_)
187 return std::string();
188 return profile_->GetPrefs()->GetString(prefs::kAcceptLanguages);
Peter Kasting 2015/07/20 19:30:51 Nit: Shorter: return profile_ ? profile_-
alshabalin 2015/07/21 08:44:19 Done.
189 }
190
184 // static 191 // static
185 void UIThreadSearchTermsData::SetGoogleBaseURL(const std::string& base_url) { 192 void UIThreadSearchTermsData::SetGoogleBaseURL(const std::string& base_url) {
186 delete google_base_url_; 193 delete google_base_url_;
187 google_base_url_ = base_url.empty() ? NULL : new std::string(base_url); 194 google_base_url_ = base_url.empty() ? NULL : new std::string(base_url);
188 } 195 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698