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

Unified Diff: apps/launcher.cc

Issue 280703003: Don't ever create a file in about:blank when launching packaged apps. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix warning Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: apps/launcher.cc
diff --git a/apps/launcher.cc b/apps/launcher.cc
index e081eb185f131589133144d3a6fa50d822c4ea9e..c1a90c5c638f051d19cf8f73dfddfa765ffee2ff 100644
--- a/apps/launcher.cc
+++ b/apps/launcher.cc
@@ -20,6 +20,8 @@
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/web_contents.h"
+#include "content/public/common/content_switches.h"
+#include "content/public/common/url_constants.h"
#include "extensions/browser/event_router.h"
#include "extensions/browser/extension_host.h"
#include "extensions/browser/extension_prefs.h"
@@ -351,7 +353,19 @@ void LaunchPlatformAppWithCommandLine(Profile* profile,
}
}
- if (command_line.GetArgs().empty()) {
+#if defined(OS_WIN)
+ base::CommandLine::StringType about_blank_url(
+ base::ASCIIToWide(content::kAboutBlankURL));
+#else
+ base::CommandLine::StringType about_blank_url(content::kAboutBlankURL);
+#endif
+ CommandLine::StringVector args = command_line.GetArgs();
+ // Browser tests will add about:blank to the command line. This should
+ // never be interpreted as a file to open, as doing so with an app that
+ // has write access will result in a file 'about' being created, which
+ // causes problems on the bots.
+ if (args.empty() || (command_line.HasSwitch(switches::kTestType) &&
+ args[0] == about_blank_url)) {
LaunchPlatformAppWithNoData(profile, extension);
return;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698