OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_DELEGATE_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_DELEGATE_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_DELEGATE_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_DELEGATE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
463 | 463 |
464 // The RenderView stopped loading a page. This corresponds to WebKit's | 464 // The RenderView stopped loading a page. This corresponds to WebKit's |
465 // notion of the throbber stopping. | 465 // notion of the throbber stopping. |
466 virtual void DidStopLoading() {} | 466 virtual void DidStopLoading() {} |
467 | 467 |
468 // The RenderView made progress loading a page's top frame. | 468 // The RenderView made progress loading a page's top frame. |
469 // |progress| is a value between 0 (nothing loaded) to 1.0 (top frame | 469 // |progress| is a value between 0 (nothing loaded) to 1.0 (top frame |
470 // entirely loaded). | 470 // entirely loaded). |
471 virtual void DidChangeLoadProgress(double progress) {} | 471 virtual void DidChangeLoadProgress(double progress) {} |
472 | 472 |
| 473 // The RenderView started a provisional load in the given frame. |
| 474 virtual void DidStartProvisionalLoadForFrame(int64 frame_id, |
| 475 bool main_frame, |
| 476 const GURL& url) {} |
| 477 |
| 478 // The RenderView redirected a provisional load to |target_url|. |
| 479 virtual void DidRedirectProvisionalLoad(int32 page_id, |
| 480 const GURL& source_url, |
| 481 const GURL& target_url) {} |
| 482 |
| 483 // The RenderView's provisional load in the given frame failed. |
| 484 virtual void DidFailProvisionalLoadWithError( |
| 485 int64 frame_id, |
| 486 bool main_frame, |
| 487 int error_code, |
| 488 const GURL& url, |
| 489 bool showing_repost_interstitial) {} |
| 490 |
| 491 // The RenderView loaded |url| from the in-memory cache. |
| 492 virtual void DidLoadResourceFromMemoryCache( |
| 493 const GURL& url, |
| 494 const std::string& security_info) {} |
| 495 |
| 496 // The RenderView displayed insecure content and should not be considered |
| 497 // secure. |
| 498 virtual void DidDisplayInsecureContent() {} |
| 499 |
| 500 // The RenderView ran insecure content and should not be considered secure. |
| 501 virtual void DidRunInsecureContent(const std::string& security_origin, |
| 502 const GURL& target_url) {} |
| 503 |
| 504 // The RenderView loaded a document in the given frame. |
| 505 virtual void DocumentLoadedInFrame(int64 frame_id) {} |
| 506 |
| 507 // The RenderView finished a load in the given frame. |
| 508 virtual void DidFinishLoad(int64 frame_id) {} |
| 509 |
| 510 // The RenderView requested updating content restrictions. |
| 511 virtual void UpdateContentRestrictions(int restrictions) {} |
| 512 |
473 // The RenderView's main frame document element is ready. This happens when | 513 // The RenderView's main frame document element is ready. This happens when |
474 // the document has finished parsing. | 514 // the document has finished parsing. |
475 virtual void DocumentAvailableInMainFrame(RenderViewHost* render_view_host) {} | 515 virtual void DocumentAvailableInMainFrame(RenderViewHost* render_view_host) {} |
476 | 516 |
477 // The onload handler in the RenderView's main frame has completed. | 517 // The onload handler in the RenderView's main frame has completed. |
478 virtual void DocumentOnLoadCompletedInMainFrame( | 518 virtual void DocumentOnLoadCompletedInMainFrame( |
479 RenderViewHost* render_view_host, | 519 RenderViewHost* render_view_host, |
480 int32 page_id) {} | 520 int32 page_id) {} |
481 | 521 |
482 // The page wants to open a URL with the specified disposition. | 522 // The page wants to open a URL with the specified disposition. |
(...skipping 12 matching lines...) Expand all Loading... |
495 const ExtensionHostMsg_DomMessage_Params& params) {} | 535 const ExtensionHostMsg_DomMessage_Params& params) {} |
496 | 536 |
497 // A message for external host. By default we ignore such messages. | 537 // A message for external host. By default we ignore such messages. |
498 // |receiver| can be a receiving script and |message| is any | 538 // |receiver| can be a receiving script and |message| is any |
499 // arbitrary string that makes sense to the receiver. | 539 // arbitrary string that makes sense to the receiver. |
500 virtual void ProcessExternalHostMessage(const std::string& message, | 540 virtual void ProcessExternalHostMessage(const std::string& message, |
501 const std::string& origin, | 541 const std::string& origin, |
502 const std::string& target) {} | 542 const std::string& target) {} |
503 | 543 |
504 // A javascript message, confirmation or prompt should be shown. | 544 // A javascript message, confirmation or prompt should be shown. |
505 virtual void RunJavaScriptMessage(const std::wstring& message, | 545 virtual void RunJavaScriptMessage(const RenderViewHost* rvh, |
| 546 const std::wstring& message, |
506 const std::wstring& default_prompt, | 547 const std::wstring& default_prompt, |
507 const GURL& frame_url, | 548 const GURL& frame_url, |
508 const int flags, | 549 const int flags, |
509 IPC::Message* reply_msg, | 550 IPC::Message* reply_msg, |
510 bool* did_suppress_message) {} | 551 bool* did_suppress_message) {} |
511 | 552 |
512 virtual void RunBeforeUnloadConfirm(const std::wstring& message, | 553 virtual void RunBeforeUnloadConfirm(const RenderViewHost* rvh, |
| 554 const std::wstring& message, |
513 IPC::Message* reply_msg) {} | 555 IPC::Message* reply_msg) {} |
514 | 556 |
515 // |url| is assigned to a server that can provide alternate error pages. If | 557 // |url| is assigned to a server that can provide alternate error pages. If |
516 // the returned URL is empty, the default error page built into WebKit will | 558 // the returned URL is empty, the default error page built into WebKit will |
517 // be used. | 559 // be used. |
518 virtual GURL GetAlternateErrorPageURL() const; | 560 virtual GURL GetAlternateErrorPageURL() const; |
519 | 561 |
520 // Return a dummy RendererPreferences object that will be used by the renderer | 562 // Return a dummy RendererPreferences object that will be used by the renderer |
521 // associated with the owning RenderViewHost. | 563 // associated with the owning RenderViewHost. |
522 virtual RendererPreferences GetRendererPrefs(Profile* profile) const = 0; | 564 virtual RendererPreferences GetRendererPrefs(Profile* profile) const = 0; |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
571 // Returns true if the delegate will take care of asking the user, otherwise | 613 // Returns true if the delegate will take care of asking the user, otherwise |
572 // the caller will do the default behavior. | 614 // the caller will do the default behavior. |
573 bool RequestDesktopNotificationPermission(const GURL& source_origin, | 615 bool RequestDesktopNotificationPermission(const GURL& source_origin, |
574 int callback_context); | 616 int callback_context); |
575 | 617 |
576 protected: | 618 protected: |
577 virtual ~RenderViewHostDelegate() {} | 619 virtual ~RenderViewHostDelegate() {} |
578 }; | 620 }; |
579 | 621 |
580 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_DELEGATE_H_ | 622 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_DELEGATE_H_ |
OLD | NEW |