OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_DELEGATE_H_ | 5 #ifndef EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_DELEGATE_H_ |
6 #define EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_DELEGATE_H_ | 6 #define EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_DELEGATE_H_ |
7 | 7 |
| 8 #include "base/callback.h" |
8 #include "extensions/browser/guest_view/guest_view_base.h" | 9 #include "extensions/browser/guest_view/guest_view_base.h" |
9 | 10 |
10 namespace content { | 11 namespace content { |
11 class RenderViewHost; | 12 class RenderViewHost; |
12 class WebContents; | 13 class WebContents; |
13 } // namespace content | 14 } // namespace content |
14 | 15 |
15 namespace extensions { | 16 namespace extensions { |
16 | 17 |
17 class WebViewGuest; | 18 class WebViewGuest; |
18 | 19 |
19 namespace api { | 20 namespace api { |
20 namespace web_view_internal { | 21 namespace web_view_internal { |
21 | 22 |
22 struct ContextMenuItem; | 23 struct ContextMenuItem; |
23 } // namespace web_view_internal | 24 } // namespace web_view_internal |
24 } // namespace api | 25 } // namespace api |
25 | 26 |
26 // A delegate class of WebViewGuest that are not a part of chrome. | 27 // A delegate class of WebViewGuest that are not a part of chrome. |
27 class WebViewGuestDelegate { | 28 class WebViewGuestDelegate { |
28 public : | 29 public : |
29 virtual ~WebViewGuestDelegate() {} | 30 virtual ~WebViewGuestDelegate() {} |
30 | 31 |
31 typedef std::vector<linked_ptr<api::web_view_internal::ContextMenuItem> > | 32 typedef std::vector<linked_ptr<api::web_view_internal::ContextMenuItem> > |
32 MenuItemVector; | 33 MenuItemVector; |
33 | 34 |
| 35 // Clears http cache for this guest's StoragePartition. |
| 36 virtual void ClearCache(base::Time remove_since, |
| 37 const base::Closure& callback) = 0; |
| 38 |
34 // Called when context menu operation was handled. | 39 // Called when context menu operation was handled. |
35 virtual bool HandleContextMenu(const content::ContextMenuParams& params) = 0; | 40 virtual bool HandleContextMenu(const content::ContextMenuParams& params) = 0; |
36 | 41 |
37 // Called to attach helpers just after additional initialization is performed. | 42 // Called to attach helpers just after additional initialization is performed. |
38 virtual void OnAttachWebViewHelpers(content::WebContents* contents) = 0; | 43 virtual void OnAttachWebViewHelpers(content::WebContents* contents) = 0; |
39 | 44 |
40 // Called when the guest WebContents commits a provisional load in any frame. | 45 // Called when the guest WebContents commits a provisional load in any frame. |
41 virtual void OnDidCommitProvisionalLoadForFrame(bool is_main_frame) = 0; | 46 virtual void OnDidCommitProvisionalLoadForFrame(bool is_main_frame) = 0; |
42 | 47 |
43 // Called just after additional initialization is performed. | 48 // Called just after additional initialization is performed. |
(...skipping 10 matching lines...) Expand all Loading... |
54 // menu items to contain only the items from |items|. | 59 // menu items to contain only the items from |items|. |
55 // |items| == NULL means no filtering will be applied. | 60 // |items| == NULL means no filtering will be applied. |
56 virtual void OnShowContextMenu( | 61 virtual void OnShowContextMenu( |
57 int request_id, | 62 int request_id, |
58 const MenuItemVector* items) = 0; | 63 const MenuItemVector* items) = 0; |
59 }; | 64 }; |
60 | 65 |
61 } // namespace extensions | 66 } // namespace extensions |
62 | 67 |
63 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_DELEGATE_H_ | 68 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_DELEGATE_H_ |
OLD | NEW |