| 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_EXTENSION_OPTIONS_EXTENSION_OPTIONS_GUEST_
H_ | 5 #ifndef EXTENSIONS_BROWSER_GUEST_VIEW_EXTENSION_OPTIONS_EXTENSION_OPTIONS_GUEST_
H_ |
| 6 #define EXTENSIONS_BROWSER_GUEST_VIEW_EXTENSION_OPTIONS_EXTENSION_OPTIONS_GUEST_
H_ | 6 #define EXTENSIONS_BROWSER_GUEST_VIEW_EXTENSION_OPTIONS_EXTENSION_OPTIONS_GUEST_
H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "components/guest_view/browser/guest_view.h" | 9 #include "components/guest_view/browser/guest_view.h" |
| 10 #include "extensions/browser/extension_function_dispatcher.h" | |
| 11 #include "extensions/browser/guest_view/extension_options/extension_options_gues
t_delegate.h" | 10 #include "extensions/browser/guest_view/extension_options/extension_options_gues
t_delegate.h" |
| 12 #include "url/gurl.h" | 11 #include "url/gurl.h" |
| 13 | 12 |
| 14 namespace content { | 13 namespace content { |
| 15 class BrowserContext; | 14 class BrowserContext; |
| 16 } | 15 } |
| 17 | 16 |
| 18 namespace extensions { | 17 namespace extensions { |
| 19 | 18 |
| 20 class ExtensionOptionsGuest | 19 class ExtensionOptionsGuest |
| 21 : public guest_view::GuestView<ExtensionOptionsGuest>, | 20 : public guest_view::GuestView<ExtensionOptionsGuest> { |
| 22 public extensions::ExtensionFunctionDispatcher::Delegate { | |
| 23 public: | 21 public: |
| 24 static const char Type[]; | 22 static const char Type[]; |
| 25 static guest_view::GuestViewBase* Create( | 23 static guest_view::GuestViewBase* Create( |
| 26 content::WebContents* owner_web_contents); | 24 content::WebContents* owner_web_contents); |
| 27 | 25 |
| 28 // GuestViewBase implementation. | 26 // GuestViewBase implementation. |
| 29 bool CanRunInDetachedState() const override; | 27 bool CanRunInDetachedState() const override; |
| 30 void CreateWebContents(const base::DictionaryValue& create_params, | 28 void CreateWebContents(const base::DictionaryValue& create_params, |
| 31 const WebContentsCreatedCallback& callback) override; | 29 const WebContentsCreatedCallback& callback) override; |
| 32 void DidInitialize(const base::DictionaryValue& create_params) override; | 30 void DidInitialize(const base::DictionaryValue& create_params) override; |
| 33 void GuestViewDidStopLoading() override; | 31 void GuestViewDidStopLoading() override; |
| 34 const char* GetAPINamespace() const override; | 32 const char* GetAPINamespace() const override; |
| 35 int GetTaskPrefix() const override; | 33 int GetTaskPrefix() const override; |
| 36 bool IsPreferredSizeModeEnabled() const override; | 34 bool IsPreferredSizeModeEnabled() const override; |
| 37 bool IsDragAndDropEnabled() const override; | 35 bool IsDragAndDropEnabled() const override; |
| 38 void OnPreferredSizeChanged(const gfx::Size& pref_size) override; | 36 void OnPreferredSizeChanged(const gfx::Size& pref_size) override; |
| 39 | 37 |
| 40 // ExtensionFunctionDispatcher::Delegate implementation. | |
| 41 content::WebContents* GetAssociatedWebContents() const override; | |
| 42 | |
| 43 // content::WebContentsDelegate implementation. | 38 // content::WebContentsDelegate implementation. |
| 44 content::WebContents* OpenURLFromTab( | 39 content::WebContents* OpenURLFromTab( |
| 45 content::WebContents* source, | 40 content::WebContents* source, |
| 46 const content::OpenURLParams& params) override; | 41 const content::OpenURLParams& params) override; |
| 47 void CloseContents(content::WebContents* source) override; | 42 void CloseContents(content::WebContents* source) override; |
| 48 bool HandleContextMenu(const content::ContextMenuParams& params) override; | 43 bool HandleContextMenu(const content::ContextMenuParams& params) override; |
| 49 bool ShouldCreateWebContents( | 44 bool ShouldCreateWebContents( |
| 50 content::WebContents* web_contents, | 45 content::WebContents* web_contents, |
| 51 int route_id, | 46 int route_id, |
| 52 int main_frame_route_id, | 47 int main_frame_route_id, |
| 53 WindowContainerType window_container_type, | 48 WindowContainerType window_container_type, |
| 54 const base::string16& frame_name, | 49 const base::string16& frame_name, |
| 55 const GURL& target_url, | 50 const GURL& target_url, |
| 56 const std::string& partition_id, | 51 const std::string& partition_id, |
| 57 content::SessionStorageNamespace* session_storage_namespace) override; | 52 content::SessionStorageNamespace* session_storage_namespace) override; |
| 58 | 53 |
| 59 // content::WebContentsObserver implementation. | 54 // content::WebContentsObserver implementation. |
| 60 void DidNavigateMainFrame( | 55 void DidNavigateMainFrame( |
| 61 const content::LoadCommittedDetails& details, | 56 const content::LoadCommittedDetails& details, |
| 62 const content::FrameNavigateParams& params) override; | 57 const content::FrameNavigateParams& params) override; |
| 63 bool OnMessageReceived(const IPC::Message& message) override; | |
| 64 | 58 |
| 65 private: | 59 private: |
| 66 explicit ExtensionOptionsGuest(content::WebContents* owner_web_contents); | 60 explicit ExtensionOptionsGuest(content::WebContents* owner_web_contents); |
| 67 ~ExtensionOptionsGuest() override; | 61 ~ExtensionOptionsGuest() override; |
| 68 void OnRequest(const ExtensionHostMsg_Request_Params& params); | |
| 69 | 62 |
| 70 scoped_ptr<extensions::ExtensionFunctionDispatcher> | |
| 71 extension_function_dispatcher_; | |
| 72 scoped_ptr<extensions::ExtensionOptionsGuestDelegate> | 63 scoped_ptr<extensions::ExtensionOptionsGuestDelegate> |
| 73 extension_options_guest_delegate_; | 64 extension_options_guest_delegate_; |
| 74 GURL options_page_; | 65 GURL options_page_; |
| 75 | 66 |
| 76 DISALLOW_COPY_AND_ASSIGN(ExtensionOptionsGuest); | 67 DISALLOW_COPY_AND_ASSIGN(ExtensionOptionsGuest); |
| 77 }; | 68 }; |
| 78 | 69 |
| 79 } // namespace extensions | 70 } // namespace extensions |
| 80 | 71 |
| 81 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_EXTENSION_OPTIONS_EXTENSION_OPTIONS_GUE
ST_H_ | 72 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_EXTENSION_OPTIONS_EXTENSION_OPTIONS_GUE
ST_H_ |
| OLD | NEW |