• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
10 namespace extensions {
11 
ShellAppDelegate()12 ShellAppDelegate::ShellAppDelegate() {
13 }
14 
~ShellAppDelegate()15 ShellAppDelegate::~ShellAppDelegate() {
16 }
17 
InitWebContents(content::WebContents * web_contents)18 void ShellAppDelegate::InitWebContents(content::WebContents* web_contents) {
19 }
20 
ResizeWebContents(content::WebContents * web_contents,const gfx::Size & size)21 void ShellAppDelegate::ResizeWebContents(content::WebContents* web_contents,
22                                          const gfx::Size& size) {
23   NOTIMPLEMENTED();
24 }
25 
OpenURLFromTab(content::BrowserContext * context,content::WebContents * source,const content::OpenURLParams & params)26 content::WebContents* ShellAppDelegate::OpenURLFromTab(
27     content::BrowserContext* context,
28     content::WebContents* source,
29     const content::OpenURLParams& params) {
30   NOTIMPLEMENTED();
31   return NULL;
32 }
33 
AddNewContents(content::BrowserContext * context,content::WebContents * new_contents,WindowOpenDisposition disposition,const gfx::Rect & initial_pos,bool user_gesture,bool * was_blocked)34 void 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 
ShowColorChooser(content::WebContents * web_contents,SkColor initial_color)43 content::ColorChooser* ShellAppDelegate::ShowColorChooser(
44     content::WebContents* web_contents,
45     SkColor initial_color) {
46   NOTIMPLEMENTED();
47   return NULL;
48 }
49 
RunFileChooser(content::WebContents * tab,const content::FileChooserParams & params)50 void ShellAppDelegate::RunFileChooser(
51     content::WebContents* tab,
52     const content::FileChooserParams& params) {
53   NOTIMPLEMENTED();
54 }
55 
RequestMediaAccessPermission(content::WebContents * web_contents,const content::MediaStreamRequest & request,const content::MediaResponseCallback & callback,const extensions::Extension * extension)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);
63 }
64 
CheckMediaAccessPermission(content::WebContents * web_contents,const GURL & security_origin,content::MediaStreamType type,const Extension * 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);
71   return true;
72 }
73 
PreferredIconSize()74 int ShellAppDelegate::PreferredIconSize() {
75   return extension_misc::EXTENSION_ICON_SMALL;
76 }
77 
SetWebContentsBlocked(content::WebContents * web_contents,bool blocked)78 void ShellAppDelegate::SetWebContentsBlocked(
79     content::WebContents* web_contents,
80     bool blocked) {
81   NOTIMPLEMENTED();
82 }
83 
IsWebContentsVisible(content::WebContents * web_contents)84 bool ShellAppDelegate::IsWebContentsVisible(
85     content::WebContents* web_contents) {
86   return true;
87 }
88 
SetTerminatingCallback(const base::Closure & callback)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?
92   NOTIMPLEMENTED();
93 }
94 
95 }  // namespace extensions
96