OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CHROME_BROWSER_EXTENSIONS_EXTENSION_HOST_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_HOST_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_HOST_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_HOST_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 #endif | 84 #endif |
85 return view_.get(); | 85 return view_.get(); |
86 } | 86 } |
87 | 87 |
88 // Create an ExtensionView and tie it to this host and |browser|. Note NULL | 88 // Create an ExtensionView and tie it to this host and |browser|. Note NULL |
89 // is a valid argument for |browser|. Extension views may be bound to | 89 // is a valid argument for |browser|. Extension views may be bound to |
90 // tab-contents hosted in ExternalTabContainer objects, which do not | 90 // tab-contents hosted in ExternalTabContainer objects, which do not |
91 // instantiate Browser objects. | 91 // instantiate Browser objects. |
92 void CreateView(Browser* browser); | 92 void CreateView(Browser* browser); |
93 | 93 |
94 // Helper variant of the above for cases where no Browser is present. | |
95 void CreateViewWithoutBrowser(); | |
96 | |
97 const Extension* extension() const { return extension_; } | 94 const Extension* extension() const { return extension_; } |
98 const std::string& extension_id() const { return extension_id_; } | 95 const std::string& extension_id() const { return extension_id_; } |
99 content::WebContents* host_contents() const { return host_contents_.get(); } | 96 content::WebContents* host_contents() const { return host_contents_.get(); } |
100 content::RenderViewHost* render_view_host() const; | 97 content::RenderViewHost* render_view_host() const; |
101 content::RenderProcessHost* render_process_host() const; | 98 content::RenderProcessHost* render_process_host() const; |
102 bool did_stop_loading() const { return did_stop_loading_; } | 99 bool did_stop_loading() const { return did_stop_loading_; } |
103 bool document_element_available() const { | 100 bool document_element_available() const { |
104 return document_element_available_; | 101 return document_element_available_; |
105 } | 102 } |
106 | 103 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 OVERRIDE; | 152 OVERRIDE; |
156 virtual void RunFileChooser( | 153 virtual void RunFileChooser( |
157 content::WebContents* tab, | 154 content::WebContents* tab, |
158 const content::FileChooserParams& params) OVERRIDE; | 155 const content::FileChooserParams& params) OVERRIDE; |
159 virtual void AddNewContents(content::WebContents* source, | 156 virtual void AddNewContents(content::WebContents* source, |
160 content::WebContents* new_contents, | 157 content::WebContents* new_contents, |
161 WindowOpenDisposition disposition, | 158 WindowOpenDisposition disposition, |
162 const gfx::Rect& initial_pos, | 159 const gfx::Rect& initial_pos, |
163 bool user_gesture) OVERRIDE; | 160 bool user_gesture) OVERRIDE; |
164 virtual void CloseContents(content::WebContents* contents) OVERRIDE; | 161 virtual void CloseContents(content::WebContents* contents) OVERRIDE; |
165 virtual bool ShouldSuppressDialogs() OVERRIDE; | |
166 | 162 |
167 // content::NotificationObserver | 163 // content::NotificationObserver |
168 virtual void Observe(int type, | 164 virtual void Observe(int type, |
169 const content::NotificationSource& source, | 165 const content::NotificationSource& source, |
170 const content::NotificationDetails& details) OVERRIDE; | 166 const content::NotificationDetails& details) OVERRIDE; |
171 | 167 |
172 private: | 168 private: |
173 friend class ProcessCreationQueue; | 169 friend class ProcessCreationQueue; |
174 | 170 |
175 // Actually create the RenderView for this host. See CreateRenderViewSoon. | 171 // Actually create the RenderView for this host. See CreateRenderViewSoon. |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 // The relevant WebContents associated with this ExtensionHost, if any. | 242 // The relevant WebContents associated with this ExtensionHost, if any. |
247 content::WebContents* associated_web_contents_; | 243 content::WebContents* associated_web_contents_; |
248 | 244 |
249 // Used to measure how long it's been since the host was created. | 245 // Used to measure how long it's been since the host was created. |
250 PerfTimer since_created_; | 246 PerfTimer since_created_; |
251 | 247 |
252 DISALLOW_COPY_AND_ASSIGN(ExtensionHost); | 248 DISALLOW_COPY_AND_ASSIGN(ExtensionHost); |
253 }; | 249 }; |
254 | 250 |
255 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_HOST_H_ | 251 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_HOST_H_ |
OLD | NEW |