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

Side by Side Diff: chrome/browser/extensions/extension_apitest.cc

Issue 10332071: Pass command line arguments onto platform apps which provide the right intent. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Compile fixed, postResult added Created 8 years, 7 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 | Annotate | Revision Log
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 "chrome/browser/extensions/extension_apitest.h" 5 #include "chrome/browser/extensions/extension_apitest.h"
6 6
7 #include "base/string_util.h" 7 #include "base/string_util.h"
8 #include "base/stringprintf.h" 8 #include "base/stringprintf.h"
9 #include "chrome/browser/extensions/extension_service.h" 9 #include "chrome/browser/extensions/extension_service.h"
10 #include "chrome/browser/extensions/extension_test_api.h" 10 #include "chrome/browser/extensions/extension_test_api.h"
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 202
203 url = extension->GetResourceURL(page_url); 203 url = extension->GetResourceURL(page_url);
204 } 204 }
205 205
206 if (use_incognito) 206 if (use_incognito)
207 ui_test_utils::OpenURLOffTheRecord(browser()->profile(), url); 207 ui_test_utils::OpenURLOffTheRecord(browser()->profile(), url);
208 else 208 else
209 ui_test_utils::NavigateToURL(browser(), url); 209 ui_test_utils::NavigateToURL(browser(), url);
210 210
211 } else if (launch_platform_app) { 211 } else if (launch_platform_app) {
212 CommandLine* command_line = CommandLine::ForCurrentProcess();
212 Browser::OpenApplication( 213 Browser::OpenApplication(
213 browser()->profile(), 214 browser()->profile(),
214 extension, 215 extension,
215 extension_misc::LAUNCH_NONE, 216 extension_misc::LAUNCH_NONE,
216 GURL(), 217 GURL(),
217 NEW_WINDOW); 218 NEW_WINDOW,
219 command_line);
218 } 220 }
219 221
220 if (!catcher.GetNextResult()) { 222 if (!catcher.GetNextResult()) {
221 message_ = catcher.message(); 223 message_ = catcher.message();
222 return false; 224 return false;
223 } else { 225 } else {
224 return true; 226 return true;
225 } 227 }
226 } 228 }
227 229
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 ExtensionApiTest::SetUpCommandLine(command_line); 293 ExtensionApiTest::SetUpCommandLine(command_line);
292 294
293 // If someone is using this class, we're going to insist on management of the 295 // If someone is using this class, we're going to insist on management of the
294 // relevant flags. If these flags are already set, die. 296 // relevant flags. If these flags are already set, die.
295 DCHECK(!command_line->HasSwitch(switches::kEnablePlatformApps)); 297 DCHECK(!command_line->HasSwitch(switches::kEnablePlatformApps));
296 DCHECK(!command_line->HasSwitch(switches::kEnableExperimentalExtensionApis)); 298 DCHECK(!command_line->HasSwitch(switches::kEnableExperimentalExtensionApis));
297 299
298 command_line->AppendSwitch(switches::kEnableExperimentalExtensionApis); 300 command_line->AppendSwitch(switches::kEnableExperimentalExtensionApis);
299 command_line->AppendSwitch(switches::kEnablePlatformApps); 301 command_line->AppendSwitch(switches::kEnablePlatformApps);
300 } 302 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698