OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_H_ | 5 #ifndef CHROME_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_H_ |
6 #define CHROME_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_H_ | 6 #define CHROME_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 20 matching lines...) Expand all Loading... |
31 class GURL; | 31 class GURL; |
32 class ListValue; | 32 class ListValue; |
33 class RenderViewHostDelegate; | 33 class RenderViewHostDelegate; |
34 class SessionStorageNamespace; | 34 class SessionStorageNamespace; |
35 class SiteInstance; | 35 class SiteInstance; |
36 class SkBitmap; | 36 class SkBitmap; |
37 class ViewMsg_Navigate; | 37 class ViewMsg_Navigate; |
38 struct ContentSettings; | 38 struct ContentSettings; |
39 struct ContextMenuParams; | 39 struct ContextMenuParams; |
40 struct MediaPlayerAction; | 40 struct MediaPlayerAction; |
41 struct ThumbnailScore; | |
42 struct ViewHostMsg_AccessibilityNotification_Params; | 41 struct ViewHostMsg_AccessibilityNotification_Params; |
43 struct ViewHostMsg_DidPreviewDocument_Params; | 42 struct ViewHostMsg_DidPreviewDocument_Params; |
44 struct ViewHostMsg_DidPrintPage_Params; | 43 struct ViewHostMsg_DidPrintPage_Params; |
45 struct ViewHostMsg_DomMessage_Params; | 44 struct ViewHostMsg_DomMessage_Params; |
46 struct ViewHostMsg_PageHasOSDD_Type; | 45 struct ViewHostMsg_PageHasOSDD_Type; |
47 struct ViewHostMsg_RunFileChooser_Params; | 46 struct ViewHostMsg_RunFileChooser_Params; |
48 struct ViewHostMsg_ShowNotification_Params; | 47 struct ViewHostMsg_ShowNotification_Params; |
49 struct ViewHostMsg_ShowPopup_Params; | 48 struct ViewHostMsg_ShowPopup_Params; |
50 struct ViewMsg_Navigate_Params; | 49 struct ViewMsg_Navigate_Params; |
51 struct WebApplicationInfo; | 50 struct WebApplicationInfo; |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 // Downloads an image notifying the FavIcon delegate appropriately. The | 298 // Downloads an image notifying the FavIcon delegate appropriately. The |
300 // returned integer uniquely identifies the download for the lifetime of the | 299 // returned integer uniquely identifies the download for the lifetime of the |
301 // browser. | 300 // browser. |
302 int DownloadFavIcon(const GURL& url, int image_size); | 301 int DownloadFavIcon(const GURL& url, int image_size); |
303 | 302 |
304 // Requests application info for the specified page. This is an asynchronous | 303 // Requests application info for the specified page. This is an asynchronous |
305 // request. The delegate is notified by way of OnDidGetApplicationInfo when | 304 // request. The delegate is notified by way of OnDidGetApplicationInfo when |
306 // the data is available. | 305 // the data is available. |
307 void GetApplicationInfo(int32 page_id); | 306 void GetApplicationInfo(int32 page_id); |
308 | 307 |
309 // Captures a thumbnail representation of the page. | |
310 void CaptureThumbnail(); | |
311 | |
312 // Captures a snapshot of the page. | 308 // Captures a snapshot of the page. |
313 void CaptureSnapshot(); | 309 void CaptureSnapshot(); |
314 | 310 |
315 // Notifies the RenderView that the JavaScript message that was shown was | 311 // Notifies the RenderView that the JavaScript message that was shown was |
316 // closed by the user. | 312 // closed by the user. |
317 void JavaScriptMessageBoxClosed(IPC::Message* reply_msg, | 313 void JavaScriptMessageBoxClosed(IPC::Message* reply_msg, |
318 bool success, | 314 bool success, |
319 const std::wstring& prompt); | 315 const std::wstring& prompt); |
320 | 316 |
321 // Notifies the RenderView that the modal html dialog has been closed. | 317 // Notifies the RenderView that the modal html dialog has been closed. |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
535 | 531 |
536 bool is_waiting_for_unload_ack() { return is_waiting_for_unload_ack_; } | 532 bool is_waiting_for_unload_ack() { return is_waiting_for_unload_ack_; } |
537 #endif | 533 #endif |
538 | 534 |
539 // Checks that the given renderer can request |url|, if not it sets it to an | 535 // Checks that the given renderer can request |url|, if not it sets it to an |
540 // empty url. | 536 // empty url. |
541 static void FilterURL(ChildProcessSecurityPolicy* policy, | 537 static void FilterURL(ChildProcessSecurityPolicy* policy, |
542 int renderer_id, | 538 int renderer_id, |
543 GURL* url); | 539 GURL* url); |
544 | 540 |
| 541 const gfx::Size& last_scroll_offset() const { return last_scroll_offset_; } |
| 542 |
545 protected: | 543 protected: |
546 // RenderWidgetHost protected overrides. | 544 // RenderWidgetHost protected overrides. |
547 virtual bool PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event, | 545 virtual bool PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event, |
548 bool* is_keyboard_shortcut); | 546 bool* is_keyboard_shortcut); |
549 virtual void UnhandledKeyboardEvent(const NativeWebKeyboardEvent& event); | 547 virtual void UnhandledKeyboardEvent(const NativeWebKeyboardEvent& event); |
550 virtual void OnUserGesture(); | 548 virtual void OnUserGesture(); |
551 virtual void NotifyRendererUnresponsive(); | 549 virtual void NotifyRendererUnresponsive(); |
552 virtual void NotifyRendererResponsive(); | 550 virtual void NotifyRendererResponsive(); |
553 virtual void OnMsgFocusedNodeChanged(bool is_editable_node); | 551 virtual void OnMsgFocusedNodeChanged(bool is_editable_node); |
554 virtual void OnMsgFocus(); | 552 virtual void OnMsgFocus(); |
555 virtual void OnMsgBlur(); | 553 virtual void OnMsgBlur(); |
556 | 554 |
557 // IPC message handlers. | 555 // IPC message handlers. |
558 void OnMsgShowView(int route_id, | 556 void OnMsgShowView(int route_id, |
559 WindowOpenDisposition disposition, | 557 WindowOpenDisposition disposition, |
560 const gfx::Rect& initial_pos, | 558 const gfx::Rect& initial_pos, |
561 bool user_gesture); | 559 bool user_gesture); |
562 void OnMsgShowWidget(int route_id, const gfx::Rect& initial_pos); | 560 void OnMsgShowWidget(int route_id, const gfx::Rect& initial_pos); |
563 void OnMsgShowFullscreenWidget(int route_id); | 561 void OnMsgShowFullscreenWidget(int route_id); |
564 void OnMsgRunModal(IPC::Message* reply_msg); | 562 void OnMsgRunModal(IPC::Message* reply_msg); |
565 void OnMsgRenderViewReady(); | 563 void OnMsgRenderViewReady(); |
566 void OnMsgRenderViewGone(int status, int error_code); | 564 void OnMsgRenderViewGone(int status, int error_code); |
567 void OnMsgNavigate(const IPC::Message& msg); | 565 void OnMsgNavigate(const IPC::Message& msg); |
568 void OnMsgUpdateState(int32 page_id, | 566 void OnMsgUpdateState(int32 page_id, |
569 const std::string& state); | 567 const std::string& state); |
570 void OnMsgUpdateTitle(int32 page_id, const std::wstring& title); | 568 void OnMsgUpdateTitle(int32 page_id, const std::wstring& title); |
571 void OnMsgUpdateEncoding(const std::string& encoding); | 569 void OnMsgUpdateEncoding(const std::string& encoding); |
572 void OnMsgUpdateTargetURL(int32 page_id, const GURL& url); | 570 void OnMsgUpdateTargetURL(int32 page_id, const GURL& url); |
573 void OnMsgThumbnail(const GURL& url, | |
574 const ThumbnailScore& score, | |
575 const SkBitmap& bitmap); | |
576 void OnMsgScreenshot(const SkBitmap& bitmap); | 571 void OnMsgScreenshot(const SkBitmap& bitmap); |
577 void OnMsgClose(); | 572 void OnMsgClose(); |
578 void OnMsgRequestMove(const gfx::Rect& pos); | 573 void OnMsgRequestMove(const gfx::Rect& pos); |
579 void OnMsgDidStartLoading(); | 574 void OnMsgDidStartLoading(); |
580 void OnMsgDidStopLoading(); | 575 void OnMsgDidStopLoading(); |
581 void OnMsgDidChangeLoadProgress(double load_progress); | 576 void OnMsgDidChangeLoadProgress(double load_progress); |
582 void OnMsgDocumentAvailableInMainFrame(); | 577 void OnMsgDocumentAvailableInMainFrame(); |
583 void OnMsgDocumentOnLoadCompletedInMainFrame(int32 page_id); | 578 void OnMsgDocumentOnLoadCompletedInMainFrame(int32 page_id); |
584 void OnMsgFindReply(int request_id, | 579 void OnMsgFindReply(int request_id, |
585 int number_of_matches, | 580 int number_of_matches, |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
696 int maximum_percent, | 691 int maximum_percent, |
697 bool remember); | 692 bool remember); |
698 void OnSetSuggestions(int32 page_id, | 693 void OnSetSuggestions(int32 page_id, |
699 const std::vector<std::string>& suggestions); | 694 const std::vector<std::string>& suggestions); |
700 void OnInstantSupportDetermined(int32 page_id, bool result); | 695 void OnInstantSupportDetermined(int32 page_id, bool result); |
701 void OnDetectedPhishingSite(const GURL& phishing_url, double phishing_score); | 696 void OnDetectedPhishingSite(const GURL& phishing_url, double phishing_score); |
702 void OnScriptEvalResponse(int id, const ListValue& result); | 697 void OnScriptEvalResponse(int id, const ListValue& result); |
703 void OnUpdateContentRestrictions(int restrictions); | 698 void OnUpdateContentRestrictions(int restrictions); |
704 void OnPagesReadyForPreview( | 699 void OnPagesReadyForPreview( |
705 const ViewHostMsg_DidPreviewDocument_Params& params); | 700 const ViewHostMsg_DidPreviewDocument_Params& params); |
| 701 void OnUpdateScrollOffset(const gfx::Size& size); |
706 | 702 |
707 #if defined(OS_MACOSX) | 703 #if defined(OS_MACOSX) |
708 void OnMsgShowPopup(const ViewHostMsg_ShowPopup_Params& params); | 704 void OnMsgShowPopup(const ViewHostMsg_ShowPopup_Params& params); |
709 #endif | 705 #endif |
710 | 706 |
711 private: | 707 private: |
712 friend class TestRenderViewHost; | 708 friend class TestRenderViewHost; |
713 | 709 |
714 // Get/Create print preview tab. | 710 // Get/Create print preview tab. |
715 TabContents* GetOrCreatePrintPreviewTab(); | 711 TabContents* GetOrCreatePrintPreviewTab(); |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
784 | 780 |
785 // Whether the accessibility tree should be saved, for unit testing. | 781 // Whether the accessibility tree should be saved, for unit testing. |
786 bool save_accessibility_tree_for_testing_; | 782 bool save_accessibility_tree_for_testing_; |
787 | 783 |
788 // The most recently received accessibility tree - for unit testing only. | 784 // The most recently received accessibility tree - for unit testing only. |
789 webkit_glue::WebAccessibility accessibility_tree_; | 785 webkit_glue::WebAccessibility accessibility_tree_; |
790 | 786 |
791 // The termination status of the last render view that terminated. | 787 // The termination status of the last render view that terminated. |
792 base::TerminationStatus render_view_termination_status_; | 788 base::TerminationStatus render_view_termination_status_; |
793 | 789 |
| 790 // ... |
| 791 gfx::Size last_scroll_offset_; |
| 792 |
794 DISALLOW_COPY_AND_ASSIGN(RenderViewHost); | 793 DISALLOW_COPY_AND_ASSIGN(RenderViewHost); |
795 }; | 794 }; |
796 | 795 |
797 #endif // CHROME_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_H_ | 796 #endif // CHROME_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_H_ |
OLD | NEW |