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_MIME_HANDLER_VIEW_MIME_HANDLER_VIEW_GUEST_
H_ | 5 #ifndef EXTENSIONS_BROWSER_GUEST_VIEW_MIME_HANDLER_VIEW_MIME_HANDLER_VIEW_GUEST_
H_ |
6 #define EXTENSIONS_BROWSER_GUEST_VIEW_MIME_HANDLER_VIEW_MIME_HANDLER_VIEW_GUEST_
H_ | 6 #define EXTENSIONS_BROWSER_GUEST_VIEW_MIME_HANDLER_VIEW_MIME_HANDLER_VIEW_GUEST_
H_ |
7 | 7 |
| 8 #include "extensions/browser/extension_function_dispatcher.h" |
8 #include "extensions/browser/guest_view/guest_view.h" | 9 #include "extensions/browser/guest_view/guest_view.h" |
9 | 10 |
10 namespace extensions { | 11 namespace extensions { |
11 | 12 |
12 class MimeHandlerViewGuestDelegate; | 13 class MimeHandlerViewGuestDelegate; |
13 | 14 |
14 class MimeHandlerViewGuest : public GuestView<MimeHandlerViewGuest> { | 15 class MimeHandlerViewGuest : public GuestView<MimeHandlerViewGuest>, |
| 16 public ExtensionFunctionDispatcher::Delegate { |
15 public: | 17 public: |
16 static GuestViewBase* Create(content::BrowserContext* browser_context, | 18 static GuestViewBase* Create(content::BrowserContext* browser_context, |
17 int guest_instance_id); | 19 int guest_instance_id); |
18 | 20 |
19 static const char Type[]; | 21 static const char Type[]; |
20 | 22 |
| 23 // ExtensionFunctionDispatcher::Delegate implementation. |
| 24 virtual WindowController* GetExtensionWindowController() const OVERRIDE; |
| 25 virtual content::WebContents* GetAssociatedWebContents() const OVERRIDE; |
| 26 |
21 // GuestViewBase implementation. | 27 // GuestViewBase implementation. |
22 virtual const char* GetAPINamespace() const OVERRIDE; | 28 virtual const char* GetAPINamespace() const OVERRIDE; |
23 virtual int GetTaskPrefix() const OVERRIDE; | 29 virtual int GetTaskPrefix() const OVERRIDE; |
24 virtual void CreateWebContents( | 30 virtual void CreateWebContents( |
25 const std::string& embedder_extension_id, | 31 const std::string& embedder_extension_id, |
26 int embedder_render_process_id, | 32 int embedder_render_process_id, |
27 const base::DictionaryValue& create_params, | 33 const base::DictionaryValue& create_params, |
28 const WebContentsCreatedCallback& callback) OVERRIDE; | 34 const WebContentsCreatedCallback& callback) OVERRIDE; |
29 virtual void DidAttachToEmbedder() OVERRIDE; | 35 virtual void DidAttachToEmbedder() OVERRIDE; |
30 virtual void DidInitialize() OVERRIDE; | 36 virtual void DidInitialize() OVERRIDE; |
31 | 37 |
32 // WebContentsDelegate implementation. | 38 // WebContentsDelegate implementation. |
33 virtual void HandleKeyboardEvent( | 39 virtual void HandleKeyboardEvent( |
34 content::WebContents* source, | 40 content::WebContents* source, |
35 const content::NativeWebKeyboardEvent& event) OVERRIDE; | 41 const content::NativeWebKeyboardEvent& event) OVERRIDE; |
36 | 42 |
| 43 // content::WebContentsObserver implementation. |
| 44 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 45 |
37 private: | 46 private: |
38 MimeHandlerViewGuest(content::BrowserContext* browser_context, | 47 MimeHandlerViewGuest(content::BrowserContext* browser_context, |
39 int guest_instance_id); | 48 int guest_instance_id); |
40 virtual ~MimeHandlerViewGuest(); | 49 virtual ~MimeHandlerViewGuest(); |
41 | 50 |
| 51 void OnRequest(const ExtensionHostMsg_Request_Params& params); |
| 52 |
42 scoped_ptr<MimeHandlerViewGuestDelegate> delegate_; | 53 scoped_ptr<MimeHandlerViewGuestDelegate> delegate_; |
| 54 scoped_ptr<ExtensionFunctionDispatcher> extension_function_dispatcher_; |
43 | 55 |
44 DISALLOW_COPY_AND_ASSIGN(MimeHandlerViewGuest); | 56 DISALLOW_COPY_AND_ASSIGN(MimeHandlerViewGuest); |
45 }; | 57 }; |
46 | 58 |
47 } // namespace extensions | 59 } // namespace extensions |
48 | 60 |
49 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_MIME_HANDLER_VIEW_MIME_HANDLER_VIEW_GUE
ST_H_ | 61 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_MIME_HANDLER_VIEW_MIME_HANDLER_VIEW_GUE
ST_H_ |
OLD | NEW |