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 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 virtual void RenderViewGone(base::TerminationStatus status) OVERRIDE; | 138 virtual void RenderViewGone(base::TerminationStatus status) OVERRIDE; |
139 virtual void DocumentAvailableInMainFrame() OVERRIDE; | 139 virtual void DocumentAvailableInMainFrame() OVERRIDE; |
140 virtual void DidStopLoading( | 140 virtual void DidStopLoading( |
141 content::RenderViewHost* render_view_host) OVERRIDE; | 141 content::RenderViewHost* render_view_host) OVERRIDE; |
142 | 142 |
143 // content::WebContentsDelegate | 143 // content::WebContentsDelegate |
144 virtual content::WebContents* OpenURLFromTab( | 144 virtual content::WebContents* OpenURLFromTab( |
145 content::WebContents* source, | 145 content::WebContents* source, |
146 const content::OpenURLParams& params) OVERRIDE; | 146 const content::OpenURLParams& params) OVERRIDE; |
147 virtual bool PreHandleKeyboardEvent( | 147 virtual bool PreHandleKeyboardEvent( |
| 148 content::WebContents* source, |
148 const content::NativeWebKeyboardEvent& event, | 149 const content::NativeWebKeyboardEvent& event, |
149 bool* is_keyboard_shortcut) OVERRIDE; | 150 bool* is_keyboard_shortcut) OVERRIDE; |
150 virtual void HandleKeyboardEvent( | 151 virtual void HandleKeyboardEvent( |
| 152 content::WebContents* source, |
151 const content::NativeWebKeyboardEvent& event) OVERRIDE; | 153 const content::NativeWebKeyboardEvent& event) OVERRIDE; |
152 virtual void ResizeDueToAutoResize(content::WebContents* source, | 154 virtual void ResizeDueToAutoResize(content::WebContents* source, |
153 const gfx::Size& new_size) OVERRIDE; | 155 const gfx::Size& new_size) OVERRIDE; |
154 virtual content::JavaScriptDialogCreator* | 156 virtual content::JavaScriptDialogCreator* |
155 GetJavaScriptDialogCreator() OVERRIDE; | 157 GetJavaScriptDialogCreator() OVERRIDE; |
156 virtual void RunFileChooser( | 158 virtual void RunFileChooser( |
157 content::WebContents* tab, | 159 content::WebContents* tab, |
158 const content::FileChooserParams& params) OVERRIDE; | 160 const content::FileChooserParams& params) OVERRIDE; |
159 virtual void AddNewContents(content::WebContents* source, | 161 virtual void AddNewContents(content::WebContents* source, |
160 content::WebContents* new_contents, | 162 content::WebContents* new_contents, |
(...skipping 28 matching lines...) Expand all Loading... |
189 // Message handlers. | 191 // Message handlers. |
190 void OnRequest(const ExtensionHostMsg_Request_Params& params); | 192 void OnRequest(const ExtensionHostMsg_Request_Params& params); |
191 void OnEventAck(); | 193 void OnEventAck(); |
192 void OnIncrementLazyKeepaliveCount(); | 194 void OnIncrementLazyKeepaliveCount(); |
193 void OnDecrementLazyKeepaliveCount(); | 195 void OnDecrementLazyKeepaliveCount(); |
194 | 196 |
195 // Handles keyboard events that were not handled by HandleKeyboardEvent(). | 197 // Handles keyboard events that were not handled by HandleKeyboardEvent(). |
196 // Platform specific implementation may override this method to handle the | 198 // Platform specific implementation may override this method to handle the |
197 // event in platform specific way. | 199 // event in platform specific way. |
198 virtual void UnhandledKeyboardEvent( | 200 virtual void UnhandledKeyboardEvent( |
| 201 content::WebContents* source, |
199 const content::NativeWebKeyboardEvent& event); | 202 const content::NativeWebKeyboardEvent& event); |
200 | 203 |
201 // Returns true if we're hosting a background page. | 204 // Returns true if we're hosting a background page. |
202 // This isn't valid until CreateRenderView is called. | 205 // This isn't valid until CreateRenderView is called. |
203 bool is_background_page() const { return !view(); } | 206 bool is_background_page() const { return !view(); } |
204 | 207 |
205 // The extension that we're hosting in this view. | 208 // The extension that we're hosting in this view. |
206 const Extension* extension_; | 209 const Extension* extension_; |
207 | 210 |
208 // Id of extension that we're hosting in this view. | 211 // Id of extension that we're hosting in this view. |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 | 254 |
252 // Used to measure how long it's been since the host was created. | 255 // Used to measure how long it's been since the host was created. |
253 PerfTimer since_created_; | 256 PerfTimer since_created_; |
254 | 257 |
255 DISALLOW_COPY_AND_ASSIGN(ExtensionHost); | 258 DISALLOW_COPY_AND_ASSIGN(ExtensionHost); |
256 }; | 259 }; |
257 | 260 |
258 } // namespace extensions | 261 } // namespace extensions |
259 | 262 |
260 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_HOST_H_ | 263 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_HOST_H_ |
OLD | NEW |