| 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/extension_function_dispatcher.h" |
| 9 #include "extensions/browser/guest_view/guest_view.h" | 9 #include "extensions/browser/guest_view/guest_view.h" |
| 10 | 10 |
| 11 namespace content { |
| 12 class WebContents; |
| 13 } // namespace content |
| 14 |
| 11 namespace extensions { | 15 namespace extensions { |
| 12 | 16 |
| 13 class MimeHandlerViewGuestDelegate; | 17 class MimeHandlerViewGuestDelegate; |
| 14 | 18 |
| 15 class MimeHandlerViewGuest : public GuestView<MimeHandlerViewGuest>, | 19 class MimeHandlerViewGuest : public GuestView<MimeHandlerViewGuest>, |
| 16 public ExtensionFunctionDispatcher::Delegate { | 20 public ExtensionFunctionDispatcher::Delegate { |
| 17 public: | 21 public: |
| 18 static GuestViewBase* Create(content::BrowserContext* browser_context, | 22 static GuestViewBase* Create(content::BrowserContext* browser_context, |
| 19 int guest_instance_id); | 23 int guest_instance_id); |
| 20 | 24 |
| 21 static const char Type[]; | 25 static const char Type[]; |
| 22 | 26 |
| 23 // ExtensionFunctionDispatcher::Delegate implementation. | 27 // ExtensionFunctionDispatcher::Delegate implementation. |
| 24 virtual WindowController* GetExtensionWindowController() const override; | 28 virtual WindowController* GetExtensionWindowController() const override; |
| 25 virtual content::WebContents* GetAssociatedWebContents() const override; | 29 virtual content::WebContents* GetAssociatedWebContents() const override; |
| 26 | 30 |
| 27 // GuestViewBase implementation. | 31 // GuestViewBase implementation. |
| 28 virtual const char* GetAPINamespace() const override; | 32 virtual const char* GetAPINamespace() const override; |
| 29 virtual int GetTaskPrefix() const override; | 33 virtual int GetTaskPrefix() const override; |
| 30 virtual void CreateWebContents( | 34 virtual void CreateWebContents( |
| 31 const std::string& embedder_extension_id, | 35 const std::string& embedder_extension_id, |
| 32 int embedder_render_process_id, | 36 int embedder_render_process_id, |
| 33 const GURL& embedder_site_url, | 37 const GURL& embedder_site_url, |
| 34 const base::DictionaryValue& create_params, | 38 const base::DictionaryValue& create_params, |
| 35 const WebContentsCreatedCallback& callback) override; | 39 const WebContentsCreatedCallback& callback) override; |
| 36 virtual void DidAttachToEmbedder() override; | 40 virtual void DidAttachToEmbedder() override; |
| 37 virtual void DidInitialize() override; | 41 virtual void DidInitialize() override; |
| 38 | 42 |
| 43 // content::BrowserPluginGuestDelegate implementation |
| 44 virtual bool Find(int request_id, |
| 45 const base::string16& search_text, |
| 46 const blink::WebFindOptions& options, |
| 47 bool is_full_page_plugin) override; |
| 48 |
| 39 // WebContentsDelegate implementation. | 49 // WebContentsDelegate implementation. |
| 40 virtual void ContentsZoomChange(bool zoom_in) override; | 50 virtual void ContentsZoomChange(bool zoom_in) override; |
| 41 virtual void HandleKeyboardEvent( | 51 virtual void HandleKeyboardEvent( |
| 42 content::WebContents* source, | 52 content::WebContents* source, |
| 43 const content::NativeWebKeyboardEvent& event) override; | 53 const content::NativeWebKeyboardEvent& event) override; |
| 54 virtual void FindReply(content::WebContents* web_contents, |
| 55 int request_id, |
| 56 int number_of_matches, |
| 57 const gfx::Rect& selection_rect, |
| 58 int active_match_ordinal, |
| 59 bool final_update) override; |
| 44 | 60 |
| 45 // content::WebContentsObserver implementation. | 61 // content::WebContentsObserver implementation. |
| 46 virtual bool OnMessageReceived(const IPC::Message& message) override; | 62 virtual bool OnMessageReceived(const IPC::Message& message) override; |
| 47 | 63 |
| 48 private: | 64 private: |
| 49 MimeHandlerViewGuest(content::BrowserContext* browser_context, | 65 MimeHandlerViewGuest(content::BrowserContext* browser_context, |
| 50 int guest_instance_id); | 66 int guest_instance_id); |
| 51 virtual ~MimeHandlerViewGuest(); | 67 virtual ~MimeHandlerViewGuest(); |
| 52 | 68 |
| 53 void OnRequest(const ExtensionHostMsg_Request_Params& params); | 69 void OnRequest(const ExtensionHostMsg_Request_Params& params); |
| 54 | 70 |
| 55 scoped_ptr<MimeHandlerViewGuestDelegate> delegate_; | 71 scoped_ptr<MimeHandlerViewGuestDelegate> delegate_; |
| 56 scoped_ptr<ExtensionFunctionDispatcher> extension_function_dispatcher_; | 72 scoped_ptr<ExtensionFunctionDispatcher> extension_function_dispatcher_; |
| 57 | 73 |
| 58 DISALLOW_COPY_AND_ASSIGN(MimeHandlerViewGuest); | 74 DISALLOW_COPY_AND_ASSIGN(MimeHandlerViewGuest); |
| 59 }; | 75 }; |
| 60 | 76 |
| 61 } // namespace extensions | 77 } // namespace extensions |
| 62 | 78 |
| 63 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_MIME_HANDLER_VIEW_MIME_HANDLER_VIEW_GUE
ST_H_ | 79 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_MIME_HANDLER_VIEW_MIME_HANDLER_VIEW_GUE
ST_H_ |
| OLD | NEW |