| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 OVERRIDE; | 151 OVERRIDE; |
| 155 virtual void RunFileChooser( | 152 virtual void RunFileChooser( |
| 156 content::WebContents* tab, | 153 content::WebContents* tab, |
| 157 const content::FileChooserParams& params) OVERRIDE; | 154 const content::FileChooserParams& params) OVERRIDE; |
| 158 virtual void AddNewContents(content::WebContents* source, | 155 virtual void AddNewContents(content::WebContents* source, |
| 159 content::WebContents* new_contents, | 156 content::WebContents* new_contents, |
| 160 WindowOpenDisposition disposition, | 157 WindowOpenDisposition disposition, |
| 161 const gfx::Rect& initial_pos, | 158 const gfx::Rect& initial_pos, |
| 162 bool user_gesture) OVERRIDE; | 159 bool user_gesture) OVERRIDE; |
| 163 virtual void CloseContents(content::WebContents* contents) OVERRIDE; | 160 virtual void CloseContents(content::WebContents* contents) OVERRIDE; |
| 164 virtual bool ShouldSuppressDialogs() OVERRIDE; | |
| 165 | 161 |
| 166 // content::NotificationObserver | 162 // content::NotificationObserver |
| 167 virtual void Observe(int type, | 163 virtual void Observe(int type, |
| 168 const content::NotificationSource& source, | 164 const content::NotificationSource& source, |
| 169 const content::NotificationDetails& details) OVERRIDE; | 165 const content::NotificationDetails& details) OVERRIDE; |
| 170 | 166 |
| 171 private: | 167 private: |
| 172 friend class ProcessCreationQueue; | 168 friend class ProcessCreationQueue; |
| 173 | 169 |
| 174 // Actually create the RenderView for this host. See CreateRenderViewSoon. | 170 // Actually create the RenderView for this host. See CreateRenderViewSoon. |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 // The relevant WebContents associated with this ExtensionHost, if any. | 244 // The relevant WebContents associated with this ExtensionHost, if any. |
| 249 content::WebContents* associated_web_contents_; | 245 content::WebContents* associated_web_contents_; |
| 250 | 246 |
| 251 // Used to measure how long it's been since the host was created. | 247 // Used to measure how long it's been since the host was created. |
| 252 PerfTimer since_created_; | 248 PerfTimer since_created_; |
| 253 | 249 |
| 254 DISALLOW_COPY_AND_ASSIGN(ExtensionHost); | 250 DISALLOW_COPY_AND_ASSIGN(ExtensionHost); |
| 255 }; | 251 }; |
| 256 | 252 |
| 257 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_HOST_H_ | 253 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_HOST_H_ |
| OLD | NEW |