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 APPS_APP_DELEGATE_H_
6 #define APPS_APP_DELEGATE_H_
8 #include "content/public/common/media_stream_request.h"
9 #include "third_party/skia/include/core/SkColor.h"
10 #include "ui/base/window_open_disposition.h"
15 struct FileChooserParams
;
20 namespace extensions
{
30 // Interface to give packaged apps access to services in the browser, for things
31 // like handling links and showing UI prompts to the user.
34 virtual ~AppDelegate() {}
36 // General initialization.
37 virtual void InitWebContents(content::WebContents
* web_contents
) = 0;
40 virtual content::WebContents
* OpenURLFromTab(
41 content::BrowserContext
* context
,
42 content::WebContents
* source
,
43 const content::OpenURLParams
& params
) = 0;
44 virtual void AddNewContents(content::BrowserContext
* context
,
45 content::WebContents
* new_contents
,
46 WindowOpenDisposition disposition
,
47 const gfx::Rect
& initial_pos
,
49 bool* was_blocked
) = 0;
52 virtual content::ColorChooser
* ShowColorChooser(
53 content::WebContents
* web_contents
,
54 SkColor initial_color
) = 0;
55 virtual void RunFileChooser(content::WebContents
* tab
,
56 const content::FileChooserParams
& params
) = 0;
57 virtual void RequestMediaAccessPermission(
58 content::WebContents
* web_contents
,
59 const content::MediaStreamRequest
& request
,
60 const content::MediaResponseCallback
& callback
,
61 const extensions::Extension
* extension
) = 0;
62 virtual int PreferredIconSize() = 0;
64 // Web contents modal dialog support.
65 virtual void SetWebContentsBlocked(content::WebContents
* web_contents
,
67 virtual bool IsWebContentsVisible(content::WebContents
* web_contents
) = 0;
72 #endif // APPS_APP_DELEGATE_H_