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
3 // found in the LICENSE file.
5 #include "extensions/shell/browser/shell_app_delegate.h"
7 #include "extensions/common/constants.h"
8 #include "extensions/shell/browser/media_capture_util.h"
10 namespace extensions
{
12 ShellAppDelegate::ShellAppDelegate() {
15 ShellAppDelegate::~ShellAppDelegate() {
18 void ShellAppDelegate::InitWebContents(content::WebContents
* web_contents
) {
21 void ShellAppDelegate::ResizeWebContents(content::WebContents
* web_contents
,
22 const gfx::Size
& size
) {
26 content::WebContents
* ShellAppDelegate::OpenURLFromTab(
27 content::BrowserContext
* context
,
28 content::WebContents
* source
,
29 const content::OpenURLParams
& params
) {
34 void ShellAppDelegate::AddNewContents(content::BrowserContext
* context
,
35 content::WebContents
* new_contents
,
36 WindowOpenDisposition disposition
,
37 const gfx::Rect
& initial_pos
,
43 content::ColorChooser
* ShellAppDelegate::ShowColorChooser(
44 content::WebContents
* web_contents
,
45 SkColor initial_color
) {
50 void ShellAppDelegate::RunFileChooser(
51 content::WebContents
* tab
,
52 const content::FileChooserParams
& params
) {
56 void ShellAppDelegate::RequestMediaAccessPermission(
57 content::WebContents
* web_contents
,
58 const content::MediaStreamRequest
& request
,
59 const content::MediaResponseCallback
& callback
,
60 const extensions::Extension
* extension
) {
61 media_capture_util::GrantMediaStreamRequest(
62 web_contents
, request
, callback
, extension
);
65 bool ShellAppDelegate::CheckMediaAccessPermission(
66 content::WebContents
* web_contents
,
67 const GURL
& security_origin
,
68 content::MediaStreamType type
,
69 const Extension
* extension
) {
70 media_capture_util::VerifyMediaAccessPermission(type
, extension
);
74 int ShellAppDelegate::PreferredIconSize() {
75 return extension_misc::EXTENSION_ICON_SMALL
;
78 void ShellAppDelegate::SetWebContentsBlocked(
79 content::WebContents
* web_contents
,
84 bool ShellAppDelegate::IsWebContentsVisible(
85 content::WebContents
* web_contents
) {
89 void ShellAppDelegate::SetTerminatingCallback(const base::Closure
& callback
) {
90 // TODO(jamescook): Should app_shell continue to close the app window
91 // manually or should it use a browser termination callback like Chrome?
95 } // namespace extensions