diff options
author | isherman@chromium.org <isherman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-15 02:25:08 +0000 |
---|---|---|
committer | isherman@chromium.org <isherman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-15 02:25:08 +0000 |
commit | 9c4bf23a4cde497b8bad3f89b60457841470618c (patch) | |
tree | 9674d3732608fb126f685bd9b780fe5a8bd7fe14 /webkit | |
parent | 57dcbc4dd5cbb0f88b348b775ad0a2b130bcafdd (diff) | |
download | chromium_src-9c4bf23a4cde497b8bad3f89b60457841470618c.zip chromium_src-9c4bf23a4cde497b8bad3f89b60457841470618c.tar.gz chromium_src-9c4bf23a4cde497b8bad3f89b60457841470618c.tar.bz2 |
Group forms-related files in webkit/glue in a forms/ subdirectory.
BUG=none
TEST=compiles
Review URL: http://codereview.chromium.org/8680040
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@114581 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/forms/OWNERS | 2 | ||||
-rw-r--r-- | webkit/forms/form_data.cc (renamed from webkit/glue/form_data.cc) | 8 | ||||
-rw-r--r-- | webkit/forms/form_data.h (renamed from webkit/glue/form_data.h) | 18 | ||||
-rw-r--r-- | webkit/forms/form_data_predictions.cc (renamed from webkit/glue/form_data_predictions.cc) | 8 | ||||
-rw-r--r-- | webkit/forms/form_data_predictions.h (renamed from webkit/glue/form_data_predictions.h) | 20 | ||||
-rw-r--r-- | webkit/forms/form_field.cc (renamed from webkit/glue/form_field.cc) | 8 | ||||
-rw-r--r-- | webkit/forms/form_field.h (renamed from webkit/glue/form_field.h) | 18 | ||||
-rw-r--r-- | webkit/forms/form_field_predictions.cc (renamed from webkit/glue/form_field_predictions.cc) | 8 | ||||
-rw-r--r-- | webkit/forms/form_field_predictions.h (renamed from webkit/glue/form_field_predictions.h) | 18 | ||||
-rw-r--r-- | webkit/forms/password_form.cc (renamed from webkit/glue/password_form.cc) | 10 | ||||
-rw-r--r-- | webkit/forms/password_form.h (renamed from webkit/glue/password_form.h) | 18 | ||||
-rw-r--r-- | webkit/forms/password_form_dom_manager.cc (renamed from webkit/glue/password_form_dom_manager.cc) | 10 | ||||
-rw-r--r-- | webkit/forms/password_form_dom_manager.h (renamed from webkit/glue/password_form_dom_manager.h) | 24 | ||||
-rw-r--r-- | webkit/forms/webkit_forms_export.h | 26 | ||||
-rw-r--r-- | webkit/glue/webkit_glue.gypi | 26 |
15 files changed, 138 insertions, 84 deletions
diff --git a/webkit/forms/OWNERS b/webkit/forms/OWNERS new file mode 100644 index 0000000..27f4c6e --- /dev/null +++ b/webkit/forms/OWNERS @@ -0,0 +1,2 @@ +dhollowa@chromium.org +isherman@chromium.org diff --git a/webkit/glue/form_data.cc b/webkit/forms/form_data.cc index 07b0613..ea85146 100644 --- a/webkit/glue/form_data.cc +++ b/webkit/forms/form_data.cc @@ -2,11 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "webkit/glue/form_data.h" +#include "webkit/forms/form_data.h" #include "base/string_util.h" -namespace webkit_glue { +namespace webkit { +namespace forms { FormData::FormData() : user_submitted(false) { @@ -33,4 +34,5 @@ bool FormData::operator==(const FormData& form) const { fields == form.fields); } -} // namespace webkit_glue +} // namespace forms +} // namespace webkit diff --git a/webkit/glue/form_data.h b/webkit/forms/form_data.h index ee0f527..da9b0e8 100644 --- a/webkit/glue/form_data.h +++ b/webkit/forms/form_data.h @@ -2,20 +2,21 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_GLUE_FORM_DATA_H__ -#define WEBKIT_GLUE_FORM_DATA_H__ +#ifndef WEBKIT_FORMS_FORM_DATA_H__ +#define WEBKIT_FORMS_FORM_DATA_H__ #include <vector> #include "base/string16.h" #include "googleurl/src/gurl.h" -#include "webkit/glue/form_field.h" -#include "webkit/glue/webkit_glue_export.h" +#include "webkit/forms/form_field.h" +#include "webkit/forms/webkit_forms_export.h" -namespace webkit_glue { +namespace webkit { +namespace forms { // Holds information about a form to be filled and/or submitted. -struct WEBKIT_GLUE_EXPORT FormData { +struct WEBKIT_FORMS_EXPORT FormData { // The name of the form. string16 name; // GET or POST. @@ -37,6 +38,7 @@ struct WEBKIT_GLUE_EXPORT FormData { bool operator==(const FormData& form) const; }; -} // namespace webkit_glue +} // namespace forms +} // namespace webkit -#endif // WEBKIT_GLUE_FORM_DATA_H__ +#endif // WEBKIT_FORMS_FORM_DATA_H__ diff --git a/webkit/glue/form_data_predictions.cc b/webkit/forms/form_data_predictions.cc index e3ddf70..62d9a0e 100644 --- a/webkit/glue/form_data_predictions.cc +++ b/webkit/forms/form_data_predictions.cc @@ -2,9 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "webkit/glue/form_data_predictions.h" +#include "webkit/forms/form_data_predictions.h" -namespace webkit_glue { +namespace webkit { +namespace forms { FormDataPredictions::FormDataPredictions() { } @@ -19,4 +20,5 @@ FormDataPredictions::FormDataPredictions(const FormDataPredictions& other) FormDataPredictions::~FormDataPredictions() { } -} // namespace webkit_glue +} // namespace forms +} // namespace webkit diff --git a/webkit/glue/form_data_predictions.h b/webkit/forms/form_data_predictions.h index 6e92e13..df3015a 100644 --- a/webkit/glue/form_data_predictions.h +++ b/webkit/forms/form_data_predictions.h @@ -2,20 +2,21 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_GLUE_FORM_DATA_PREDICTIONS_H__ -#define WEBKIT_GLUE_FORM_DATA_PREDICTIONS_H__ +#ifndef WEBKIT_FORMS_FORM_DATA_PREDICTIONS_H__ +#define WEBKIT_FORMS_FORM_DATA_PREDICTIONS_H__ #include <string> #include <vector> -#include "webkit/glue/form_data.h" -#include "webkit/glue/form_field_predictions.h" -#include "webkit/glue/webkit_glue_export.h" +#include "webkit/forms/form_data.h" +#include "webkit/forms/form_field_predictions.h" +#include "webkit/forms/webkit_forms_export.h" -namespace webkit_glue { +namespace webkit { +namespace forms { // Holds information about a form to be filled and/or submitted. -struct WEBKIT_GLUE_EXPORT FormDataPredictions { +struct WEBKIT_FORMS_EXPORT FormDataPredictions { // Data for this form. FormData data; // The form signature for communication with the crowdsourcing server. @@ -30,6 +31,7 @@ struct WEBKIT_GLUE_EXPORT FormDataPredictions { ~FormDataPredictions(); }; -} // namespace webkit_glue +} // namespace forms +} // namespace webkit -#endif // WEBKIT_GLUE_FORM_DATA_PREDICTIONS_H__ +#endif // WEBKIT_FORMS_FORM_DATA_PREDICTIONS_H__ diff --git a/webkit/glue/form_field.cc b/webkit/forms/form_field.cc index d9843b9..1c9a0a7 100644 --- a/webkit/glue/form_field.cc +++ b/webkit/forms/form_field.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "webkit/glue/form_field.h" +#include "webkit/forms/form_field.h" #include "base/string_util.h" #include "base/utf_string_conversions.h" @@ -17,7 +17,8 @@ using WebKit::WebOptionElement; using WebKit::WebSelectElement; using WebKit::WebVector; -namespace webkit_glue { +namespace webkit { +namespace forms { FormField::FormField() : max_length(0), @@ -64,4 +65,5 @@ std::ostream& operator<<(std::ostream& os, const FormField& field) { << (field.should_autocomplete ? "true" : "false"); } -} // namespace webkit_glue +} // namespace forms +} // namespace webkit diff --git a/webkit/glue/form_field.h b/webkit/forms/form_field.h index a8480cd..d1b17c0 100644 --- a/webkit/glue/form_field.h +++ b/webkit/forms/form_field.h @@ -2,19 +2,20 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_GLUE_FORM_FIELD_H_ -#define WEBKIT_GLUE_FORM_FIELD_H_ +#ifndef WEBKIT_FORMS_FORM_FIELD_H_ +#define WEBKIT_FORMS_FORM_FIELD_H_ #include <vector> #include "base/string16.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebFormControlElement.h" -#include "webkit/glue/webkit_glue_export.h" +#include "webkit/forms/webkit_forms_export.h" -namespace webkit_glue { +namespace webkit { +namespace forms { // Stores information about a field in a form. -struct WEBKIT_GLUE_EXPORT FormField { +struct WEBKIT_FORMS_EXPORT FormField { FormField(); virtual ~FormField(); @@ -42,10 +43,11 @@ struct WEBKIT_GLUE_EXPORT FormField { }; // So we can compare FormFields with EXPECT_EQ(). -WEBKIT_GLUE_EXPORT std::ostream& operator<<(std::ostream& os, +WEBKIT_FORMS_EXPORT std::ostream& operator<<(std::ostream& os, const FormField& field); -} // namespace webkit_glue +} // namespace forms +} // namespace webkit // Prefer to use this macro in place of |EXPECT_EQ()| for comparing |FormField|s // in test code. @@ -60,4 +62,4 @@ WEBKIT_GLUE_EXPORT std::ostream& operator<<(std::ostream& os, EXPECT_EQ(expected.is_autofilled, actual.is_autofilled); \ } while (0) -#endif // WEBKIT_GLUE_FORM_FIELD_H_ +#endif // WEBKIT_FORMS_FORM_FIELD_H_ diff --git a/webkit/glue/form_field_predictions.cc b/webkit/forms/form_field_predictions.cc index 11383bd..3f0cd1e 100644 --- a/webkit/glue/form_field_predictions.cc +++ b/webkit/forms/form_field_predictions.cc @@ -2,9 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "webkit/glue/form_field_predictions.h" +#include "webkit/forms/form_field_predictions.h" -namespace webkit_glue { +namespace webkit { +namespace forms { FormFieldPredictions::FormFieldPredictions() { } @@ -20,4 +21,5 @@ FormFieldPredictions::FormFieldPredictions(const FormFieldPredictions& other) FormFieldPredictions::~FormFieldPredictions() { } -} // namespace webkit_glue +} // namespace forms +} // namespace webkit diff --git a/webkit/glue/form_field_predictions.h b/webkit/forms/form_field_predictions.h index b4cf51d..95f2d82 100644 --- a/webkit/glue/form_field_predictions.h +++ b/webkit/forms/form_field_predictions.h @@ -2,19 +2,20 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_GLUE_FORM_FIELD_PREDICTIONS_H_ -#define WEBKIT_GLUE_FORM_FIELD_PREDICTIONS_H_ +#ifndef WEBKIT_FORMS_FORM_FIELD_PREDICTIONS_H_ +#define WEBKIT_FORMS_FORM_FIELD_PREDICTIONS_H_ #include <string> #include <vector> -#include "webkit/glue/form_field.h" -#include "webkit/glue/webkit_glue_export.h" +#include "webkit/forms/form_field.h" +#include "webkit/forms/webkit_forms_export.h" -namespace webkit_glue { +namespace webkit { +namespace forms { // Stores information about a field in a form. -struct WEBKIT_GLUE_EXPORT FormFieldPredictions { +struct WEBKIT_FORMS_EXPORT FormFieldPredictions { FormFieldPredictions(); FormFieldPredictions(const FormFieldPredictions& other); ~FormFieldPredictions(); @@ -26,6 +27,7 @@ struct WEBKIT_GLUE_EXPORT FormFieldPredictions { std::string overall_type; }; -} // namespace webkit_glue +} // namespace forms +} // namespace webkit -#endif // WEBKIT_GLUE_FORM_FIELD_PREDICTIONS_H_ +#endif // WEBKIT_FORMS_FORM_FIELD_PREDICTIONS_H_ diff --git a/webkit/glue/password_form.cc b/webkit/forms/password_form.cc index 97777dc..0d9ad04 100644 --- a/webkit/glue/password_form.cc +++ b/webkit/forms/password_form.cc @@ -1,10 +1,11 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "webkit/glue/password_form.h" +#include "webkit/forms/password_form.h" -namespace webkit_glue { +namespace webkit { +namespace forms { PasswordForm::PasswordForm() : scheme(SCHEME_HTML), @@ -33,4 +34,5 @@ PasswordForm::PasswordForm(const WebKit::WebPasswordFormData& web_password_form) PasswordForm::~PasswordForm() { } -} // namespace webkit_glue +} // namespace forms +} // namespace webkit diff --git a/webkit/glue/password_form.h b/webkit/forms/password_form.h index cb27003..dc2df54 100644 --- a/webkit/glue/password_form.h +++ b/webkit/forms/password_form.h @@ -2,18 +2,19 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_GLUE_PASSWORD_FORM_H__ -#define WEBKIT_GLUE_PASSWORD_FORM_H__ +#ifndef WEBKIT_FORMS_PASSWORD_FORM_H__ +#define WEBKIT_FORMS_PASSWORD_FORM_H__ -#include <string> #include <map> +#include <string> #include "base/time.h" #include "googleurl/src/gurl.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebPasswordFormData.h" -#include "webkit/glue/webkit_glue_export.h" +#include "webkit/forms/webkit_forms_export.h" -namespace webkit_glue { +namespace webkit { +namespace forms { // The PasswordForm struct encapsulates information about a login form, // which can be an HTML form or a dialog with username/password text fields. @@ -37,7 +38,7 @@ namespace webkit_glue { // describe which fields are not strictly required when adding a saved password // entry to the database and how they can affect the matching process. -struct WEBKIT_GLUE_EXPORT PasswordForm { +struct WEBKIT_FORMS_EXPORT PasswordForm { // Enum to differentiate between HTML form based authentication, and dialogs // using basic or digest schemes. Default is SCHEME_HTML. Only PasswordForms // of the same Scheme will be matched/autofilled against each other. @@ -144,6 +145,7 @@ struct WEBKIT_GLUE_EXPORT PasswordForm { // Map username to PasswordForm* for convenience. See password_form_manager.h. typedef std::map<string16, PasswordForm*> PasswordFormMap; -} // namespace webkit_glue +} // namespace forms +} // namespace webkit -#endif // WEBKIT_GLUE_PASSWORD_FORM_H__ +#endif // WEBKIT_FORMS_PASSWORD_FORM_H__ diff --git a/webkit/glue/password_form_dom_manager.cc b/webkit/forms/password_form_dom_manager.cc index e5c2574..5cf367d 100644 --- a/webkit/glue/password_form_dom_manager.cc +++ b/webkit/forms/password_form_dom_manager.cc @@ -2,18 +2,19 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "webkit/glue/password_form_dom_manager.h" +#include "webkit/forms/password_form_dom_manager.h" #include "base/logging.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputElement.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebPasswordFormData.h" -#include "webkit/glue/form_field.h" +#include "webkit/forms/form_field.h" using WebKit::WebFormElement; using WebKit::WebInputElement; using WebKit::WebPasswordFormData; -namespace webkit_glue { +namespace webkit { +namespace forms { PasswordFormFillData::PasswordFormFillData() : wait_for_username(false) { } @@ -61,4 +62,5 @@ void PasswordFormDomManager::InitFillData( } } -} // namespace webkit_glue +} // namespace forms +} // namespace webkit diff --git a/webkit/glue/password_form_dom_manager.h b/webkit/forms/password_form_dom_manager.h index b0891e4..7354ded 100644 --- a/webkit/glue/password_form_dom_manager.h +++ b/webkit/forms/password_form_dom_manager.h @@ -2,20 +2,21 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_GLUE_PASSWORD_FORM_DOM_MANAGER_H_ -#define WEBKIT_GLUE_PASSWORD_FORM_DOM_MANAGER_H_ +#ifndef WEBKIT_FORMS_PASSWORD_FORM_DOM_MANAGER_H_ +#define WEBKIT_FORMS_PASSWORD_FORM_DOM_MANAGER_H_ #include <map> -#include "webkit/glue/form_data.h" -#include "webkit/glue/password_form.h" -#include "webkit/glue/webkit_glue_export.h" +#include "webkit/forms/form_data.h" +#include "webkit/forms/password_form.h" +#include "webkit/forms/webkit_forms_export.h" namespace WebKit { class WebForm; } -namespace webkit_glue { +namespace webkit { +namespace forms { // Structure used for autofilling password forms. // basic_data identifies the HTML form on the page and preferred username/ @@ -26,7 +27,7 @@ namespace webkit_glue { // unless the PasswordManager determined there is an additional risk // associated with this form. This can happen, for example, if action URI's // of the observed form and our saved representation don't match up. -struct WEBKIT_GLUE_EXPORT PasswordFormFillData { +struct WEBKIT_FORMS_EXPORT PasswordFormFillData { typedef std::map<string16, string16> LoginCollection; FormData basic_data; @@ -42,7 +43,7 @@ class PasswordFormDomManager { // custom metadata to DOM nodes, so we have to do this every time an event // happens with a given form and compare against previously Create'd forms // to identify..which sucks. - WEBKIT_GLUE_EXPORT static PasswordForm* CreatePasswordForm( + WEBKIT_FORMS_EXPORT static PasswordForm* CreatePasswordForm( const WebKit::WebFormElement& form); // Create a FillData structure in preparation for autofilling a form, @@ -51,7 +52,7 @@ class PasswordFormDomManager { // preferred_match should equal (address) one of matches. // wait_for_username_before_autofill is true if we should not autofill // anything until the user typed in a valid username and blurred the field. - WEBKIT_GLUE_EXPORT static void InitFillData(const PasswordForm& form_on_page, + WEBKIT_FORMS_EXPORT static void InitFillData(const PasswordForm& form_on_page, const PasswordFormMap& matches, const PasswordForm* const preferred_match, bool wait_for_username_before_autofill, @@ -60,6 +61,7 @@ class PasswordFormDomManager { DISALLOW_IMPLICIT_CONSTRUCTORS(PasswordFormDomManager); }; -} // namespace webkit_glue +} // namespace forms +} // namespace webkit -#endif // WEBKIT_GLUE_PASSWORD_FORM_DOM_MANAGER_H__ +#endif // WEBKIT_FORMS_PASSWORD_FORM_DOM_MANAGER_H__ diff --git a/webkit/forms/webkit_forms_export.h b/webkit/forms/webkit_forms_export.h new file mode 100644 index 0000000..d3cbe8f --- /dev/null +++ b/webkit/forms/webkit_forms_export.h @@ -0,0 +1,26 @@ +// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef WEBKIT_FORMS_WEBKIT_FORMS_EXPORT_H_ +#define WEBKIT_FORMS_WEBKIT_FORMS_EXPORT_H_ +#pragma once + +#if defined(COMPONENT_BUILD) +#if defined(WIN32) + +#if defined(WEBKIT_FORMS_IMPLEMENTATION) +#define WEBKIT_FORMS_EXPORT __declspec(dllexport) +#else +#define WEBKIT_FORMS_EXPORT __declspec(dllimport) +#endif // defined(WEBKIT_FORMS_IMPLEMENTATION) + +#else // defined(WIN32) +#define WEBKIT_FORMS_EXPORT __attribute__((visibility("default"))) +#endif + +#else // defined(COMPONENT_BUILD) +#define WEBKIT_FORMS_EXPORT +#endif + +#endif // WEBKIT_FORMS_WEBKIT_FORMS_EXPORT_H_ diff --git a/webkit/glue/webkit_glue.gypi b/webkit/glue/webkit_glue.gypi index 2b228d8..98bf8b75 100644 --- a/webkit/glue/webkit_glue.gypi +++ b/webkit/glue/webkit_glue.gypi @@ -110,6 +110,7 @@ 'variables': { 'enable_wexit_time_destructors': 1, }, 'defines': [ 'WEBKIT_EXTENSIONS_IMPLEMENTATION', + 'WEBKIT_FORMS_IMPLEMENTATION', 'WEBKIT_GLUE_IMPLEMENTATION', 'WEBKIT_PLUGINS_IMPLEMENTATION', ], @@ -147,6 +148,19 @@ # This list contains all .h, .cc, and .mm files in glue except for # those in the test subdirectory and those with unittest in in their # names. + '../forms/form_data.cc', + '../forms/form_data.h', + '../forms/form_data_predictions.cc', + '../forms/form_data_predictions.h', + '../forms/form_field.cc', + '../forms/form_field.h', + '../forms/form_field_predictions.cc', + '../forms/form_field_predictions.h', + '../forms/password_form.cc', + '../forms/password_form.h', + '../forms/password_form_dom_manager.cc', + '../forms/password_form_dom_manager.h', + '../forms/webkit_forms_export.h', '../plugins/npapi/carbon_plugin_window_tracker_mac.cc', '../plugins/npapi/carbon_plugin_window_tracker_mac.h', '../plugins/npapi/coregraphics_private_symbols_mac.h', @@ -343,14 +357,6 @@ 'cpp_variant.h', 'dom_operations.cc', 'dom_operations.h', - 'form_data.cc', - 'form_data.h', - 'form_data_predictions.cc', - 'form_data_predictions.h', - 'form_field.cc', - 'form_field.h', - 'form_field_predictions.cc', - 'form_field_predictions.h', 'ftp_directory_listing_response_delegate.cc', 'ftp_directory_listing_response_delegate.h', 'gl_bindings_skia_cmd_buffer.cc', @@ -369,10 +375,6 @@ 'npruntime_util.h', 'p2p_transport.cc', 'p2p_transport.h', - 'password_form.cc', - 'password_form.h', - 'password_form_dom_manager.cc', - 'password_form_dom_manager.h', 'resource_fetcher.cc', 'resource_fetcher.h', 'resource_loader_bridge.cc', |