Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(401)

Side by Side Diff: content/renderer/render_frame_impl.cc

Issue 1767693002: Revert of PlzNavigate: inform the WebFrameClient that a form will be submitted (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | testing/buildbot/filters/browser-side-navigation.linux.browser_tests.filter » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 2860 matching lines...) Expand 10 before | Expand all | Expand 10 after
2871 return WebHistoryItem(); 2871 return WebHistoryItem();
2872 2872
2873 return render_view_->history_controller()->GetItemForNewChildFrame(this); 2873 return render_view_->history_controller()->GetItemForNewChildFrame(this);
2874 } 2874 }
2875 2875
2876 void RenderFrameImpl::willSendSubmitEvent(const blink::WebFormElement& form) { 2876 void RenderFrameImpl::willSendSubmitEvent(const blink::WebFormElement& form) {
2877 FOR_EACH_OBSERVER(RenderFrameObserver, observers_, WillSendSubmitEvent(form)); 2877 FOR_EACH_OBSERVER(RenderFrameObserver, observers_, WillSendSubmitEvent(form));
2878 } 2878 }
2879 2879
2880 void RenderFrameImpl::willSubmitForm(const blink::WebFormElement& form) { 2880 void RenderFrameImpl::willSubmitForm(const blink::WebFormElement& form) {
2881 // With PlzNavigate-enabled, this will be called before a DataSource has been 2881 DocumentState* document_state =
2882 // set-up. 2882 DocumentState::FromDataSource(frame_->provisionalDataSource());
2883 // TODO(clamy): make sure the internal state is properly updated at some 2883 NavigationStateImpl* navigation_state =
2884 // point in the navigation. 2884 static_cast<NavigationStateImpl*>(document_state->navigation_state());
2885 if (!IsBrowserSideNavigationEnabled()) { 2885 InternalDocumentStateData* internal_data =
2886 DocumentState* document_state = 2886 InternalDocumentStateData::FromDocumentState(document_state);
2887 DocumentState::FromDataSource(frame_->provisionalDataSource());
2888 NavigationStateImpl* navigation_state =
2889 static_cast<NavigationStateImpl*>(document_state->navigation_state());
2890 InternalDocumentStateData* internal_data =
2891 InternalDocumentStateData::FromDocumentState(document_state);
2892 2887
2893 if (ui::PageTransitionCoreTypeIs(navigation_state->GetTransitionType(), 2888 if (ui::PageTransitionCoreTypeIs(navigation_state->GetTransitionType(),
2894 ui::PAGE_TRANSITION_LINK)) { 2889 ui::PAGE_TRANSITION_LINK)) {
2895 navigation_state->set_transition_type(ui::PAGE_TRANSITION_FORM_SUBMIT); 2890 navigation_state->set_transition_type(ui::PAGE_TRANSITION_FORM_SUBMIT);
2896 } 2891 }
2897 2892
2898 // Save these to be processed when the ensuing navigation is committed. 2893 // Save these to be processed when the ensuing navigation is committed.
2899 WebSearchableFormData web_searchable_form_data(form); 2894 WebSearchableFormData web_searchable_form_data(form);
2900 internal_data->set_searchable_form_url(web_searchable_form_data.url()); 2895 internal_data->set_searchable_form_url(web_searchable_form_data.url());
2901 internal_data->set_searchable_form_encoding( 2896 internal_data->set_searchable_form_encoding(
2902 web_searchable_form_data.encoding().utf8()); 2897 web_searchable_form_data.encoding().utf8());
2903 }
2904 2898
2905 FOR_EACH_OBSERVER(RenderFrameObserver, observers_, WillSubmitForm(form)); 2899 FOR_EACH_OBSERVER(RenderFrameObserver, observers_, WillSubmitForm(form));
2906 } 2900 }
2907 2901
2908 void RenderFrameImpl::didCreateDataSource(blink::WebLocalFrame* frame, 2902 void RenderFrameImpl::didCreateDataSource(blink::WebLocalFrame* frame,
2909 blink::WebDataSource* datasource) { 2903 blink::WebDataSource* datasource) {
2910 DCHECK(!frame_ || frame_ == frame); 2904 DCHECK(!frame_ || frame_ == frame);
2911 2905
2912 bool content_initiated = !pending_navigation_params_.get(); 2906 bool content_initiated = !pending_navigation_params_.get();
2913 2907
(...skipping 3206 matching lines...) Expand 10 before | Expand all | Expand 10 after
6120 int match_count, 6114 int match_count,
6121 int ordinal, 6115 int ordinal,
6122 const WebRect& selection_rect, 6116 const WebRect& selection_rect,
6123 bool final_status_update) { 6117 bool final_status_update) {
6124 Send(new FrameHostMsg_Find_Reply(routing_id_, request_id, match_count, 6118 Send(new FrameHostMsg_Find_Reply(routing_id_, request_id, match_count,
6125 selection_rect, ordinal, 6119 selection_rect, ordinal,
6126 final_status_update)); 6120 final_status_update));
6127 } 6121 }
6128 6122
6129 } // namespace content 6123 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | testing/buildbot/filters/browser-side-navigation.linux.browser_tests.filter » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698