Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / extensions / browser / app_window / app_delegate.h
blob158b4469ed31ddacf2ada259a21a59e5310fa6c8
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_BROWSER_APP_WINDOW_APP_DELEGATE_H_
6 #define EXTENSIONS_BROWSER_APP_WINDOW_APP_DELEGATE_H_
8 #include "base/callback_forward.h"
9 #include "content/public/common/media_stream_request.h"
10 #include "third_party/skia/include/core/SkColor.h"
11 #include "ui/base/window_open_disposition.h"
13 namespace content {
14 class BrowserContext;
15 class ColorChooser;
16 struct FileChooserParams;
17 struct OpenURLParams;
18 class RenderViewHost;
19 class WebContents;
22 namespace gfx {
23 class Rect;
24 class Size;
27 namespace extensions {
29 class Extension;
31 // Interface to give packaged apps access to services in the browser, for things
32 // like handling links and showing UI prompts to the user.
33 class AppDelegate {
34 public:
35 virtual ~AppDelegate() {}
37 // General initialization.
38 virtual void InitWebContents(content::WebContents* web_contents) = 0;
39 virtual void RenderViewCreated(content::RenderViewHost* render_view_host) = 0;
41 // Resizes WebContents.
42 virtual void ResizeWebContents(content::WebContents* web_contents,
43 const gfx::Size& size) = 0;
45 // Link handling.
46 virtual content::WebContents* OpenURLFromTab(
47 content::BrowserContext* context,
48 content::WebContents* source,
49 const content::OpenURLParams& params) = 0;
50 virtual void AddNewContents(content::BrowserContext* context,
51 content::WebContents* new_contents,
52 WindowOpenDisposition disposition,
53 const gfx::Rect& initial_rect,
54 bool user_gesture,
55 bool* was_blocked) = 0;
57 // Feature support.
58 virtual content::ColorChooser* ShowColorChooser(
59 content::WebContents* web_contents,
60 SkColor initial_color) = 0;
61 virtual void RunFileChooser(content::WebContents* tab,
62 const content::FileChooserParams& params) = 0;
63 virtual void RequestMediaAccessPermission(
64 content::WebContents* web_contents,
65 const content::MediaStreamRequest& request,
66 const content::MediaResponseCallback& callback,
67 const Extension* extension) = 0;
68 virtual bool CheckMediaAccessPermission(content::WebContents* web_contents,
69 const GURL& security_origin,
70 content::MediaStreamType type,
71 const Extension* extension) = 0;
72 virtual int PreferredIconSize() = 0;
74 // Web contents modal dialog support.
75 virtual void SetWebContentsBlocked(content::WebContents* web_contents,
76 bool blocked) = 0;
77 virtual bool IsWebContentsVisible(content::WebContents* web_contents) = 0;
79 // |callback| will be called when the process is about to terminate.
80 virtual void SetTerminatingCallback(const base::Closure& callback) = 0;
82 // Called when the app is hidden or shown.
83 virtual void OnHide() = 0;
84 virtual void OnShow() = 0;
87 } // namespace extensions
89 #endif // EXTENSIONS_BROWSER_APP_WINDOW_APP_DELEGATE_H_