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

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

Issue 17022004: Replace --google-base-suggest-url and --instant-url with --google-base-url. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 6 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/ui/startup/startup_browser_creator.cc
===================================================================
--- chrome/browser/ui/startup/startup_browser_creator.cc (revision 208572)
+++ chrome/browser/ui/startup/startup_browser_creator.cc (working copy)
@@ -45,9 +45,7 @@
#include "chrome/browser/printing/print_dialog_cloud.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h"
-#include "chrome/browser/search_engines/template_url.h"
-#include "chrome/browser/search_engines/template_url_service.h"
-#include "chrome/browser/search_engines/template_url_service_factory.h"
+#include "chrome/browser/search_engines/util.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/browser_window.h"
@@ -384,22 +382,17 @@
const base::FilePath& cur_dir,
Profile* profile) {
std::vector<GURL> urls;
+
const CommandLine::StringVector& params = command_line.GetArgs();
-
for (size_t i = 0; i < params.size(); ++i) {
base::FilePath param = base::FilePath(params[i]);
// Handle Vista way of searching - "? <search-term>"
- if (param.value().size() > 2 &&
- param.value()[0] == '?' && param.value()[1] == ' ') {
- const TemplateURL* default_provider =
- TemplateURLServiceFactory::GetForProfile(profile)->
- GetDefaultSearchProvider();
- if (default_provider) {
- const TemplateURLRef& search_url = default_provider->url_ref();
- DCHECK(search_url.SupportsReplacement());
- string16 search_term = param.LossyDisplayName().substr(2);
- urls.push_back(GURL(search_url.ReplaceSearchTerms(
- TemplateURLRef::SearchTermsArgs(search_term))));
+ if ((param.value().size() > 2) && (param.value()[0] == '?') &&
+ (param.value()[1] == ' ')) {
+ GURL url(GetDefaultSearchURLForSearchTerms(
+ profile, param.LossyDisplayName().substr(2)));
+ if (url.is_valid()) {
+ urls.push_back(url);
continue;
}
}
@@ -436,9 +429,9 @@
// If we are in Windows 8 metro mode and were launched as a result of the
// search charm or via a url navigation in metro, then fetch the
// corresponding url.
- GURL url = chrome::GetURLToOpen(profile);
+ GURL url(chrome::GetURLToOpen(profile));
if (url.is_valid())
- urls.push_back(GURL(url));
+ urls.push_back(url);
}
#endif // OS_WIN
return urls;
« no previous file with comments | « chrome/browser/ui/search/instant_controller.h ('k') | chrome/browser/ui/startup/startup_browser_creator_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698