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.
4
5#include "extensions/shell/browser/shell_app_delegate.h"
6
7#include "extensions/common/constants.h"
8#include "extensions/shell/browser/media_capture_util.h"
9
10namespace extensions {
11
12ShellAppDelegate::ShellAppDelegate() {
13}
14
15ShellAppDelegate::~ShellAppDelegate() {
16}
17
18void ShellAppDelegate::InitWebContents(content::WebContents* web_contents) {
19}
20
21void ShellAppDelegate::ResizeWebContents(content::WebContents* web_contents,
22                                         const gfx::Size& size) {
23  NOTIMPLEMENTED();
24}
25
26content::WebContents* ShellAppDelegate::OpenURLFromTab(
27    content::BrowserContext* context,
28    content::WebContents* source,
29    const content::OpenURLParams& params) {
30  NOTIMPLEMENTED();
31  return NULL;
32}
33
34void ShellAppDelegate::AddNewContents(content::BrowserContext* context,
35                                      content::WebContents* new_contents,
36                                      WindowOpenDisposition disposition,
37                                      const gfx::Rect& initial_pos,
38                                      bool user_gesture,
39                                      bool* was_blocked) {
40  NOTIMPLEMENTED();
41}
42
43content::ColorChooser* ShellAppDelegate::ShowColorChooser(
44    content::WebContents* web_contents,
45    SkColor initial_color) {
46  NOTIMPLEMENTED();
47  return NULL;
48}
49
50void ShellAppDelegate::RunFileChooser(
51    content::WebContents* tab,
52    const content::FileChooserParams& params) {
53  NOTIMPLEMENTED();
54}
55
56void 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);
63}
64
65bool 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);
71  return true;
72}
73
74int ShellAppDelegate::PreferredIconSize() {
75  return extension_misc::EXTENSION_ICON_SMALL;
76}
77
78void ShellAppDelegate::SetWebContentsBlocked(
79    content::WebContents* web_contents,
80    bool blocked) {
81  NOTIMPLEMENTED();
82}
83
84bool ShellAppDelegate::IsWebContentsVisible(
85    content::WebContents* web_contents) {
86  return true;
87}
88
89void 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?
92  NOTIMPLEMENTED();
93}
94
95}  // namespace extensions
96