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

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

Issue 10824387: Implement forwarding of search queries for metro mode (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 4 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
« no previous file with comments | « chrome/browser/process_singleton_win.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/startup/startup_browser_creator_win.cc
===================================================================
--- chrome/browser/ui/startup/startup_browser_creator_win.cc (revision 152659)
+++ chrome/browser/ui/startup/startup_browser_creator_win.cc (working copy)
@@ -12,40 +12,15 @@
namespace chrome {
-// Metro driver exports for getting the launch type, initial url, initial
-// search term, etc.
-extern "C" {
-typedef const wchar_t* (*GetInitialUrl)();
-typedef const wchar_t* (*GetInitialSearchString)();
-typedef base::win::MetroLaunchType (*GetLaunchType)(
- base::win::MetroPreviousExecutionState* previous_state);
-}
-
GURL GetURLToOpen(Profile* profile) {
- HMODULE metro = base::win::GetMetroModule();
- if (!metro)
- return GURL();
+ string16 params;
+ base::win::MetroLaunchType launch_type =
+ base::win::GetMetroLaunchParams(&params);
- GetLaunchType get_launch_type = reinterpret_cast<GetLaunchType>(
- ::GetProcAddress(metro, "GetLaunchType"));
- DCHECK(get_launch_type);
-
- base::win::MetroLaunchType launch_type = get_launch_type(NULL);
-
- if (launch_type == base::win::PROTOCOL || launch_type == base::win::LAUNCH) {
- GetInitialUrl initial_metro_url = reinterpret_cast<GetInitialUrl>(
- ::GetProcAddress(metro, "GetInitialUrl"));
- DCHECK(initial_metro_url);
- const wchar_t* initial_url = initial_metro_url();
- if (initial_url)
- return GURL(initial_url);
- } else if (launch_type == base::win::SEARCH) {
- GetInitialSearchString initial_search_string =
- reinterpret_cast<GetInitialSearchString>(
- ::GetProcAddress(metro, "GetInitialSearchString"));
- DCHECK(initial_search_string);
- string16 search_string = initial_search_string();
-
+ if ((launch_type == base::win::METRO_PROTOCOL) ||
+ (launch_type == base::win::METRO_LAUNCH)) {
+ return GURL(params);
+ } else if (launch_type == base::win::METRO_SEARCH) {
const TemplateURL* default_provider =
TemplateURLServiceFactory::GetForProfile(profile)->
GetDefaultSearchProvider();
@@ -53,7 +28,7 @@
const TemplateURLRef& search_url = default_provider->url_ref();
DCHECK(search_url.SupportsReplacement());
return GURL(search_url.ReplaceSearchTerms(
- TemplateURLRef::SearchTermsArgs(search_string)));
+ TemplateURLRef::SearchTermsArgs(params)));
}
}
return GURL();
« no previous file with comments | « chrome/browser/process_singleton_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698