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

Unified Diff: extensions/shell/browser/api/shell/shell_api.cc

Issue 487533006: app_shell: Allow window to load a normal URL (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/shell/browser/api/shell/shell_api.cc
diff --git a/extensions/shell/browser/api/shell/shell_api.cc b/extensions/shell/browser/api/shell/shell_api.cc
index afc58ddd1ebb3612378ac9fec6e874b1bcbcd296..acd0654463de4826a83ca49a4059162c07d0e04b 100644
--- a/extensions/shell/browser/api/shell/shell_api.cc
+++ b/extensions/shell/browser/api/shell/shell_api.cc
@@ -42,8 +42,14 @@ ExtensionFunction::ResponseAction ShellCreateWindowFunction::Run() {
scoped_ptr<CreateWindow::Params> params(CreateWindow::Params::Create(*args_));
EXTENSION_FUNCTION_VALIDATE(params.get());
- // Convert "main.html" to "chrome-extension:/<id>/main.html".
- GURL url = extension()->GetResourceURL(params->url);
+ GURL url(params->url);
+ if (url.GetOrigin().is_empty()) {
+ // Convert "main.html" to "chrome-extension:/<id>/main.html".
+ url = extension()->GetResourceURL(params->url);
+ } else {
+ // Load a typical "http://example.com/" URL.
+ LOG(WARNING) << "Loading non-extension URL " << url.spec();
+ }
if (!url.is_valid())
return RespondNow(Error(kInvalidArguments));
« 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