| 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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 #endif | 85 #endif |
| 86 return view_.get(); | 86 return view_.get(); |
| 87 } | 87 } |
| 88 | 88 |
| 89 // Create an ExtensionView and tie it to this host and |browser|. Note NULL | 89 // Create an ExtensionView and tie it to this host and |browser|. Note NULL |
| 90 // is a valid argument for |browser|. Extension views may be bound to | 90 // is a valid argument for |browser|. Extension views may be bound to |
| 91 // tab-contents hosted in ExternalTabContainer objects, which do not | 91 // tab-contents hosted in ExternalTabContainer objects, which do not |
| 92 // instantiate Browser objects. | 92 // instantiate Browser objects. |
| 93 void CreateView(Browser* browser); | 93 void CreateView(Browser* browser); |
| 94 | 94 |
| 95 // Helper variant of the above for cases where no Browser is present. | |
| 96 void CreateViewWithoutBrowser(); | |
| 97 | |
| 98 const Extension* extension() const { return extension_; } | 95 const Extension* extension() const { return extension_; } |
| 99 const std::string& extension_id() const { return extension_id_; } | 96 const std::string& extension_id() const { return extension_id_; } |
| 100 content::WebContents* host_contents() const { return host_contents_.get(); } | 97 content::WebContents* host_contents() const { return host_contents_.get(); } |
| 101 content::RenderViewHost* render_view_host() const; | 98 content::RenderViewHost* render_view_host() const; |
| 102 content::RenderProcessHost* render_process_host() const; | 99 content::RenderProcessHost* render_process_host() const; |
| 103 bool did_stop_loading() const { return did_stop_loading_; } | 100 bool did_stop_loading() const { return did_stop_loading_; } |
| 104 bool document_element_available() const { | 101 bool document_element_available() const { |
| 105 return document_element_available_; | 102 return document_element_available_; |
| 106 } | 103 } |
| 107 | 104 |
| (...skipping 47 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 // The relevant WebContents associated with this ExtensionHost, if any. | 243 // The relevant WebContents associated with this ExtensionHost, if any. |
| 248 content::WebContents* associated_web_contents_; | 244 content::WebContents* associated_web_contents_; |
| 249 | 245 |
| 250 // Used to measure how long it's been since the host was created. | 246 // Used to measure how long it's been since the host was created. |
| 251 PerfTimer since_created_; | 247 PerfTimer since_created_; |
| 252 | 248 |
| 253 DISALLOW_COPY_AND_ASSIGN(ExtensionHost); | 249 DISALLOW_COPY_AND_ASSIGN(ExtensionHost); |
| 254 }; | 250 }; |
| 255 | 251 |
| 256 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_HOST_H_ | 252 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_HOST_H_ |
| OLD | NEW |