| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "content/renderer/render_frame_impl.h" | 5 #include "content/renderer/render_frame_impl.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 3581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3592 // If this is a provisional frame associated with a proxy (i.e., a frame | 3592 // If this is a provisional frame associated with a proxy (i.e., a frame |
| 3593 // created for a remote-to-local navigation), swap it into the frame tree | 3593 // created for a remote-to-local navigation), swap it into the frame tree |
| 3594 // now. | 3594 // now. |
| 3595 if (!SwapIn()) | 3595 if (!SwapIn()) |
| 3596 return; | 3596 return; |
| 3597 } | 3597 } |
| 3598 | 3598 |
| 3599 // For new page navigations, the browser process needs to be notified of the | 3599 // For new page navigations, the browser process needs to be notified of the |
| 3600 // first paint of that page, so it can cancel the timer that waits for it. | 3600 // first paint of that page, so it can cancel the timer that waits for it. |
| 3601 if (is_main_frame_ && !navigation_state->WasWithinSamePage()) { | 3601 if (is_main_frame_ && !navigation_state->WasWithinSamePage()) { |
| 3602 GetRenderWidget()->IncrementContentSourceId(); |
| 3602 render_view_->QueueMessage( | 3603 render_view_->QueueMessage( |
| 3603 new ViewHostMsg_DidFirstPaintAfterLoad(render_view_->routing_id_), | 3604 new ViewHostMsg_DidFirstPaintAfterLoad(render_view_->routing_id_), |
| 3604 MESSAGE_DELIVERY_POLICY_WITH_VISUAL_STATE); | 3605 MESSAGE_DELIVERY_POLICY_WITH_VISUAL_STATE); |
| 3605 } | 3606 } |
| 3606 | 3607 |
| 3607 // When we perform a new navigation, we need to update the last committed | 3608 // When we perform a new navigation, we need to update the last committed |
| 3608 // session history entry with state for the page we are leaving. Do this | 3609 // session history entry with state for the page we are leaving. Do this |
| 3609 // before updating the current history item. | 3610 // before updating the current history item. |
| 3610 SendUpdateState(); | 3611 SendUpdateState(); |
| 3611 | 3612 |
| (...skipping 1252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4864 | 4865 |
| 4865 params.gesture = render_view_->navigation_gesture_; | 4866 params.gesture = render_view_->navigation_gesture_; |
| 4866 render_view_->navigation_gesture_ = NavigationGestureUnknown; | 4867 render_view_->navigation_gesture_ = NavigationGestureUnknown; |
| 4867 | 4868 |
| 4868 // Make navigation state a part of the DidCommitProvisionalLoad message so | 4869 // Make navigation state a part of the DidCommitProvisionalLoad message so |
| 4869 // that committed entry has it at all times. Send a single HistoryItem for | 4870 // that committed entry has it at all times. Send a single HistoryItem for |
| 4870 // this frame, rather than the whole tree. It will be stored in the | 4871 // this frame, rather than the whole tree. It will be stored in the |
| 4871 // corresponding FrameNavigationEntry. | 4872 // corresponding FrameNavigationEntry. |
| 4872 params.page_state = SingleHistoryItemToPageState(item); | 4873 params.page_state = SingleHistoryItemToPageState(item); |
| 4873 | 4874 |
| 4875 params.content_source_id = GetRenderWidget()->GetContentSourceId(); |
| 4876 |
| 4874 params.method = request.httpMethod().latin1(); | 4877 params.method = request.httpMethod().latin1(); |
| 4875 if (params.method == "POST") | 4878 if (params.method == "POST") |
| 4876 params.post_id = ExtractPostId(item); | 4879 params.post_id = ExtractPostId(item); |
| 4877 | 4880 |
| 4878 params.frame_unique_name = item.target().utf8(); | 4881 params.frame_unique_name = item.target().utf8(); |
| 4879 params.item_sequence_number = item.itemSequenceNumber(); | 4882 params.item_sequence_number = item.itemSequenceNumber(); |
| 4880 params.document_sequence_number = item.documentSequenceNumber(); | 4883 params.document_sequence_number = item.documentSequenceNumber(); |
| 4881 | 4884 |
| 4882 // If the page contained a client redirect (meta refresh, document.loc...), | 4885 // If the page contained a client redirect (meta refresh, document.loc...), |
| 4883 // set the referrer appropriately. | 4886 // set the referrer appropriately. |
| (...skipping 1959 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6843 // event target. Potentially a Pepper plugin will receive the event. | 6846 // event target. Potentially a Pepper plugin will receive the event. |
| 6844 // In order to tell whether a plugin gets the last mouse event and which it | 6847 // In order to tell whether a plugin gets the last mouse event and which it |
| 6845 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets | 6848 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets |
| 6846 // the event, it will notify us via DidReceiveMouseEvent() and set itself as | 6849 // the event, it will notify us via DidReceiveMouseEvent() and set itself as |
| 6847 // |pepper_last_mouse_event_target_|. | 6850 // |pepper_last_mouse_event_target_|. |
| 6848 pepper_last_mouse_event_target_ = nullptr; | 6851 pepper_last_mouse_event_target_ = nullptr; |
| 6849 #endif | 6852 #endif |
| 6850 } | 6853 } |
| 6851 | 6854 |
| 6852 } // namespace content | 6855 } // namespace content |
| OLD | NEW |