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

Unified Diff: chrome/browser/ui/startup/startup_browser_creator.cc

Issue 1477783004: Add a preference to control Windows desktop search redirection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix compile error. Created 5 years 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/ui/startup/startup_browser_creator.cc
diff --git a/chrome/browser/ui/startup/startup_browser_creator.cc b/chrome/browser/ui/startup/startup_browser_creator.cc
index 9e9daf6ae563672ae4a6726e344f9513d7fda910..51b9dd33c4ab288a052c3037578acc9517cd4838 100644
--- a/chrome/browser/ui/startup/startup_browser_creator.cc
+++ b/chrome/browser/ui/startup/startup_browser_creator.cc
@@ -92,8 +92,7 @@
#if defined(OS_WIN)
#include "chrome/browser/metrics/jumplist_metrics_win.h"
-#include "components/search_engines/detect_desktop_search_win.h"
-#include "components/search_engines/search_engines_switches.h"
+#include "components/search_engines/desktop_search_win.h"
#endif
#if defined(ENABLE_PRINT_PREVIEW)
@@ -553,16 +552,16 @@ std::vector<GURL> StartupBrowserCreator::GetURLsFromCommandLine(
GURL url = GURL(param.MaybeAsASCII());
#if defined(OS_WIN)
- if (command_line.HasSwitch(
- switches::kUseDefaultSearchProviderForDesktopSearch)) {
+ if (ShouldRedirectWindowsDesktopSearchToDefaultSearchEngine(
+ profile->GetPrefs())) {
TemplateURLService* template_url_service =
TemplateURLServiceFactory::GetForProfile(profile);
DCHECK(template_url_service);
base::string16 search_terms;
if (DetectWindowsDesktopSearch(
url, template_url_service->search_terms_data(), &search_terms)) {
- GURL search_url(GetDefaultSearchURLForSearchTerms(template_url_service,
- search_terms));
+ const GURL search_url(GetDefaultSearchURLForSearchTerms(
+ template_url_service, search_terms));
if (search_url.is_valid()) {
urls.push_back(search_url);
continue;
« no previous file with comments | « chrome/browser/ui/startup/startup_browser_creator.h ('k') | chrome/browser/ui/startup/startup_browser_creator_win_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698