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

Side by Side Diff: extensions/shell/browser/api/shell/shell_api.cc

Issue 493453004: app_shell: Add audio and video capture support (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: (video-capture) rebase 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "extensions/shell/browser/api/shell/shell_api.h" 5 #include "extensions/shell/browser/api/shell/shell_api.h"
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "extensions/common/extension.h" 9 #include "extensions/common/extension.h"
10 #include "extensions/shell/browser/shell_app_window.h" 10 #include "extensions/shell/browser/shell_app_window.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 scoped_ptr<CreateWindow::Params> params(CreateWindow::Params::Create(*args_)); 42 scoped_ptr<CreateWindow::Params> params(CreateWindow::Params::Create(*args_));
43 EXTENSION_FUNCTION_VALIDATE(params.get()); 43 EXTENSION_FUNCTION_VALIDATE(params.get());
44 44
45 // Convert "main.html" to "chrome-extension:/<id>/main.html". 45 // Convert "main.html" to "chrome-extension:/<id>/main.html".
46 GURL url = extension()->GetResourceURL(params->url); 46 GURL url = extension()->GetResourceURL(params->url);
47 if (!url.is_valid()) 47 if (!url.is_valid())
48 return RespondNow(Error(kInvalidArguments)); 48 return RespondNow(Error(kInvalidArguments));
49 49
50 // The desktop keeps ownership of the window. 50 // The desktop keeps ownership of the window.
51 ShellAppWindow* app_window = 51 ShellAppWindow* app_window =
52 ShellDesktopController::instance()->CreateAppWindow(browser_context()); 52 ShellDesktopController::instance()->CreateAppWindow(browser_context(),
53 extension());
53 app_window->LoadURL(url); 54 app_window->LoadURL(url);
54 55
55 // Create the reply to send to the renderer. 56 // Create the reply to send to the renderer.
56 return RespondNow(OneArgument(CreateResult(app_window))); 57 return RespondNow(OneArgument(CreateResult(app_window)));
57 } 58 }
58 59
59 } // namespace extensions 60 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/shell/app_shell.gyp ('k') | extensions/shell/browser/default_shell_app_window_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698