OLD | NEW |
---|---|
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_RENDERER_HOST_RENDER_VIEW_HOST_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_DELEGATE_H_ |
6 #define CHROME_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_DELEGATE_H_ | 6 #define CHROME_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_DELEGATE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/file_path.h" | 12 #include "base/string16.h" |
13 #include "base/gfx/rect.h" | |
14 #include "base/logging.h" | |
15 #include "chrome/common/native_web_keyboard_event.h" | |
16 #include "chrome/common/renderer_preferences.h" | |
17 #include "net/base/load_states.h" | 13 #include "net/base/load_states.h" |
18 #include "webkit/glue/password_form.h" | |
19 #include "webkit/glue/webpreferences.h" | |
20 #include "webkit/glue/window_open_disposition.h" | 14 #include "webkit/glue/window_open_disposition.h" |
21 | 15 |
22 class AutofillForm; | 16 class AutofillForm; |
17 struct ContextMenuParams; | |
18 class FilePath; | |
19 class GURL; | |
20 struct NativeWebKeyboardEvent; | |
23 class NavigationEntry; | 21 class NavigationEntry; |
24 class Profile; | 22 class Profile; |
23 struct RendererPreferences; | |
25 class RenderProcessHost; | 24 class RenderProcessHost; |
26 class RenderViewHost; | 25 class RenderViewHost; |
27 class ResourceRequestDetails; | 26 class ResourceRequestDetails; |
28 class SkBitmap; | 27 class SkBitmap; |
29 class TabContents; | 28 class TabContents; |
30 class WebKeyboardEvent; | |
31 struct ThumbnailScore; | 29 struct ThumbnailScore; |
32 struct ContextMenuParams; | |
33 struct ViewHostMsg_DidPrintPage_Params; | 30 struct ViewHostMsg_DidPrintPage_Params; |
34 struct ViewHostMsg_FrameNavigate_Params; | 31 struct ViewHostMsg_FrameNavigate_Params; |
35 struct WebDropData; | 32 struct WebDropData; |
33 class WebKeyboardEvent; | |
34 struct WebPreferences; | |
36 | 35 |
37 namespace base { | 36 namespace base { |
38 class WaitableEvent; | 37 class WaitableEvent; |
39 } | 38 } |
40 | 39 |
40 namespace gfx { | |
41 class Rect; | |
42 } | |
43 | |
41 namespace IPC { | 44 namespace IPC { |
42 class Message; | 45 class Message; |
43 } | 46 } |
44 | 47 |
45 namespace webkit_glue { | 48 namespace webkit_glue { |
46 class AutofillForm; | 49 class AutofillForm; |
50 struct PasswordForm; | |
47 struct WebApplicationInfo; | 51 struct WebApplicationInfo; |
48 } | 52 } |
49 | 53 |
50 // | 54 // |
51 // RenderViewHostDelegate | 55 // RenderViewHostDelegate |
52 // | 56 // |
53 // An interface implemented by an object interested in knowing about the state | 57 // An interface implemented by an object interested in knowing about the state |
54 // of the RenderViewHost. | 58 // of the RenderViewHost. |
55 // | 59 // |
56 // This interface currently encompasses every type of message that was | 60 // This interface currently encompasses every type of message that was |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
146 // specifies what frame the data belongs. The parameter data contains the | 150 // specifies what frame the data belongs. The parameter data contains the |
147 // available data for sending. The parameter status indicates the | 151 // available data for sending. The parameter status indicates the |
148 // serialization status, See | 152 // serialization status, See |
149 // webkit_glue::DomSerializerDelegate::PageSavingSerializationStatus for | 153 // webkit_glue::DomSerializerDelegate::PageSavingSerializationStatus for |
150 // the detail meaning of status. | 154 // the detail meaning of status. |
151 virtual void OnReceivedSerializedHtmlData(const GURL& frame_url, | 155 virtual void OnReceivedSerializedHtmlData(const GURL& frame_url, |
152 const std::string& data, | 156 const std::string& data, |
153 int32 status) = 0; | 157 int32 status) = 0; |
154 }; | 158 }; |
155 | 159 |
156 // Returns the current delegate associated with a feature. May be NULL. | 160 // Returns the current delegate associated with a feature. May return NULL if |
157 virtual View* GetViewDelegate() const { return NULL; } | 161 // there is no corresponding delegate. |
158 virtual Save* GetSaveDelegate() const { return NULL; } | 162 virtual View* GetViewDelegate() const = 0; |
163 virtual Save* GetSaveDelegate() const = 0; | |
159 | 164 |
160 // Gets the URL that is currently being displayed, if there is one. | 165 // Gets the URL that is currently being displayed, if there is one. |
161 virtual const GURL& GetURL() const = 0; | 166 virtual const GURL& GetURL() const = 0; |
162 | 167 |
163 // Return this object cast to a TabContents, if it is one. | 168 // Return this object cast to a TabContents, if it is one. If the object is |
164 virtual TabContents* GetAsTabContents() { return NULL; } | 169 // not a TabContents, returns NULL. |
170 virtual TabContents* GetAsTabContents() = 0; | |
165 | 171 |
166 // The RenderView is being constructed (message sent to the renderer process | 172 // The RenderView is being constructed (message sent to the renderer process |
167 // to construct a RenderView). Now is a good time to send other setup events | 173 // to construct a RenderView). Now is a good time to send other setup events |
168 // to the RenderView. This precedes any other commands to the RenderView. | 174 // to the RenderView. This precedes any other commands to the RenderView. |
169 virtual void RenderViewCreated(RenderViewHost* render_view_host) { } | 175 virtual void RenderViewCreated(RenderViewHost* render_view_host) = 0; |
Aaron Boodman
2009/07/04 16:42:25
Why change this to require an implementation of ev
| |
170 | 176 |
171 // The RenderView has been constructed. | 177 // The RenderView has been constructed. |
172 virtual void RenderViewReady(RenderViewHost* render_view_host) { } | 178 virtual void RenderViewReady(RenderViewHost* render_view_host) = 0; |
173 | 179 |
174 // The RenderView died somehow (crashed or was killed by the user). | 180 // The RenderView died somehow (crashed or was killed by the user). |
175 virtual void RenderViewGone(RenderViewHost* render_view_host) { } | 181 virtual void RenderViewGone(RenderViewHost* render_view_host) = 0; |
176 | 182 |
177 // The RenderView was navigated to a different page. | 183 // The RenderView was navigated to a different page. |
178 virtual void DidNavigate(RenderViewHost* render_view_host, | 184 virtual void DidNavigate(RenderViewHost* render_view_host, |
179 const ViewHostMsg_FrameNavigate_Params& params) { } | 185 const ViewHostMsg_FrameNavigate_Params& params) = 0; |
180 | 186 |
181 // The state for the page changed and should be updated. | 187 // The state for the page changed and should be updated. |
182 virtual void UpdateState(RenderViewHost* render_view_host, | 188 virtual void UpdateState(RenderViewHost* render_view_host, |
183 int32 page_id, | 189 int32 page_id, |
184 const std::string& state) { } | 190 const std::string& state) = 0; |
185 | 191 |
186 // The page's title was changed and should be updated. | 192 // The page's title was changed and should be updated. |
187 virtual void UpdateTitle(RenderViewHost* render_view_host, | 193 virtual void UpdateTitle(RenderViewHost* render_view_host, |
188 int32 page_id, | 194 int32 page_id, |
189 const std::wstring& title) { } | 195 const std::wstring& title) = 0; |
190 | 196 |
191 // The page's encoding was changed and should be updated. | 197 // The page's encoding was changed and should be updated. |
192 virtual void UpdateEncoding(RenderViewHost* render_view_host, | 198 virtual void UpdateEncoding(RenderViewHost* render_view_host, |
193 const std::wstring& encoding) { } | 199 const std::wstring& encoding) = 0; |
194 | 200 |
195 // The destination URL has changed should be updated | 201 // The destination URL has changed should be updated |
196 virtual void UpdateTargetURL(int32 page_id, const GURL& url) { } | 202 virtual void UpdateTargetURL(int32 page_id, const GURL& url) = 0; |
197 | 203 |
198 // The thumbnail representation of the page changed and should be updated. | 204 // The thumbnail representation of the page changed and should be updated. |
199 virtual void UpdateThumbnail(const GURL& url, | 205 virtual void UpdateThumbnail(const GURL& url, |
200 const SkBitmap& bitmap, | 206 const SkBitmap& bitmap, |
201 const ThumbnailScore& score) { } | 207 const ThumbnailScore& score) = 0; |
202 | 208 |
203 // Inspector settings were changes and should be persisted. | 209 // Inspector settings were changes and should be persisted. |
204 virtual void UpdateInspectorSettings(const std::wstring& raw_settings) { } | 210 virtual void UpdateInspectorSettings(const std::wstring& raw_settings) = 0; |
205 | 211 |
206 // The page is trying to close the RenderView's representation in the client. | 212 // The page is trying to close the RenderView's representation in the client. |
207 virtual void Close(RenderViewHost* render_view_host) { } | 213 virtual void Close(RenderViewHost* render_view_host) = 0; |
208 | 214 |
209 // The page is trying to move the RenderView's representation in the client. | 215 // The page is trying to move the RenderView's representation in the client. |
210 virtual void RequestMove(const gfx::Rect& new_bounds) { } | 216 virtual void RequestMove(const gfx::Rect& new_bounds) = 0; |
211 | 217 |
212 // The RenderView began loading a new page. This corresponds to WebKit's | 218 // The RenderView began loading a new page. This corresponds to WebKit's |
213 // notion of the throbber starting. | 219 // notion of the throbber starting. |
214 virtual void DidStartLoading(RenderViewHost* render_view_host) { } | 220 virtual void DidStartLoading(RenderViewHost* render_view_host) = 0; |
215 | 221 |
216 // The RenderView stopped loading a page. This corresponds to WebKit's | 222 // The RenderView stopped loading a page. This corresponds to WebKit's |
217 // notion of the throbber stopping. | 223 // notion of the throbber stopping. |
218 virtual void DidStopLoading(RenderViewHost* render_view_host) { } | 224 virtual void DidStopLoading(RenderViewHost* render_view_host) = 0; |
219 | 225 |
220 // The RenderView is starting a provisional load. | 226 // The RenderView is starting a provisional load. |
221 virtual void DidStartProvisionalLoadForFrame(RenderViewHost* render_view_host, | 227 virtual void DidStartProvisionalLoadForFrame(RenderViewHost* render_view_host, |
222 bool is_main_frame, | 228 bool is_main_frame, |
223 const GURL& url) { } | 229 const GURL& url) = 0; |
224 | 230 |
225 // Notification by the resource loading system (not the renderer) that it has | 231 // Notification by the resource loading system (not the renderer) that it has |
226 // started receiving a resource response. This is different than | 232 // started receiving a resource response. This is different than |
227 // DidStartProvisionalLoadForFrame above because this is called for every | 233 // DidStartProvisionalLoadForFrame above because this is called for every |
228 // resource (images, automatically loaded subframes, etc.) and provisional | 234 // resource (images, automatically loaded subframes, etc.) and provisional |
229 // loads are only for user-initiated navigations. | 235 // loads are only for user-initiated navigations. |
230 // | 236 // |
231 // The pointer ownership is NOT transferred. | 237 // The pointer ownership is NOT transferred. |
232 virtual void DidStartReceivingResourceResponse( | 238 virtual void DidStartReceivingResourceResponse( |
233 ResourceRequestDetails* details) {} | 239 ResourceRequestDetails* details) = 0; |
234 | 240 |
235 // Sent when a provisional load is redirected. | 241 // Sent when a provisional load is redirected. |
236 virtual void DidRedirectProvisionalLoad(int32 page_id, | 242 virtual void DidRedirectProvisionalLoad(int32 page_id, |
237 const GURL& source_url, | 243 const GURL& source_url, |
238 const GURL& target_url) { } | 244 const GURL& target_url) = 0; |
239 | 245 |
240 // Notification by the resource loading system (not the renderer) that a | 246 // Notification by the resource loading system (not the renderer) that a |
241 // resource was redirected. This is different than DidRedirectProvisionalLoad | 247 // resource was redirected. This is different than DidRedirectProvisionalLoad |
242 // above because this is called for every resource (images, automatically | 248 // above because this is called for every resource (images, automatically |
243 // loaded subframes, etc.) and provisional loads are only for user-initiated | 249 // loaded subframes, etc.) and provisional loads are only for user-initiated |
244 // navigations. | 250 // navigations. |
245 // | 251 // |
246 // The pointer ownership is NOT transferred. | 252 // The pointer ownership is NOT transferred. |
247 virtual void DidRedirectResource(ResourceRequestDetails* details) {} | 253 virtual void DidRedirectResource(ResourceRequestDetails* details) = 0; |
248 | 254 |
249 // The RenderView loaded a resource from an in-memory cache. | 255 // The RenderView loaded a resource from an in-memory cache. |
250 // |security_info| contains the security info if this resource was originally | 256 // |security_info| contains the security info if this resource was originally |
251 // loaded over a secure connection. | 257 // loaded over a secure connection. |
252 virtual void DidLoadResourceFromMemoryCache( | 258 virtual void DidLoadResourceFromMemoryCache( |
253 const GURL& url, | 259 const GURL& url, |
254 const std::string& frame_origin, | 260 const std::string& frame_origin, |
255 const std::string& main_frame_origin, | 261 const std::string& main_frame_origin, |
256 const std::string& security_info) { } | 262 const std::string& security_info) = 0; |
257 | 263 |
258 // The RenderView failed a provisional load with an error. | 264 // The RenderView failed a provisional load with an error. |
259 virtual void DidFailProvisionalLoadWithError( | 265 virtual void DidFailProvisionalLoadWithError( |
260 RenderViewHost* render_view_host, | 266 RenderViewHost* render_view_host, |
261 bool is_main_frame, | 267 bool is_main_frame, |
262 int error_code, | 268 int error_code, |
263 const GURL& url, | 269 const GURL& url, |
264 bool showing_repost_interstitial) { } | 270 bool showing_repost_interstitial) = 0; |
265 | 271 |
266 // The URL for the FavIcon of a page has changed. | 272 // The URL for the FavIcon of a page has changed. |
267 virtual void UpdateFavIconURL(RenderViewHost* render_view_host, | 273 virtual void UpdateFavIconURL(RenderViewHost* render_view_host, |
268 int32 page_id, const GURL& icon_url) { } | 274 int32 page_id, const GURL& icon_url) = 0; |
269 | 275 |
270 // An image that was requested to be downloaded by DownloadImage has | 276 // An image that was requested to be downloaded by DownloadImage has |
271 // completed. | 277 // completed. |
272 virtual void DidDownloadImage(RenderViewHost* render_view_host, | 278 virtual void DidDownloadImage(RenderViewHost* render_view_host, |
273 int id, | 279 int id, |
274 const GURL& image_url, | 280 const GURL& image_url, |
275 bool errored, | 281 bool errored, |
276 const SkBitmap& image) { } | 282 const SkBitmap& image) = 0; |
277 | 283 |
278 // The page wants to open a URL with the specified disposition. | 284 // The page wants to open a URL with the specified disposition. |
279 virtual void RequestOpenURL(const GURL& url, | 285 virtual void RequestOpenURL(const GURL& url, |
280 const GURL& referrer, | 286 const GURL& referrer, |
281 WindowOpenDisposition disposition) { } | 287 WindowOpenDisposition disposition) = 0; |
282 | 288 |
283 // A DOM automation operation completed. The result of the operation is | 289 // A DOM automation operation completed. The result of the operation is |
284 // expressed in a json string. | 290 // expressed in a json string. |
285 virtual void DomOperationResponse(const std::string& json_string, | 291 virtual void DomOperationResponse(const std::string& json_string, |
286 int automation_id) { } | 292 int automation_id) = 0; |
287 | 293 |
288 // A message was sent from HTML-based UI. | 294 // A message was sent from HTML-based UI. |
289 // By default we ignore such messages. | 295 // By default we ignore such messages. |
290 virtual void ProcessDOMUIMessage(const std::string& message, | 296 virtual void ProcessDOMUIMessage(const std::string& message, |
291 const std::string& content, | 297 const std::string& content, |
292 int request_id, | 298 int request_id, |
293 bool has_callback) { } | 299 bool has_callback) = 0; |
294 | 300 |
295 // A message for external host. By default we ignore such messages. | 301 // A message for external host. By default we ignore such messages. |
296 // |receiver| can be a receiving script and |message| is any | 302 // |receiver| can be a receiving script and |message| is any |
297 // arbitrary string that makes sense to the receiver. | 303 // arbitrary string that makes sense to the receiver. |
298 virtual void ProcessExternalHostMessage(const std::string& message, | 304 virtual void ProcessExternalHostMessage(const std::string& message, |
299 const std::string& origin, | 305 const std::string& origin, |
300 const std::string& target) { | 306 const std::string& target) = 0; |
301 } | |
302 | 307 |
303 // A document has been loaded in a frame. | 308 // Notification that a document has been loaded in a frame. |
304 virtual void DocumentLoadedInFrame() { | 309 virtual void DocumentLoadedInFrame() = 0; |
305 } | |
306 | 310 |
307 // Navigate to the history entry for the given offset from the current | 311 // Navigate to the history entry for the given offset from the current |
308 // position within the NavigationController. Makes no change if offset is | 312 // position within the NavigationController. Makes no change if offset is |
309 // not valid. | 313 // not valid. |
310 virtual void GoToEntryAtOffset(int offset) { } | 314 virtual void GoToEntryAtOffset(int offset) = 0; |
311 | 315 |
312 // The page requests the size of the back and forward lists | 316 // The page requests the size of the back and forward lists |
313 // within the NavigationController. | 317 // within the NavigationController. |
314 virtual void GetHistoryListCount(int* back_list_count, | 318 virtual void GetHistoryListCount(int* back_list_count, |
315 int* forward_list_count) { } | 319 int* forward_list_count) = 0; |
316 | 320 |
317 // A file chooser should be shown. | 321 // A file chooser should be shown. |
318 virtual void RunFileChooser(bool multiple_files, | 322 virtual void RunFileChooser(bool multiple_files, |
319 const string16& title, | 323 const string16& title, |
320 const FilePath& default_file) { } | 324 const FilePath& default_file) = 0; |
321 | 325 |
322 // A javascript message, confirmation or prompt should be shown. | 326 // A javascript message, confirmation or prompt should be shown. |
323 virtual void RunJavaScriptMessage(const std::wstring& message, | 327 virtual void RunJavaScriptMessage(const std::wstring& message, |
324 const std::wstring& default_prompt, | 328 const std::wstring& default_prompt, |
325 const GURL& frame_url, | 329 const GURL& frame_url, |
326 const int flags, | 330 const int flags, |
327 IPC::Message* reply_msg, | 331 IPC::Message* reply_msg, |
328 bool* did_suppress_message) { } | 332 bool* did_suppress_message) = 0; |
329 | 333 |
330 virtual void RunBeforeUnloadConfirm(const std::wstring& message, | 334 virtual void RunBeforeUnloadConfirm(const std::wstring& message, |
331 IPC::Message* reply_msg) { } | 335 IPC::Message* reply_msg) = 0; |
332 | |
333 // Display this RenderViewHost in a modal fashion. | |
334 virtual void RunModal(IPC::Message* reply_msg) { } | |
335 | 336 |
336 virtual void ShowModalHTMLDialog(const GURL& url, int width, int height, | 337 virtual void ShowModalHTMLDialog(const GURL& url, int width, int height, |
337 const std::string& json_arguments, | 338 const std::string& json_arguments, |
338 IPC::Message* reply_msg) { } | 339 IPC::Message* reply_msg) = 0; |
339 | 340 |
340 // Password forms have been detected in the page. | 341 // Password forms have been detected in the page. |
341 virtual void PasswordFormsSeen( | 342 virtual void PasswordFormsSeen( |
342 const std::vector<webkit_glue::PasswordForm>& forms) { } | 343 const std::vector<webkit_glue::PasswordForm>& forms) = 0; |
343 | 344 |
344 // Forms fillable by autofill have been detected in the page. | 345 // Forms fillable by autofill have been detected in the page. |
345 virtual void AutofillFormSubmitted(const webkit_glue::AutofillForm& form) { } | 346 virtual void AutofillFormSubmitted(const webkit_glue::AutofillForm& form) = 0; |
346 | 347 |
347 // Called to retrieve a list of suggestions from the web database given | 348 // Called to retrieve a list of suggestions from the web database given |
348 // the name of the field |field_name| and what the user has already typed in | 349 // the name of the field |field_name| and what the user has already typed in |
349 // the field |user_text|. Appeals to the database thead to perform the query. | 350 // the field |user_text|. Appeals to the database thead to perform the query. |
350 // When the database thread is finished, the autofill manager retrieves the | 351 // When the database thread is finished, the autofill manager retrieves the |
351 // calling RenderViewHost and then passes the vector of suggestions to | 352 // calling RenderViewHost and then passes the vector of suggestions to |
352 // RenderViewHost::AutofillSuggestionsReturned. | 353 // RenderViewHost::AutofillSuggestionsReturned. |
353 virtual void GetAutofillSuggestions(const std::wstring& field_name, | 354 virtual void GetAutofillSuggestions(const std::wstring& field_name, |
354 const std::wstring& user_text, | 355 const std::wstring& user_text, |
355 int64 node_id, | 356 int64 node_id, |
356 int request_id) { } | 357 int request_id) = 0; |
357 | 358 |
358 // Called when the user has indicated that she wants to remove the specified | 359 // Called when the user has indicated that she wants to remove the specified |
359 // autofill suggestion from the database. | 360 // autofill suggestion from the database. |
360 virtual void RemoveAutofillEntry(const std::wstring& field_name, | 361 virtual void RemoveAutofillEntry(const std::wstring& field_name, |
361 const std::wstring& value) { } | 362 const std::wstring& value) = 0; |
362 | 363 |
363 // Notification that the page has an OpenSearch description document. | 364 // Notification that the page has an OpenSearch description document. |
364 virtual void PageHasOSDD(RenderViewHost* render_view_host, | 365 virtual void PageHasOSDD(RenderViewHost* render_view_host, |
365 int32 page_id, const GURL& doc_url, | 366 int32 page_id, const GURL& doc_url, |
366 bool autodetected) { } | 367 bool autodetected) = 0; |
367 | 368 |
368 // Notification that the render view has calculated the number of printed | 369 // Notification that the render view has calculated the number of printed |
369 // pages. | 370 // pages. |
370 virtual void DidGetPrintedPagesCount(int cookie, int number_pages) { | 371 virtual void DidGetPrintedPagesCount(int cookie, int number_pages) = 0; |
371 NOTREACHED(); | |
372 } | |
373 | 372 |
374 // Notification that the render view is done rendering one printed page. This | 373 // Notification that the render view is done rendering one printed page. This |
375 // call is synchronous, the renderer is waiting on us because of the EMF | 374 // call is synchronous, the renderer is waiting on us because of the EMF |
376 // memory mapped data. | 375 // memory mapped data. |
377 virtual void DidPrintPage(const ViewHostMsg_DidPrintPage_Params& params) { | 376 virtual void DidPrintPage(const ViewHostMsg_DidPrintPage_Params& params) = 0; |
378 NOTREACHED(); | |
379 } | |
380 | 377 |
381 // |url| is assigned to a server that can provide alternate error pages. If | 378 // |url| is assigned to a server that can provide alternate error pages. If |
382 // unchanged, just use the error pages built into our webkit. | 379 // the returned URL is empty, the default error page built into WebKit will |
383 virtual GURL GetAlternateErrorPageURL() const { | 380 // be used. |
384 return GURL(); | 381 virtual GURL GetAlternateErrorPageURL() const = 0; |
385 } | |
386 | 382 |
387 // Return a dummy RendererPreferences object that will be used by the renderer | 383 // Return a dummy RendererPreferences object that will be used by the renderer |
388 // associated with the owning RenderViewHost. | 384 // associated with the owning RenderViewHost. |
389 virtual RendererPreferences GetRendererPrefs() const { | 385 virtual RendererPreferences GetRendererPrefs() const = 0; |
390 return RendererPreferences(); | |
391 } | |
392 | 386 |
393 // Returns a WebPreferences object that will be used by the renderer | 387 // Returns a WebPreferences object that will be used by the renderer |
394 // associated with the owning render view host. | 388 // associated with the owning render view host. |
395 virtual WebPreferences GetWebkitPrefs() { | 389 virtual WebPreferences GetWebkitPrefs() = 0; |
396 NOTREACHED(); | |
397 return WebPreferences(); | |
398 } | |
399 | 390 |
400 // Notification when default plugin updates status of the missing plugin. | 391 // Notification when default plugin updates status of the missing plugin. |
401 virtual void OnMissingPluginStatus(int status) { } | 392 virtual void OnMissingPluginStatus(int status) = 0; |
402 | 393 |
403 // Notification from the renderer that a plugin instance has crashed. | 394 // Notification from the renderer that a plugin instance has crashed. |
404 virtual void OnCrashedPlugin(const FilePath& plugin_path) { } | 395 virtual void OnCrashedPlugin(const FilePath& plugin_path) = 0; |
405 | 396 |
406 // Notification that a worker process has crashed. | 397 // Notification that a worker process has crashed. |
407 virtual void OnCrashedWorker() { } | 398 virtual void OnCrashedWorker() = 0; |
408 | 399 |
409 // Notification from the renderer that JS runs out of memory. | 400 // Notification from the renderer that JS runs out of memory. |
410 virtual void OnJSOutOfMemory() { } | 401 virtual void OnJSOutOfMemory() = 0; |
411 | 402 |
412 // Notification whether we should close the page, after an explicit call to | 403 // Notification whether we should close the page, after an explicit call to |
413 // AttemptToClosePage. This is called before a cross-site request or before | 404 // AttemptToClosePage. This is called before a cross-site request or before |
414 // a tab/window is closed, to allow the appropriate renderer to approve or | 405 // a tab/window is closed, to allow the appropriate renderer to approve or |
415 // deny the request. |proceed| indicates whether the user chose to proceed. | 406 // deny the request. |proceed| indicates whether the user chose to proceed. |
416 virtual void ShouldClosePage(bool proceed) { } | 407 virtual void ShouldClosePage(bool proceed) = 0; |
417 | 408 |
418 // Called by ResourceDispatcherHost when a response for a pending cross-site | 409 // Called by ResourceDispatcherHost when a response for a pending cross-site |
419 // request is received. The ResourceDispatcherHost will pause the response | 410 // request is received. The ResourceDispatcherHost will pause the response |
420 // until the onunload handler of the previous renderer is run. | 411 // until the onunload handler of the previous renderer is run. |
421 virtual void OnCrossSiteResponse(int new_render_process_host_id, | 412 virtual void OnCrossSiteResponse(int new_render_process_host_id, |
422 int new_request_id) { } | 413 int new_request_id) = 0; |
423 | 414 |
424 // Whether this object can be blurred through a javascript | 415 // Called the ResourceDispatcherHost's associate CrossSiteRequestHandler |
425 // obj.blur() call. ConstrainedWindows shouldn't be able to be | 416 // when a cross-site navigation has been canceled. |
426 // blurred. | 417 virtual void OnCrossSiteNavigationCanceled() = 0; |
427 virtual bool CanBlur() const { return true; } | 418 |
419 // Returns true if this this object can be blurred through a javascript | |
420 // obj.blur() call. ConstrainedWindows shouldn't be able to be blurred, but | |
421 // generally most other windows will be. | |
422 virtual bool CanBlur() const = 0; | |
428 | 423 |
429 // Return the rect where to display the resize corner, if any, otherwise | 424 // Return the rect where to display the resize corner, if any, otherwise |
430 // an empty rect. | 425 // an empty rect. |
431 virtual gfx::Rect GetRootWindowResizerRect() const { return gfx::Rect(); } | 426 virtual gfx::Rect GetRootWindowResizerRect() const = 0; |
432 | 427 |
433 // Notification that the renderer has become unresponsive. The | 428 // Notification that the renderer has become unresponsive. The |
434 // delegate can use this notification to show a warning to the user. | 429 // delegate can use this notification to show a warning to the user. |
435 virtual void RendererUnresponsive(RenderViewHost* render_view_host, | 430 virtual void RendererUnresponsive(RenderViewHost* render_view_host, |
436 bool is_during_unload) { } | 431 bool is_during_unload) = 0; |
437 | 432 |
438 // Notification that a previously unresponsive renderer has become | 433 // Notification that a previously unresponsive renderer has become |
439 // responsive again. The delegate can use this notification to end the | 434 // responsive again. The delegate can use this notification to end the |
440 // warning shown to the user. | 435 // warning shown to the user. |
441 virtual void RendererResponsive(RenderViewHost* render_view_host) { } | 436 virtual void RendererResponsive(RenderViewHost* render_view_host) = 0; |
442 | 437 |
443 // Notification that the RenderViewHost's load state changed. | 438 // Notification that the RenderViewHost's load state changed. |
444 virtual void LoadStateChanged(const GURL& url, net::LoadState load_state) { } | 439 virtual void LoadStateChanged(const GURL& url, net::LoadState load_state) = 0; |
445 | 440 |
446 // Notification that a request for install info has completed. | 441 // Notification that a request for install info has completed. |
447 virtual void OnDidGetApplicationInfo( | 442 virtual void OnDidGetApplicationInfo( |
448 int32 page_id, | 443 int32 page_id, |
449 const webkit_glue::WebApplicationInfo& app_info) { } | 444 const webkit_glue::WebApplicationInfo& app_info) = 0; |
450 | 445 |
451 // Notification the user has made a gesture while focus was on the | 446 // Notification the user has made a gesture while focus was on the |
452 // page. This is used to avoid uninitiated user downloads (aka carpet | 447 // page. This is used to avoid uninitiated user downloads (aka carpet |
453 // bombing), see DownloadRequestManager for details. | 448 // bombing), see DownloadRequestManager for details. |
454 virtual void OnUserGesture() { } | 449 virtual void OnUserGesture() = 0; |
455 | 450 |
456 // If this view is used to host an external tab container. | 451 // Returns true if this view is used to host an external tab container. |
457 virtual bool IsExternalTabContainer() const { return false; } | 452 virtual bool IsExternalTabContainer() const = 0; |
458 | 453 |
459 // A find operation in the current page completed. | 454 // A find operation in the current page completed. |
460 virtual void OnFindReply(int request_id, | 455 virtual void OnFindReply(int request_id, |
461 int number_of_matches, | 456 int number_of_matches, |
462 const gfx::Rect& selection_rect, | 457 const gfx::Rect& selection_rect, |
463 int active_match_ordinal, | 458 int active_match_ordinal, |
464 bool final_update) { } | 459 bool final_update) = 0; |
465 | 460 |
466 // The RenderView has inserted one css file into page. | 461 // The RenderView has inserted one css file into page. |
467 virtual void DidInsertCSS() { } | 462 virtual void DidInsertCSS() = 0; |
468 }; | 463 }; |
469 | 464 |
470 #endif // CHROME_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_DELEGATE_H_ | 465 #endif // CHROME_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_DELEGATE_H_ |
OLD | NEW |