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 #ifndef EXTENSIONS_SHELL_BROWSER_SHELL_APP_DELEGATE_H_
6 #define EXTENSIONS_SHELL_BROWSER_SHELL_APP_DELEGATE_H_
8 #include "extensions/browser/app_window/app_delegate.h"
9 #include "content/public/browser/web_contents_observer.h"
11 namespace extensions
{
13 // AppDelegate implementation for app_shell. Sets focus after the WebContents is
14 // created. Ignores most operations that would create a new dialog or window.
15 class ShellAppDelegate
: public AppDelegate
{
18 ~ShellAppDelegate() override
;
20 // AppDelegate overrides:
21 void InitWebContents(content::WebContents
* web_contents
) override
;
22 void RenderViewCreated(content::RenderViewHost
* render_view_host
) override
;
23 void ResizeWebContents(content::WebContents
* web_contents
,
24 const gfx::Size
& size
) override
;
25 content::WebContents
* OpenURLFromTab(
26 content::BrowserContext
* context
,
27 content::WebContents
* source
,
28 const content::OpenURLParams
& params
) override
;
29 void AddNewContents(content::BrowserContext
* context
,
30 content::WebContents
* new_contents
,
31 WindowOpenDisposition disposition
,
32 const gfx::Rect
& initial_rect
,
34 bool* was_blocked
) override
;
35 content::ColorChooser
* ShowColorChooser(content::WebContents
* web_contents
,
36 SkColor initial_color
) override
;
37 void RunFileChooser(content::WebContents
* tab
,
38 const content::FileChooserParams
& params
) override
;
39 void RequestMediaAccessPermission(
40 content::WebContents
* web_contents
,
41 const content::MediaStreamRequest
& request
,
42 const content::MediaResponseCallback
& callback
,
43 const Extension
* extension
) override
;
44 bool CheckMediaAccessPermission(content::WebContents
* web_contents
,
45 const GURL
& security_origin
,
46 content::MediaStreamType type
,
47 const Extension
* extension
) override
;
48 int PreferredIconSize() override
;
49 void SetWebContentsBlocked(content::WebContents
* web_contents
,
50 bool blocked
) override
;
51 bool IsWebContentsVisible(content::WebContents
* web_contents
) override
;
52 void SetTerminatingCallback(const base::Closure
& callback
) override
;
53 void OnHide() override
{}
54 void OnShow() override
{}
57 DISALLOW_COPY_AND_ASSIGN(ShellAppDelegate
);
60 } // namespace extensions
62 #endif // EXTENSIONS_SHELL_BROWSER_SHELL_APP_DELEGATE_H_