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

Side by Side Diff: win8/metro_driver/chrome_url_launch_handler.cc

Issue 819223002: Make callers of CommandLine use it via the base:: namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 6 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 unified diff | Download patch
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 "stdafx.h" 5 #include "stdafx.h"
6 #include "chrome_url_launch_handler.h" 6 #include "chrome_url_launch_handler.h"
7 #include "chrome_app_view.h" 7 #include "chrome_app_view.h"
8 8
9 #include <assert.h> 9 #include <assert.h>
10 #include <shellapi.h> 10 #include <shellapi.h>
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 // find the URL to launch the first argument is used. If any other parameters 101 // find the URL to launch the first argument is used. If any other parameters
102 // are encoded in |launch_args| they are ignored. 102 // are encoded in |launch_args| they are ignored.
103 base::string16 ChromeUrlLaunchHandler::GetUrlFromLaunchArgs( 103 base::string16 ChromeUrlLaunchHandler::GetUrlFromLaunchArgs(
104 const base::string16& launch_args) { 104 const base::string16& launch_args) {
105 if (launch_args == L"opennewwindow") { 105 if (launch_args == L"opennewwindow") {
106 VLOG(1) << "Returning new tab url"; 106 VLOG(1) << "Returning new tab url";
107 return L"chrome://newtab"; 107 return L"chrome://newtab";
108 } 108 }
109 base::string16 dummy_command_line(L"dummy.exe "); 109 base::string16 dummy_command_line(L"dummy.exe ");
110 dummy_command_line.append(launch_args); 110 dummy_command_line.append(launch_args);
111 CommandLine command_line = CommandLine::FromString(dummy_command_line); 111 base::CommandLine command_line =
112 CommandLine::StringVector args = command_line.GetArgs(); 112 base::CommandLine::FromString(dummy_command_line);
113 base::CommandLine::StringVector args = command_line.GetArgs();
113 if (args.size() > 0) 114 if (args.size() > 0)
114 return args[0]; 115 return args[0];
115 116
116 return base::string16(); 117 return base::string16();
117 } 118 }
118 119
119 void ChromeUrlLaunchHandler::HandleLaunch( 120 void ChromeUrlLaunchHandler::HandleLaunch(
120 winapp::Activation::ILaunchActivatedEventArgs* args) { 121 winapp::Activation::ILaunchActivatedEventArgs* args) {
121 mswrw::HString launch_args; 122 mswrw::HString launch_args;
122 args->get_Arguments(launch_args.GetAddressOf()); 123 args->get_Arguments(launch_args.GetAddressOf());
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 if (url) { 198 if (url) {
198 VLOG(1) << "Posting url:" << url; 199 VLOG(1) << "Posting url:" << url;
199 PostMessage(globals.host_windows.front().first, navigation_search_message, 200 PostMessage(globals.host_windows.front().first, navigation_search_message,
200 reinterpret_cast<WPARAM>(url), 0); 201 reinterpret_cast<WPARAM>(url), 0);
201 } else { 202 } else {
202 VLOG(1) << "Posting search string:" << search_string; 203 VLOG(1) << "Posting search string:" << search_string;
203 PostMessage(globals.host_windows.front().first, navigation_search_message, 204 PostMessage(globals.host_windows.front().first, navigation_search_message,
204 0, reinterpret_cast<LPARAM>(search_string)); 205 0, reinterpret_cast<LPARAM>(search_string));
205 } 206 }
206 } 207 }
OLDNEW
« no previous file with comments | « win8/delegate_execute/delegate_execute_util_unittest.cc ('k') | win8/metro_driver/metro_driver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698