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 CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ |
6 #define CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ | 6 #define CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 | 363 |
364 // Implementation of IPC::Sender. | 364 // Implementation of IPC::Sender. |
365 bool Send(IPC::Message* message) override; | 365 bool Send(IPC::Message* message) override; |
366 | 366 |
367 // RenderFrameHostDelegate --------------------------------------------------- | 367 // RenderFrameHostDelegate --------------------------------------------------- |
368 bool OnMessageReceived(RenderFrameHost* render_frame_host, | 368 bool OnMessageReceived(RenderFrameHost* render_frame_host, |
369 const IPC::Message& message) override; | 369 const IPC::Message& message) override; |
370 const GURL& GetMainFrameLastCommittedURL() const override; | 370 const GURL& GetMainFrameLastCommittedURL() const override; |
371 void RenderFrameCreated(RenderFrameHost* render_frame_host) override; | 371 void RenderFrameCreated(RenderFrameHost* render_frame_host) override; |
372 void RenderFrameDeleted(RenderFrameHost* render_frame_host) override; | 372 void RenderFrameDeleted(RenderFrameHost* render_frame_host) override; |
373 void DidStartLoading(RenderFrameHost* render_frame_host, | |
374 bool to_different_document) override; | |
375 void DidStopLoading() override; | |
376 void SwappedOut(RenderFrameHost* render_frame_host) override; | 373 void SwappedOut(RenderFrameHost* render_frame_host) override; |
377 void DidDeferAfterResponseStarted( | 374 void DidDeferAfterResponseStarted( |
378 const TransitionLayerData& transition_data) override; | 375 const TransitionLayerData& transition_data) override; |
379 bool WillHandleDeferAfterResponseStarted() override; | 376 bool WillHandleDeferAfterResponseStarted() override; |
380 void WorkerCrashed(RenderFrameHost* render_frame_host) override; | 377 void WorkerCrashed(RenderFrameHost* render_frame_host) override; |
381 void ShowContextMenu(RenderFrameHost* render_frame_host, | 378 void ShowContextMenu(RenderFrameHost* render_frame_host, |
382 const ContextMenuParams& params) override; | 379 const ContextMenuParams& params) override; |
383 void RunJavaScriptMessage(RenderFrameHost* render_frame_host, | 380 void RunJavaScriptMessage(RenderFrameHost* render_frame_host, |
384 const base::string16& message, | 381 const base::string16& message, |
385 const base::string16& default_prompt, | 382 const base::string16& default_prompt, |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
529 void NotifyChangedNavigationState(InvalidateTypes changed_flags) override; | 526 void NotifyChangedNavigationState(InvalidateTypes changed_flags) override; |
530 void AboutToNavigateRenderFrame( | 527 void AboutToNavigateRenderFrame( |
531 RenderFrameHostImpl* old_host, | 528 RenderFrameHostImpl* old_host, |
532 RenderFrameHostImpl* new_host) override; | 529 RenderFrameHostImpl* new_host) override; |
533 void DidStartNavigationToPendingEntry( | 530 void DidStartNavigationToPendingEntry( |
534 const GURL& url, | 531 const GURL& url, |
535 NavigationController::ReloadType reload_type) override; | 532 NavigationController::ReloadType reload_type) override; |
536 void RequestOpenURL(RenderFrameHostImpl* render_frame_host, | 533 void RequestOpenURL(RenderFrameHostImpl* render_frame_host, |
537 const OpenURLParams& params) override; | 534 const OpenURLParams& params) override; |
538 bool ShouldPreserveAbortedURLs() override; | 535 bool ShouldPreserveAbortedURLs() override; |
| 536 void DidStartLoading(FrameTreeNode* frame_tree_node, |
| 537 bool to_different_document) override; |
| 538 void DidStopLoading() override; |
| 539 void DidChangeLoadProgress() override; |
539 | 540 |
540 // RenderWidgetHostDelegate -------------------------------------------------- | 541 // RenderWidgetHostDelegate -------------------------------------------------- |
541 | 542 |
542 void RenderWidgetDeleted(RenderWidgetHostImpl* render_widget_host) override; | 543 void RenderWidgetDeleted(RenderWidgetHostImpl* render_widget_host) override; |
543 void RenderWidgetGotFocus(RenderWidgetHostImpl* render_widget_host) override; | 544 void RenderWidgetGotFocus(RenderWidgetHostImpl* render_widget_host) override; |
544 void RenderWidgetWasResized(RenderWidgetHostImpl* render_widget_host, | 545 void RenderWidgetWasResized(RenderWidgetHostImpl* render_widget_host, |
545 bool width_changed) override; | 546 bool width_changed) override; |
546 void ScreenInfoChanged() override; | 547 void ScreenInfoChanged() override; |
547 bool PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event, | 548 bool PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event, |
548 bool* is_keyboard_shortcut) override; | 549 bool* is_keyboard_shortcut) override; |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
768 void OnDidLoadResourceFromMemoryCache(const GURL& url, | 769 void OnDidLoadResourceFromMemoryCache(const GURL& url, |
769 const std::string& security_info, | 770 const std::string& security_info, |
770 const std::string& http_request, | 771 const std::string& http_request, |
771 const std::string& mime_type, | 772 const std::string& mime_type, |
772 ResourceType resource_type); | 773 ResourceType resource_type); |
773 void OnDidDisplayInsecureContent(); | 774 void OnDidDisplayInsecureContent(); |
774 void OnDidRunInsecureContent(const std::string& security_origin, | 775 void OnDidRunInsecureContent(const std::string& security_origin, |
775 const GURL& target_url); | 776 const GURL& target_url); |
776 void OnDocumentLoadedInFrame(); | 777 void OnDocumentLoadedInFrame(); |
777 void OnDidFinishLoad(const GURL& url); | 778 void OnDidFinishLoad(const GURL& url); |
778 void OnDidStartLoading(bool to_different_document); | |
779 void OnDidStopLoading(); | |
780 void OnDidChangeLoadProgress(double load_progress); | |
781 void OnGoToEntryAtOffset(int offset); | 779 void OnGoToEntryAtOffset(int offset); |
782 void OnUpdateZoomLimits(int minimum_percent, | 780 void OnUpdateZoomLimits(int minimum_percent, |
783 int maximum_percent); | 781 int maximum_percent); |
784 void OnEnumerateDirectory(int request_id, const base::FilePath& path); | 782 void OnEnumerateDirectory(int request_id, const base::FilePath& path); |
785 | 783 |
786 void OnRegisterProtocolHandler(const std::string& protocol, | 784 void OnRegisterProtocolHandler(const std::string& protocol, |
787 const GURL& url, | 785 const GURL& url, |
788 const base::string16& title, | 786 const base::string16& title, |
789 bool user_gesture); | 787 bool user_gesture); |
790 void OnUnregisterProtocolHandler(const std::string& protocol, | 788 void OnUnregisterProtocolHandler(const std::string& protocol, |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
901 // called once as this call also removes it from the internal map. | 899 // called once as this call also removes it from the internal map. |
902 RenderWidgetHostView* GetCreatedWidget(int route_id); | 900 RenderWidgetHostView* GetCreatedWidget(int route_id); |
903 | 901 |
904 // Finds the new WebContentsImpl by route_id, initializes it for | 902 // Finds the new WebContentsImpl by route_id, initializes it for |
905 // renderer-initiated creation, and returns it. Note that this can only be | 903 // renderer-initiated creation, and returns it. Note that this can only be |
906 // called once as this call also removes it from the internal map. | 904 // called once as this call also removes it from the internal map. |
907 WebContentsImpl* GetCreatedWindow(int route_id); | 905 WebContentsImpl* GetCreatedWindow(int route_id); |
908 | 906 |
909 // Tracking loading progress ------------------------------------------------- | 907 // Tracking loading progress ------------------------------------------------- |
910 | 908 |
911 // Resets the tracking state of the current load. | 909 // Resets the tracking state of the current load progress. |
912 void ResetLoadProgressState(); | 910 void ResetLoadProgressState(); |
913 | 911 |
914 // Calculates the progress of the current load and notifies the delegate. | 912 // Notifies the delegate that the load progress was updated. |
915 void SendLoadProgressChanged(); | 913 void SendChangeLoadProgress(); |
916 | 914 |
917 // Misc non-view stuff ------------------------------------------------------- | 915 // Misc non-view stuff ------------------------------------------------------- |
918 | 916 |
919 // Sets the history for a specified RenderViewHost to |history_length| | 917 // Sets the history for a specified RenderViewHost to |history_length| |
920 // entries, with an offset of |history_offset|. | 918 // entries, with an offset of |history_offset|. |
921 void SetHistoryOffsetAndLengthForView(RenderViewHost* render_view_host, | 919 void SetHistoryOffsetAndLengthForView(RenderViewHost* render_view_host, |
922 int history_offset, | 920 int history_offset, |
923 int history_length); | 921 int history_length); |
924 | 922 |
925 // Helper functions for sending notifications. | 923 // Helper functions for sending notifications. |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1062 | 1060 |
1063 // Map of SiteInstance ID to max page ID for this tab. A page ID is specific | 1061 // Map of SiteInstance ID to max page ID for this tab. A page ID is specific |
1064 // to a given tab and SiteInstance, and must be valid for the lifetime of the | 1062 // to a given tab and SiteInstance, and must be valid for the lifetime of the |
1065 // WebContentsImpl. | 1063 // WebContentsImpl. |
1066 std::map<int32, int32> max_page_ids_; | 1064 std::map<int32, int32> max_page_ids_; |
1067 | 1065 |
1068 // The current load state and the URL associated with it. | 1066 // The current load state and the URL associated with it. |
1069 net::LoadStateWithParam load_state_; | 1067 net::LoadStateWithParam load_state_; |
1070 base::string16 load_state_host_; | 1068 base::string16 load_state_host_; |
1071 | 1069 |
1072 double loading_total_progress_; | |
1073 | |
1074 base::TimeTicks loading_last_progress_update_; | 1070 base::TimeTicks loading_last_progress_update_; |
1075 | 1071 |
1076 // Upload progress, for displaying in the status bar. | 1072 // Upload progress, for displaying in the status bar. |
1077 // Set to zero when there is no significant upload happening. | 1073 // Set to zero when there is no significant upload happening. |
1078 uint64 upload_size_; | 1074 uint64 upload_size_; |
1079 uint64 upload_position_; | 1075 uint64 upload_position_; |
1080 | 1076 |
1081 // Data for current page ----------------------------------------------------- | 1077 // Data for current page ----------------------------------------------------- |
1082 | 1078 |
1083 // When a title cannot be taken from any entry, this title will be used. | 1079 // When a title cannot be taken from any entry, this title will be used. |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1277 // Adds/removes a callback called on creation of each new WebContents. | 1273 // Adds/removes a callback called on creation of each new WebContents. |
1278 static void AddCreatedCallbackForTesting(const CreatedCallback& callback); | 1274 static void AddCreatedCallbackForTesting(const CreatedCallback& callback); |
1279 static void RemoveCreatedCallbackForTesting(const CreatedCallback& callback); | 1275 static void RemoveCreatedCallbackForTesting(const CreatedCallback& callback); |
1280 | 1276 |
1281 DISALLOW_COPY_AND_ASSIGN(FriendZone); | 1277 DISALLOW_COPY_AND_ASSIGN(FriendZone); |
1282 }; | 1278 }; |
1283 | 1279 |
1284 } // namespace content | 1280 } // namespace content |
1285 | 1281 |
1286 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ | 1282 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ |
OLD | NEW |