diff options
author | jamescook <jamescook@chromium.org> | 2014-08-25 12:18:31 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-08-25 19:20:55 +0000 |
commit | 0692b620049f9ef8fa1ee9f0cac271de1bdfdc77 (patch) | |
tree | 17cac10575018cee656a164c4afd0f63156531d3 /extensions/shell/browser/api | |
parent | d367ce3dc35ee4fe607bc60eff1315ca7ac3f985 (diff) | |
download | chromium_src-0692b620049f9ef8fa1ee9f0cac271de1bdfdc77.zip chromium_src-0692b620049f9ef8fa1ee9f0cac271de1bdfdc77.tar.gz chromium_src-0692b620049f9ef8fa1ee9f0cac271de1bdfdc77.tar.bz2 |
app_shell: Allow window to load a normal URL
For testing purposes, allow shell.createWindow() to load a non-extension
URL.
BUG=none
TEST=none
Review URL: https://codereview.chromium.org/487533006
Cr-Commit-Position: refs/heads/master@{#291736}
Diffstat (limited to 'extensions/shell/browser/api')
-rw-r--r-- | extensions/shell/browser/api/shell/shell_api.cc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/extensions/shell/browser/api/shell/shell_api.cc b/extensions/shell/browser/api/shell/shell_api.cc index afc58dd..acd0654 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)); |