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

Side by Side Diff: chrome/renderer/render_view.cc

Issue 306057: Move SearchableFormData over to the WebKit API. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « chrome/renderer/navigation_state.h ('k') | webkit/api/public/WebSearchableFormData.h » ('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 (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 "chrome/renderer/render_view.h" 5 #include "chrome/renderer/render_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 #include "webkit/api/public/WebDataSource.h" 64 #include "webkit/api/public/WebDataSource.h"
65 #include "webkit/api/public/WebDevToolsAgentClient.h" 65 #include "webkit/api/public/WebDevToolsAgentClient.h"
66 #include "webkit/api/public/WebDragData.h" 66 #include "webkit/api/public/WebDragData.h"
67 #include "webkit/api/public/WebForm.h" 67 #include "webkit/api/public/WebForm.h"
68 #include "webkit/api/public/WebFrame.h" 68 #include "webkit/api/public/WebFrame.h"
69 #include "webkit/api/public/WebHistoryItem.h" 69 #include "webkit/api/public/WebHistoryItem.h"
70 #include "webkit/api/public/WebNode.h" 70 #include "webkit/api/public/WebNode.h"
71 #include "webkit/api/public/WebPoint.h" 71 #include "webkit/api/public/WebPoint.h"
72 #include "webkit/api/public/WebRect.h" 72 #include "webkit/api/public/WebRect.h"
73 #include "webkit/api/public/WebScriptSource.h" 73 #include "webkit/api/public/WebScriptSource.h"
74 #include "webkit/api/public/WebSearchableFormData.h"
74 #include "webkit/api/public/WebSecurityOrigin.h" 75 #include "webkit/api/public/WebSecurityOrigin.h"
75 #include "webkit/api/public/WebSize.h" 76 #include "webkit/api/public/WebSize.h"
76 #include "webkit/api/public/WebString.h" 77 #include "webkit/api/public/WebString.h"
77 #include "webkit/api/public/WebURL.h" 78 #include "webkit/api/public/WebURL.h"
78 #include "webkit/api/public/WebURLError.h" 79 #include "webkit/api/public/WebURLError.h"
79 #include "webkit/api/public/WebURLRequest.h" 80 #include "webkit/api/public/WebURLRequest.h"
80 #include "webkit/api/public/WebURLResponse.h" 81 #include "webkit/api/public/WebURLResponse.h"
81 #include "webkit/api/public/WebVector.h" 82 #include "webkit/api/public/WebVector.h"
82 #include "webkit/appcache/appcache_interfaces.h" 83 #include "webkit/appcache/appcache_interfaces.h"
83 #include "webkit/default_plugin/default_plugin_shared.h" 84 #include "webkit/default_plugin/default_plugin_shared.h"
84 #include "webkit/glue/glue_serialize.h" 85 #include "webkit/glue/glue_serialize.h"
85 #include "webkit/glue/glue_util.h" 86 #include "webkit/glue/glue_util.h"
86 #include "webkit/glue/dom_operations.h" 87 #include "webkit/glue/dom_operations.h"
87 #include "webkit/glue/dom_serializer.h" 88 #include "webkit/glue/dom_serializer.h"
88 #include "webkit/glue/image_decoder.h" 89 #include "webkit/glue/image_decoder.h"
89 #include "webkit/glue/media/buffered_data_source.h" 90 #include "webkit/glue/media/buffered_data_source.h"
90 #include "webkit/glue/media/simple_data_source.h" 91 #include "webkit/glue/media/simple_data_source.h"
91 #include "webkit/glue/password_form.h" 92 #include "webkit/glue/password_form.h"
92 #include "webkit/glue/plugins/plugin_list.h" 93 #include "webkit/glue/plugins/plugin_list.h"
93 #include "webkit/glue/plugins/webplugin_delegate_impl.h" 94 #include "webkit/glue/plugins/webplugin_delegate_impl.h"
94 #include "webkit/glue/searchable_form_data.h"
95 #include "webkit/glue/webaccessibilitymanager_impl.h" 95 #include "webkit/glue/webaccessibilitymanager_impl.h"
96 #include "webkit/glue/webdropdata.h" 96 #include "webkit/glue/webdropdata.h"
97 #include "webkit/glue/webkit_glue.h" 97 #include "webkit/glue/webkit_glue.h"
98 #include "webkit/glue/webmediaplayer_impl.h" 98 #include "webkit/glue/webmediaplayer_impl.h"
99 #include "webkit/glue/webplugin_impl.h" 99 #include "webkit/glue/webplugin_impl.h"
100 100
101 #if defined(OS_WIN) 101 #if defined(OS_WIN)
102 // TODO(port): these files are currently Windows only because they concern: 102 // TODO(port): these files are currently Windows only because they concern:
103 // * theming 103 // * theming
104 #include "app/gfx/native_theme_win.h" 104 #include "app/gfx/native_theme_win.h"
105 #endif 105 #endif
106 106
107 using base::Time; 107 using base::Time;
108 using base::TimeDelta; 108 using base::TimeDelta;
109 using webkit_glue::AltErrorPageResourceFetcher; 109 using webkit_glue::AltErrorPageResourceFetcher;
110 using webkit_glue::FormFieldValues; 110 using webkit_glue::FormFieldValues;
111 using webkit_glue::ImageResourceFetcher; 111 using webkit_glue::ImageResourceFetcher;
112 using webkit_glue::PasswordForm; 112 using webkit_glue::PasswordForm;
113 using webkit_glue::PasswordFormDomManager; 113 using webkit_glue::PasswordFormDomManager;
114 using webkit_glue::SearchableFormData;
115 using WebKit::WebAccessibilityObject; 114 using WebKit::WebAccessibilityObject;
116 using WebKit::WebColor; 115 using WebKit::WebColor;
117 using WebKit::WebColorName; 116 using WebKit::WebColorName;
118 using WebKit::WebConsoleMessage; 117 using WebKit::WebConsoleMessage;
119 using WebKit::WebContextMenuData; 118 using WebKit::WebContextMenuData;
120 using WebKit::WebData; 119 using WebKit::WebData;
121 using WebKit::WebDataSource; 120 using WebKit::WebDataSource;
122 using WebKit::WebDevToolsAgentClient; 121 using WebKit::WebDevToolsAgentClient;
123 using WebKit::WebDragData; 122 using WebKit::WebDragData;
124 using WebKit::WebDragOperation; 123 using WebKit::WebDragOperation;
125 using WebKit::WebDragOperationsMask; 124 using WebKit::WebDragOperationsMask;
126 using WebKit::WebEditingAction; 125 using WebKit::WebEditingAction;
127 using WebKit::WebFindOptions; 126 using WebKit::WebFindOptions;
128 using WebKit::WebForm; 127 using WebKit::WebForm;
129 using WebKit::WebFrame; 128 using WebKit::WebFrame;
130 using WebKit::WebHistoryItem; 129 using WebKit::WebHistoryItem;
131 using WebKit::WebMediaPlayer; 130 using WebKit::WebMediaPlayer;
132 using WebKit::WebMediaPlayerAction; 131 using WebKit::WebMediaPlayerAction;
133 using WebKit::WebMediaPlayerClient; 132 using WebKit::WebMediaPlayerClient;
134 using WebKit::WebNavigationPolicy; 133 using WebKit::WebNavigationPolicy;
135 using WebKit::WebNavigationType; 134 using WebKit::WebNavigationType;
136 using WebKit::WebNode; 135 using WebKit::WebNode;
137 using WebKit::WebPlugin; 136 using WebKit::WebPlugin;
138 using WebKit::WebPluginParams; 137 using WebKit::WebPluginParams;
139 using WebKit::WebPoint; 138 using WebKit::WebPoint;
140 using WebKit::WebPopupMenuInfo; 139 using WebKit::WebPopupMenuInfo;
141 using WebKit::WebRange; 140 using WebKit::WebRange;
142 using WebKit::WebRect; 141 using WebKit::WebRect;
143 using WebKit::WebScriptSource; 142 using WebKit::WebScriptSource;
143 using WebKit::WebSearchableFormData;
144 using WebKit::WebSecurityOrigin; 144 using WebKit::WebSecurityOrigin;
145 using WebKit::WebSettings; 145 using WebKit::WebSettings;
146 using WebKit::WebSize; 146 using WebKit::WebSize;
147 using WebKit::WebString; 147 using WebKit::WebString;
148 using WebKit::WebTextAffinity; 148 using WebKit::WebTextAffinity;
149 using WebKit::WebTextDirection; 149 using WebKit::WebTextDirection;
150 using WebKit::WebURL; 150 using WebKit::WebURL;
151 using WebKit::WebURLError; 151 using WebKit::WebURLError;
152 using WebKit::WebURLRequest; 152 using WebKit::WebURLRequest;
153 using WebKit::WebURLResponse; 153 using WebKit::WebURLResponse;
(...skipping 839 matching lines...) Expand 10 before | Expand all | Expand 10 after
993 // Set the URL to be displayed in the browser UI to the user. 993 // Set the URL to be displayed in the browser UI to the user.
994 if (ds->hasUnreachableURL()) { 994 if (ds->hasUnreachableURL()) {
995 params.url = ds->unreachableURL(); 995 params.url = ds->unreachableURL();
996 } else { 996 } else {
997 params.url = request.url(); 997 params.url = request.url();
998 } 998 }
999 999
1000 GetRedirectChain(ds, &params.redirects); 1000 GetRedirectChain(ds, &params.redirects);
1001 params.should_update_history = !ds->hasUnreachableURL(); 1001 params.should_update_history = !ds->hasUnreachableURL();
1002 1002
1003 const SearchableFormData* searchable_form_data = 1003 params.searchable_form_url = navigation_state->searchable_form_url();
1004 navigation_state->searchable_form_data(); 1004 params.searchable_form_encoding =
1005 if (searchable_form_data) { 1005 navigation_state->searchable_form_encoding();
1006 params.searchable_form_url = searchable_form_data->url();
1007 params.searchable_form_encoding = searchable_form_data->encoding();
1008 }
1009 1006
1010 const PasswordForm* password_form_data = 1007 const PasswordForm* password_form_data =
1011 navigation_state->password_form_data(); 1008 navigation_state->password_form_data();
1012 if (password_form_data) 1009 if (password_form_data)
1013 params.password_form = *password_form_data; 1010 params.password_form = *password_form_data;
1014 1011
1015 params.gesture = navigation_gesture_; 1012 params.gesture = navigation_gesture_;
1016 navigation_gesture_ = NavigationGestureUnknown; 1013 navigation_gesture_ = NavigationGestureUnknown;
1017 1014
1018 if (!frame->parent()) { 1015 if (!frame->parent()) {
(...skipping 925 matching lines...) Expand 10 before | Expand all | Expand 10 after
1944 } 1941 }
1945 1942
1946 void RenderView::willSubmitForm(WebFrame* frame, const WebForm& form) { 1943 void RenderView::willSubmitForm(WebFrame* frame, const WebForm& form) {
1947 NavigationState* navigation_state = 1944 NavigationState* navigation_state =
1948 NavigationState::FromDataSource(frame->provisionalDataSource()); 1945 NavigationState::FromDataSource(frame->provisionalDataSource());
1949 1946
1950 if (navigation_state->transition_type() == PageTransition::LINK) 1947 if (navigation_state->transition_type() == PageTransition::LINK)
1951 navigation_state->set_transition_type(PageTransition::FORM_SUBMIT); 1948 navigation_state->set_transition_type(PageTransition::FORM_SUBMIT);
1952 1949
1953 // Save these to be processed when the ensuing navigation is committed. 1950 // Save these to be processed when the ensuing navigation is committed.
1954 navigation_state->set_searchable_form_data( 1951 WebSearchableFormData web_searchable_form_data(form);
1955 SearchableFormData::Create(form)); 1952 navigation_state->set_searchable_form_url(web_searchable_form_data.url());
1953 navigation_state->set_searchable_form_encoding(
1954 webkit_glue::WebStringToStdString(web_searchable_form_data.encoding()));
1956 navigation_state->set_password_form_data( 1955 navigation_state->set_password_form_data(
1957 PasswordFormDomManager::CreatePasswordForm(form)); 1956 PasswordFormDomManager::CreatePasswordForm(form));
1958 1957
1959 if (form.isAutoCompleteEnabled()) { 1958 if (form.isAutoCompleteEnabled()) {
1960 scoped_ptr<FormFieldValues> form_values(FormFieldValues::Create(form)); 1959 scoped_ptr<FormFieldValues> form_values(FormFieldValues::Create(form));
1961 if (form_values.get()) 1960 if (form_values.get())
1962 Send(new ViewHostMsg_FormFieldValuesSubmitted(routing_id_, 1961 Send(new ViewHostMsg_FormFieldValuesSubmitted(routing_id_,
1963 *form_values)); 1962 *form_values));
1964 } 1963 }
1965 } 1964 }
(...skipping 1682 matching lines...) Expand 10 before | Expand all | Expand 10 after
3648 new PluginMsg_SignalModalDialogEvent(host_window_)); 3647 new PluginMsg_SignalModalDialogEvent(host_window_));
3649 3648
3650 message->EnableMessagePumping(); // Runs a nested message loop. 3649 message->EnableMessagePumping(); // Runs a nested message loop.
3651 bool rv = Send(message); 3650 bool rv = Send(message);
3652 3651
3653 PluginChannelHost::Broadcast( 3652 PluginChannelHost::Broadcast(
3654 new PluginMsg_ResetModalDialogEvent(host_window_)); 3653 new PluginMsg_ResetModalDialogEvent(host_window_));
3655 3654
3656 return rv; 3655 return rv;
3657 } 3656 }
OLDNEW
« no previous file with comments | « chrome/renderer/navigation_state.h ('k') | webkit/api/public/WebSearchableFormData.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698