diff options
author | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-23 21:00:35 +0000 |
---|---|---|
committer | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-23 21:00:35 +0000 |
commit | ce0e250dbfe0361623a7e23527c60aa3888f52f6 (patch) | |
tree | d9b6388aeaed3ec76af10804382a77ca42ef36aa /chrome | |
parent | c9a06be181e8e5781c6a4c2dcc07e1b65d5b5db1 (diff) | |
download | chromium_src-ce0e250dbfe0361623a7e23527c60aa3888f52f6.zip chromium_src-ce0e250dbfe0361623a7e23527c60aa3888f52f6.tar.gz chromium_src-ce0e250dbfe0361623a7e23527c60aa3888f52f6.tar.bz2 |
Move SearchableFormData over to the WebKit API.
BUG=24621
TEST=none
Review URL: http://codereview.chromium.org/306057
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29941 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/renderer/navigation_state.h | 14 | ||||
-rw-r--r-- | chrome/renderer/render_view.cc | 19 |
2 files changed, 17 insertions, 16 deletions
diff --git a/chrome/renderer/navigation_state.h b/chrome/renderer/navigation_state.h index ecb79fd..46031dd 100644 --- a/chrome/renderer/navigation_state.h +++ b/chrome/renderer/navigation_state.h @@ -11,7 +11,6 @@ #include "webkit/api/public/WebDataSource.h" #include "webkit/glue/alt_error_page_resource_fetcher.h" #include "webkit/glue/password_form.h" -#include "webkit/glue/searchable_form_data.h" // The RenderView stores an instance of this class in the "extra data" of each // WebDataSource (see RenderView::DidCreateDataSource). @@ -116,11 +115,13 @@ class NavigationState : public WebKit::WebDataSource::ExtraData { // True if this navigation was not initiated via WebFrame::LoadRequest. bool is_content_initiated() const { return is_content_initiated_; } - webkit_glue::SearchableFormData* searchable_form_data() const { - return searchable_form_data_.get(); + const GURL& searchable_form_url() const { return searchable_form_url_; } + void set_searchable_form_url(const GURL& url) { searchable_form_url_ = url; } + const std::string& searchable_form_encoding() const { + return searchable_form_encoding_; } - void set_searchable_form_data(webkit_glue::SearchableFormData* data) { - searchable_form_data_.reset(data); + void set_searchable_form_encoding(const std::string& encoding) { + searchable_form_encoding_ = encoding; } webkit_glue::PasswordForm* password_form_data() const { @@ -187,7 +188,8 @@ class NavigationState : public WebKit::WebDataSource::ExtraData { bool request_committed_; bool is_content_initiated_; int32 pending_page_id_; - scoped_ptr<webkit_glue::SearchableFormData> searchable_form_data_; + GURL searchable_form_url_; + std::string searchable_form_encoding_; scoped_ptr<webkit_glue::PasswordForm> password_form_data_; scoped_ptr<webkit_glue::AltErrorPageResourceFetcher> alt_error_page_fetcher_; std::string security_info_; diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc index 981bfff..3bde88e 100644 --- a/chrome/renderer/render_view.cc +++ b/chrome/renderer/render_view.cc @@ -71,6 +71,7 @@ #include "webkit/api/public/WebPoint.h" #include "webkit/api/public/WebRect.h" #include "webkit/api/public/WebScriptSource.h" +#include "webkit/api/public/WebSearchableFormData.h" #include "webkit/api/public/WebSecurityOrigin.h" #include "webkit/api/public/WebSize.h" #include "webkit/api/public/WebString.h" @@ -91,7 +92,6 @@ #include "webkit/glue/password_form.h" #include "webkit/glue/plugins/plugin_list.h" #include "webkit/glue/plugins/webplugin_delegate_impl.h" -#include "webkit/glue/searchable_form_data.h" #include "webkit/glue/webaccessibilitymanager_impl.h" #include "webkit/glue/webdropdata.h" #include "webkit/glue/webkit_glue.h" @@ -111,7 +111,6 @@ using webkit_glue::FormFieldValues; using webkit_glue::ImageResourceFetcher; using webkit_glue::PasswordForm; using webkit_glue::PasswordFormDomManager; -using webkit_glue::SearchableFormData; using WebKit::WebAccessibilityObject; using WebKit::WebColor; using WebKit::WebColorName; @@ -141,6 +140,7 @@ using WebKit::WebPopupMenuInfo; using WebKit::WebRange; using WebKit::WebRect; using WebKit::WebScriptSource; +using WebKit::WebSearchableFormData; using WebKit::WebSecurityOrigin; using WebKit::WebSettings; using WebKit::WebSize; @@ -1000,12 +1000,9 @@ void RenderView::UpdateURL(WebFrame* frame) { GetRedirectChain(ds, ¶ms.redirects); params.should_update_history = !ds->hasUnreachableURL(); - const SearchableFormData* searchable_form_data = - navigation_state->searchable_form_data(); - if (searchable_form_data) { - params.searchable_form_url = searchable_form_data->url(); - params.searchable_form_encoding = searchable_form_data->encoding(); - } + params.searchable_form_url = navigation_state->searchable_form_url(); + params.searchable_form_encoding = + navigation_state->searchable_form_encoding(); const PasswordForm* password_form_data = navigation_state->password_form_data(); @@ -1951,8 +1948,10 @@ void RenderView::willSubmitForm(WebFrame* frame, const WebForm& form) { navigation_state->set_transition_type(PageTransition::FORM_SUBMIT); // Save these to be processed when the ensuing navigation is committed. - navigation_state->set_searchable_form_data( - SearchableFormData::Create(form)); + WebSearchableFormData web_searchable_form_data(form); + navigation_state->set_searchable_form_url(web_searchable_form_data.url()); + navigation_state->set_searchable_form_encoding( + webkit_glue::WebStringToStdString(web_searchable_form_data.encoding())); navigation_state->set_password_form_data( PasswordFormDomManager::CreatePasswordForm(form)); |