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
3 // found in the LICENSE file.
5 #ifndef EXTENSIONS_BROWSER_GUEST_VIEW_EXTENSION_OPTIONS_EXTENSION_OPTIONS_GUEST_H_
6 #define EXTENSIONS_BROWSER_GUEST_VIEW_EXTENSION_OPTIONS_EXTENSION_OPTIONS_GUEST_H_
8 #include "base/macros.h"
9 #include "components/guest_view/browser/guest_view.h"
10 #include "extensions/browser/guest_view/extension_options/extension_options_guest_delegate.h"
17 namespace extensions
{
19 class ExtensionOptionsGuest
20 : public guest_view::GuestView
<ExtensionOptionsGuest
> {
22 static const char Type
[];
23 static guest_view::GuestViewBase
* Create(
24 content::WebContents
* owner_web_contents
);
26 // GuestViewBase implementation.
27 bool CanRunInDetachedState() const override
;
28 void CreateWebContents(const base::DictionaryValue
& create_params
,
29 const WebContentsCreatedCallback
& callback
) override
;
30 void DidInitialize(const base::DictionaryValue
& create_params
) override
;
31 void GuestViewDidStopLoading() override
;
32 const char* GetAPINamespace() const override
;
33 int GetTaskPrefix() const override
;
34 bool IsPreferredSizeModeEnabled() const override
;
35 void OnPreferredSizeChanged(const gfx::Size
& pref_size
) override
;
37 // content::WebContentsDelegate implementation.
38 content::WebContents
* OpenURLFromTab(
39 content::WebContents
* source
,
40 const content::OpenURLParams
& params
) override
;
41 void CloseContents(content::WebContents
* source
) override
;
42 bool HandleContextMenu(const content::ContextMenuParams
& params
) override
;
43 bool ShouldCreateWebContents(
44 content::WebContents
* web_contents
,
46 int main_frame_route_id
,
47 WindowContainerType window_container_type
,
48 const std::string
& frame_name
,
49 const GURL
& target_url
,
50 const std::string
& partition_id
,
51 content::SessionStorageNamespace
* session_storage_namespace
) override
;
53 // content::WebContentsObserver implementation.
54 void DidNavigateMainFrame(
55 const content::LoadCommittedDetails
& details
,
56 const content::FrameNavigateParams
& params
) override
;
59 explicit ExtensionOptionsGuest(content::WebContents
* owner_web_contents
);
60 ~ExtensionOptionsGuest() override
;
62 scoped_ptr
<extensions::ExtensionOptionsGuestDelegate
>
63 extension_options_guest_delegate_
;
66 DISALLOW_COPY_AND_ASSIGN(ExtensionOptionsGuest
);
69 } // namespace extensions
71 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_EXTENSION_OPTIONS_EXTENSION_OPTIONS_GUEST_H_