OLD | NEW |
| (Empty) |
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. | |
4 | |
5 #ifndef CHROME_BROWSER_GUEST_VIEW_EXTENSION_OPTIONS_EXTENSION_OPTIONS_GUEST_H_ | |
6 #define CHROME_BROWSER_GUEST_VIEW_EXTENSION_OPTIONS_EXTENSION_OPTIONS_GUEST_H_ | |
7 | |
8 #include "base/macros.h" | |
9 #include "extensions/browser/extension_function_dispatcher.h" | |
10 #include "extensions/browser/guest_view/guest_view.h" | |
11 #include "url/gurl.h" | |
12 | |
13 namespace content { | |
14 class BrowserContext; | |
15 } | |
16 | |
17 class ExtensionOptionsGuest | |
18 : public extensions::GuestView<ExtensionOptionsGuest>, | |
19 public extensions::ExtensionFunctionDispatcher::Delegate { | |
20 public: | |
21 static const char Type[]; | |
22 static extensions::GuestViewBase* Create( | |
23 content::BrowserContext* browser_context, int guest_instance_id); | |
24 | |
25 // GuestViewBase implementation. | |
26 virtual void CreateWebContents( | |
27 const std::string& embedder_extension_id, | |
28 int embedder_render_process_id, | |
29 const base::DictionaryValue& create_params, | |
30 const WebContentsCreatedCallback& callback) OVERRIDE; | |
31 virtual void DidAttachToEmbedder() OVERRIDE; | |
32 virtual void DidInitialize() OVERRIDE; | |
33 virtual void DidStopLoading() OVERRIDE; | |
34 virtual const char* GetAPINamespace() const OVERRIDE; | |
35 virtual int GetTaskPrefix() const OVERRIDE; | |
36 virtual void GuestSizeChangedDueToAutoSize( | |
37 const gfx::Size& old_size, | |
38 const gfx::Size& new_size) OVERRIDE; | |
39 virtual bool IsAutoSizeSupported() const OVERRIDE; | |
40 | |
41 // ExtensionFunctionDispatcher::Delegate implementation. | |
42 virtual content::WebContents* GetAssociatedWebContents() const OVERRIDE; | |
43 | |
44 // content::WebContentsDelegate implementation. | |
45 virtual content::WebContents* OpenURLFromTab( | |
46 content::WebContents* source, | |
47 const content::OpenURLParams& params) OVERRIDE; | |
48 virtual void CloseContents(content::WebContents* source) OVERRIDE; | |
49 virtual bool HandleContextMenu( | |
50 const content::ContextMenuParams& params) OVERRIDE; | |
51 virtual bool ShouldCreateWebContents( | |
52 content::WebContents* web_contents, | |
53 int route_id, | |
54 WindowContainerType window_container_type, | |
55 const base::string16& frame_name, | |
56 const GURL& target_url, | |
57 const std::string& partition_id, | |
58 content::SessionStorageNamespace* session_storage_namespace) OVERRIDE; | |
59 | |
60 // content::WebContentsObserver implementation. | |
61 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | |
62 | |
63 private: | |
64 ExtensionOptionsGuest(content::BrowserContext* browser_context, | |
65 int guest_instance_id); | |
66 virtual ~ExtensionOptionsGuest(); | |
67 void OnRequest(const ExtensionHostMsg_Request_Params& params); | |
68 void SetUpAutoSize(); | |
69 | |
70 scoped_ptr<extensions::ExtensionFunctionDispatcher> | |
71 extension_function_dispatcher_; | |
72 GURL options_page_; | |
73 | |
74 DISALLOW_COPY_AND_ASSIGN(ExtensionOptionsGuest); | |
75 }; | |
76 | |
77 #endif // CHROME_BROWSER_GUEST_VIEW_EXTENSION_OPTIONS_EXTENSION_OPTIONS_GUEST_H
_ | |
OLD | NEW |