| 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 CHROME_BROWSER_GUEST_VIEW_WEB_VIEW_CHROME_WEB_VIEW_GUEST_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_GUEST_VIEW_WEB_VIEW_CHROME_WEB_VIEW_GUEST_DELEGATE_H_ |
| 6 #define CHROME_BROWSER_GUEST_VIEW_WEB_VIEW_CHROME_WEB_VIEW_GUEST_DELEGATE_H_ | 6 #define CHROME_BROWSER_GUEST_VIEW_WEB_VIEW_CHROME_WEB_VIEW_GUEST_DELEGATE_H_ |
| 7 | 7 |
| 8 #include "chrome/browser/extensions/api/web_view/chrome_web_view_internal_api.h" | 8 #include "chrome/browser/extensions/api/web_view/chrome_web_view_internal_api.h" |
| 9 #include "extensions/browser/guest_view/web_view/web_view_guest.h" | 9 #include "extensions/browser/guest_view/web_view/web_view_guest.h" |
| 10 #include "extensions/browser/guest_view/web_view/web_view_guest_delegate.h" | 10 #include "extensions/browser/guest_view/web_view/web_view_guest_delegate.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 namespace extensions { | 22 namespace extensions { |
| 23 | 23 |
| 24 class ChromeWebViewGuestDelegate : public WebViewGuestDelegate { | 24 class ChromeWebViewGuestDelegate : public WebViewGuestDelegate { |
| 25 public : | 25 public : |
| 26 explicit ChromeWebViewGuestDelegate(WebViewGuest* web_view_guest); | 26 explicit ChromeWebViewGuestDelegate(WebViewGuest* web_view_guest); |
| 27 ~ChromeWebViewGuestDelegate() override; | 27 ~ChromeWebViewGuestDelegate() override; |
| 28 | 28 |
| 29 // WebViewGuestDelegate implementation. | 29 // WebViewGuestDelegate implementation. |
| 30 bool HandleContextMenu(const content::ContextMenuParams& params) override; | 30 bool HandleContextMenu(const content::ContextMenuParams& params) override; |
| 31 void OnDidInitialize() override; | 31 void OnDidInitialize() override; |
| 32 void OnGuestDestroyed() override; | 32 void OnGuestDestroyed() override {} |
| 33 void OnShowContextMenu(int request_id, const MenuItemVector* items) override; | 33 void OnShowContextMenu(int request_id, const MenuItemVector* items) override; |
| 34 | 34 |
| 35 WebViewGuest* web_view_guest() const { return web_view_guest_; } | 35 WebViewGuest* web_view_guest() const { return web_view_guest_; } |
| 36 | 36 |
| 37 private: | 37 private: |
| 38 content::WebContents* guest_web_contents() const { | 38 content::WebContents* guest_web_contents() const { |
| 39 return web_view_guest()->web_contents(); | 39 return web_view_guest()->web_contents(); |
| 40 } | 40 } |
| 41 | 41 |
| 42 // Returns the top level items (ignoring submenus) as Value. | 42 // Returns the top level items (ignoring submenus) as Value. |
| (...skipping 30 matching lines...) Expand all Loading... |
| 73 // This is used to ensure pending tasks will not fire after this object is | 73 // This is used to ensure pending tasks will not fire after this object is |
| 74 // destroyed. | 74 // destroyed. |
| 75 base::WeakPtrFactory<ChromeWebViewGuestDelegate> weak_ptr_factory_; | 75 base::WeakPtrFactory<ChromeWebViewGuestDelegate> weak_ptr_factory_; |
| 76 | 76 |
| 77 DISALLOW_COPY_AND_ASSIGN(ChromeWebViewGuestDelegate); | 77 DISALLOW_COPY_AND_ASSIGN(ChromeWebViewGuestDelegate); |
| 78 }; | 78 }; |
| 79 | 79 |
| 80 } // namespace extensions | 80 } // namespace extensions |
| 81 | 81 |
| 82 #endif // CHROME_BROWSER_GUEST_VIEW_WEB_VIEW_CHROME_WEB_VIEW_GUEST_DELEGATE_H_ | 82 #endif // CHROME_BROWSER_GUEST_VIEW_WEB_VIEW_CHROME_WEB_VIEW_GUEST_DELEGATE_H_ |
| 83 | |
| OLD | NEW |