| OLD | NEW |
| (Empty) |
| 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 #ifndef APPS_APP_DELEGATE_H_ | |
| 6 #define APPS_APP_DELEGATE_H_ | |
| 7 | |
| 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" | |
| 11 #include "ui/gfx/image/image_skia.h" | |
| 12 | |
| 13 namespace content { | |
| 14 class BrowserContext; | |
| 15 class ColorChooser; | |
| 16 struct FileChooserParams; | |
| 17 struct OpenURLParams; | |
| 18 class WebContents; | |
| 19 } | |
| 20 | |
| 21 namespace extensions { | |
| 22 class Extension; | |
| 23 } | |
| 24 | |
| 25 namespace gfx { | |
| 26 class Rect; | |
| 27 } | |
| 28 | |
| 29 namespace apps { | |
| 30 | |
| 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() {} | |
| 36 | |
| 37 // General initialization. | |
| 38 virtual void InitWebContents(content::WebContents* web_contents) = 0; | |
| 39 | |
| 40 // Link handling. | |
| 41 virtual content::WebContents* OpenURLFromTab( | |
| 42 content::BrowserContext* context, | |
| 43 content::WebContents* source, | |
| 44 const content::OpenURLParams& params) = 0; | |
| 45 virtual void AddNewContents(content::BrowserContext* context, | |
| 46 content::WebContents* new_contents, | |
| 47 WindowOpenDisposition disposition, | |
| 48 const gfx::Rect& initial_pos, | |
| 49 bool user_gesture, | |
| 50 bool* was_blocked) = 0; | |
| 51 | |
| 52 // Feature support. | |
| 53 virtual content::ColorChooser* ShowColorChooser( | |
| 54 content::WebContents* web_contents, | |
| 55 SkColor initial_color) = 0; | |
| 56 virtual void RunFileChooser(content::WebContents* tab, | |
| 57 const content::FileChooserParams& params) = 0; | |
| 58 virtual void RequestMediaAccessPermission( | |
| 59 content::WebContents* web_contents, | |
| 60 const content::MediaStreamRequest& request, | |
| 61 const content::MediaResponseCallback& callback, | |
| 62 const extensions::Extension* extension) = 0; | |
| 63 virtual int PreferredIconSize() = 0; | |
| 64 virtual gfx::ImageSkia GetAppDefaultIcon() = 0; | |
| 65 | |
| 66 // Web contents modal dialog support. | |
| 67 virtual void SetWebContentsBlocked(content::WebContents* web_contents, | |
| 68 bool blocked) = 0; | |
| 69 virtual bool IsWebContentsVisible(content::WebContents* web_contents) = 0; | |
| 70 }; | |
| 71 | |
| 72 } // namespace apps | |
| 73 | |
| 74 #endif // APPS_APP_DELEGATE_H_ | |
| OLD | NEW |