| 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 2853 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2864 return WebHistoryItem(); | 2864 return WebHistoryItem(); |
| 2865 | 2865 |
| 2866 return render_view_->history_controller()->GetItemForNewChildFrame(this); | 2866 return render_view_->history_controller()->GetItemForNewChildFrame(this); |
| 2867 } | 2867 } |
| 2868 | 2868 |
| 2869 void RenderFrameImpl::willSendSubmitEvent(const blink::WebFormElement& form) { | 2869 void RenderFrameImpl::willSendSubmitEvent(const blink::WebFormElement& form) { |
| 2870 FOR_EACH_OBSERVER(RenderFrameObserver, observers_, WillSendSubmitEvent(form)); | 2870 FOR_EACH_OBSERVER(RenderFrameObserver, observers_, WillSendSubmitEvent(form)); |
| 2871 } | 2871 } |
| 2872 | 2872 |
| 2873 void RenderFrameImpl::willSubmitForm(const blink::WebFormElement& form) { | 2873 void RenderFrameImpl::willSubmitForm(const blink::WebFormElement& form) { |
| 2874 DocumentState* document_state = | 2874 // With PlzNavigate-enabled, this will be called before a DataSource has been |
| 2875 DocumentState::FromDataSource(frame_->provisionalDataSource()); | 2875 // set-up. |
| 2876 NavigationStateImpl* navigation_state = | 2876 // TODO(clamy): make sure the internal state is properly updated at some |
| 2877 static_cast<NavigationStateImpl*>(document_state->navigation_state()); | 2877 // point in the navigation. |
| 2878 InternalDocumentStateData* internal_data = | 2878 if (!IsBrowserSideNavigationEnabled()) { |
| 2879 InternalDocumentStateData::FromDocumentState(document_state); | 2879 DocumentState* document_state = |
| 2880 DocumentState::FromDataSource(frame_->provisionalDataSource()); |
| 2881 NavigationStateImpl* navigation_state = |
| 2882 static_cast<NavigationStateImpl*>(document_state->navigation_state()); |
| 2883 InternalDocumentStateData* internal_data = |
| 2884 InternalDocumentStateData::FromDocumentState(document_state); |
| 2880 | 2885 |
| 2881 if (ui::PageTransitionCoreTypeIs(navigation_state->GetTransitionType(), | 2886 if (ui::PageTransitionCoreTypeIs(navigation_state->GetTransitionType(), |
| 2882 ui::PAGE_TRANSITION_LINK)) { | 2887 ui::PAGE_TRANSITION_LINK)) { |
| 2883 navigation_state->set_transition_type(ui::PAGE_TRANSITION_FORM_SUBMIT); | 2888 navigation_state->set_transition_type(ui::PAGE_TRANSITION_FORM_SUBMIT); |
| 2889 } |
| 2890 |
| 2891 // Save these to be processed when the ensuing navigation is committed. |
| 2892 WebSearchableFormData web_searchable_form_data(form); |
| 2893 internal_data->set_searchable_form_url(web_searchable_form_data.url()); |
| 2894 internal_data->set_searchable_form_encoding( |
| 2895 web_searchable_form_data.encoding().utf8()); |
| 2884 } | 2896 } |
| 2885 | 2897 |
| 2886 // Save these to be processed when the ensuing navigation is committed. | |
| 2887 WebSearchableFormData web_searchable_form_data(form); | |
| 2888 internal_data->set_searchable_form_url(web_searchable_form_data.url()); | |
| 2889 internal_data->set_searchable_form_encoding( | |
| 2890 web_searchable_form_data.encoding().utf8()); | |
| 2891 | |
| 2892 FOR_EACH_OBSERVER(RenderFrameObserver, observers_, WillSubmitForm(form)); | 2898 FOR_EACH_OBSERVER(RenderFrameObserver, observers_, WillSubmitForm(form)); |
| 2893 } | 2899 } |
| 2894 | 2900 |
| 2895 void RenderFrameImpl::didCreateDataSource(blink::WebLocalFrame* frame, | 2901 void RenderFrameImpl::didCreateDataSource(blink::WebLocalFrame* frame, |
| 2896 blink::WebDataSource* datasource) { | 2902 blink::WebDataSource* datasource) { |
| 2897 DCHECK(!frame_ || frame_ == frame); | 2903 DCHECK(!frame_ || frame_ == frame); |
| 2898 | 2904 |
| 2899 bool content_initiated = !pending_navigation_params_.get(); | 2905 bool content_initiated = !pending_navigation_params_.get(); |
| 2900 | 2906 |
| 2901 // Make sure any previous redirect URLs end up in our new data source. | 2907 // Make sure any previous redirect URLs end up in our new data source. |
| (...skipping 3220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6122 int match_count, | 6128 int match_count, |
| 6123 int ordinal, | 6129 int ordinal, |
| 6124 const WebRect& selection_rect, | 6130 const WebRect& selection_rect, |
| 6125 bool final_status_update) { | 6131 bool final_status_update) { |
| 6126 Send(new FrameHostMsg_Find_Reply(routing_id_, request_id, match_count, | 6132 Send(new FrameHostMsg_Find_Reply(routing_id_, request_id, match_count, |
| 6127 selection_rect, ordinal, | 6133 selection_rect, ordinal, |
| 6128 final_status_update)); | 6134 final_status_update)); |
| 6129 } | 6135 } |
| 6130 | 6136 |
| 6131 } // namespace content | 6137 } // namespace content |
| OLD | NEW |