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 /chrome/browser/password_manager | |
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 'chrome/browser/password_manager')
35 files changed, 209 insertions, 187 deletions
diff --git a/chrome/browser/password_manager/login_database.cc b/chrome/browser/password_manager/login_database.cc index 47e0193..d209c01 100644 --- a/chrome/browser/password_manager/login_database.cc +++ b/chrome/browser/password_manager/login_database.cc @@ -16,7 +16,7 @@ #include "sql/statement.h" #include "sql/transaction.h" -using webkit_glue::PasswordForm; +using webkit::forms::PasswordForm; static const int kCurrentVersionNumber = 1; static const int kCompatibleVersionNumber = 1; @@ -332,7 +332,7 @@ bool LoginDatabase::GetLogins(const PasswordForm& form, bool LoginDatabase::GetLoginsCreatedBetween( const base::Time begin, const base::Time end, - std::vector<webkit_glue::PasswordForm*>* forms) const { + std::vector<webkit::forms::PasswordForm*>* forms) const { DCHECK(forms); sql::Statement s(db_.GetCachedStatement(SQL_FROM_HERE, "SELECT origin_url, action_url, " diff --git a/chrome/browser/password_manager/login_database.h b/chrome/browser/password_manager/login_database.h index e91078d..40a392f 100644 --- a/chrome/browser/password_manager/login_database.h +++ b/chrome/browser/password_manager/login_database.h @@ -13,7 +13,7 @@ #include "base/string16.h" #include "sql/connection.h" #include "sql/meta_table.h" -#include "webkit/glue/password_form.h" +#include "webkit/forms/password_form.h" // Interface to the database storage of login information, intended as a helper // for PasswordStore on platforms that need internal storage of some or all of @@ -31,14 +31,14 @@ class LoginDatabase { void ReportMetrics(); // Adds |form| to the list of remembered password forms. - bool AddLogin(const webkit_glue::PasswordForm& form); + bool AddLogin(const webkit::forms::PasswordForm& form); // Updates remembered password form. Returns true on success and sets // items_changed (if non-NULL) to the number of logins updated. - bool UpdateLogin(const webkit_glue::PasswordForm& form, int* items_changed); + bool UpdateLogin(const webkit::forms::PasswordForm& form, int* items_changed); // Removes |form| from the list of remembered password forms. - bool RemoveLogin(const webkit_glue::PasswordForm& form); + bool RemoveLogin(const webkit::forms::PasswordForm& form); // Removes all logins created from |delete_begin| onwards (inclusive) and // before |delete_end|. You may use a null Time value to do an unbounded @@ -49,8 +49,8 @@ class LoginDatabase { // Loads a list of matching password forms into the specified vector |forms|. // The list will contain all possibly relevant entries to the observed |form|, // including blacklisted matches. - bool GetLogins(const webkit_glue::PasswordForm& form, - std::vector<webkit_glue::PasswordForm*>* forms) const; + bool GetLogins(const webkit::forms::PasswordForm& form, + std::vector<webkit::forms::PasswordForm*>* forms) const; // Loads all logins created from |begin| onwards (inclusive) and before |end|. // You may use a null Time value to do an unbounded search in either @@ -58,15 +58,16 @@ class LoginDatabase { bool GetLoginsCreatedBetween( const base::Time begin, const base::Time end, - std::vector<webkit_glue::PasswordForm*>* forms) const; + std::vector<webkit::forms::PasswordForm*>* forms) const; // Loads the complete list of autofillable password forms (i.e., not blacklist // entries) into |forms|. bool GetAutofillableLogins( - std::vector<webkit_glue::PasswordForm*>* forms) const; + std::vector<webkit::forms::PasswordForm*>* forms) const; // Loads the complete list of blacklist forms into |forms|. - bool GetBlacklistLogins(std::vector<webkit_glue::PasswordForm*>* forms) const; + bool GetBlacklistLogins( + std::vector<webkit::forms::PasswordForm*>* forms) const; // Deletes the login database file on disk, and creates a new, empty database. // This can be used after migrating passwords to some other store, to ensure @@ -87,13 +88,13 @@ class LoginDatabase { // Fills |form| from the values in the given statement (which is assumed to // be of the form used by the Get*Logins methods). - void InitPasswordFormFromStatement(webkit_glue::PasswordForm* form, + void InitPasswordFormFromStatement(webkit::forms::PasswordForm* form, sql::Statement& s) const; // Loads all logins whose blacklist setting matches |blacklisted| into // |forms|. bool GetAllLoginsWithBlacklistSetting( - bool blacklisted, std::vector<webkit_glue::PasswordForm*>* forms) const; + bool blacklisted, std::vector<webkit::forms::PasswordForm*>* forms) const; FilePath db_path_; mutable sql::Connection db_; diff --git a/chrome/browser/password_manager/login_database_unittest.cc b/chrome/browser/password_manager/login_database_unittest.cc index ad0c2db..2660c56 100644 --- a/chrome/browser/password_manager/login_database_unittest.cc +++ b/chrome/browser/password_manager/login_database_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 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. @@ -12,9 +12,9 @@ #include "base/utf_string_conversions.h" #include "chrome/browser/password_manager/login_database.h" #include "chrome/common/chrome_paths.h" -#include "webkit/glue/password_form.h" +#include "webkit/forms/password_form.h" -using webkit_glue::PasswordForm; +using webkit::forms::PasswordForm; class LoginDatabaseTest : public testing::Test { protected: diff --git a/chrome/browser/password_manager/native_backend_gnome_x.cc b/chrome/browser/password_manager/native_backend_gnome_x.cc index 9b73f05..260f308 100644 --- a/chrome/browser/password_manager/native_backend_gnome_x.cc +++ b/chrome/browser/password_manager/native_backend_gnome_x.cc @@ -22,7 +22,7 @@ #include "content/public/browser/browser_thread.h" using content::BrowserThread; -using webkit_glue::PasswordForm; +using webkit::forms::PasswordForm; #define GNOME_KEYRING_DEFINE_POINTER(name) \ typeof(&::gnome_keyring_##name) GnomeKeyringLoader::gnome_keyring_##name; diff --git a/chrome/browser/password_manager/native_backend_gnome_x.h b/chrome/browser/password_manager/native_backend_gnome_x.h index 3f5319b..6e44dae 100644 --- a/chrome/browser/password_manager/native_backend_gnome_x.h +++ b/chrome/browser/password_manager/native_backend_gnome_x.h @@ -17,9 +17,11 @@ class PrefService; -namespace webkit_glue { +namespace webkit { +namespace forms { struct PasswordForm; } +} // Many of the gnome_keyring_* functions use variable arguments, which makes // them difficult if not impossible to truly wrap in C. Therefore, we use @@ -73,12 +75,12 @@ class NativeBackendGnome : public PasswordStoreX::NativeBackend, virtual bool Init() OVERRIDE; // Implements NativeBackend interface. - virtual bool AddLogin(const webkit_glue::PasswordForm& form) OVERRIDE; - virtual bool UpdateLogin(const webkit_glue::PasswordForm& form) OVERRIDE; - virtual bool RemoveLogin(const webkit_glue::PasswordForm& form) OVERRIDE; + virtual bool AddLogin(const webkit::forms::PasswordForm& form) OVERRIDE; + virtual bool UpdateLogin(const webkit::forms::PasswordForm& form) OVERRIDE; + virtual bool RemoveLogin(const webkit::forms::PasswordForm& form) OVERRIDE; virtual bool RemoveLoginsCreatedBetween( const base::Time& delete_begin, const base::Time& delete_end) OVERRIDE; - virtual bool GetLogins(const webkit_glue::PasswordForm& form, + virtual bool GetLogins(const webkit::forms::PasswordForm& form, PasswordFormList* forms) OVERRIDE; virtual bool GetLoginsCreatedBetween(const base::Time& get_begin, const base::Time& get_end, @@ -88,7 +90,7 @@ class NativeBackendGnome : public PasswordStoreX::NativeBackend, private: // Adds a login form without checking for one to replace first. - bool RawAddLogin(const webkit_glue::PasswordForm& form); + bool RawAddLogin(const webkit::forms::PasswordForm& form); // Reads PasswordForms from the keyring with the given autofillability state. bool GetLoginsList(PasswordFormList* forms, bool autofillable); diff --git a/chrome/browser/password_manager/native_backend_gnome_x_unittest.cc b/chrome/browser/password_manager/native_backend_gnome_x_unittest.cc index 6f2f8c1..4590d8b 100644 --- a/chrome/browser/password_manager/native_backend_gnome_x_unittest.cc +++ b/chrome/browser/password_manager/native_backend_gnome_x_unittest.cc @@ -18,7 +18,7 @@ #include "testing/gtest/include/gtest/gtest.h" using content::BrowserThread; -using webkit_glue::PasswordForm; +using webkit::forms::PasswordForm; namespace { diff --git a/chrome/browser/password_manager/native_backend_kwallet_x.cc b/chrome/browser/password_manager/native_backend_kwallet_x.cc index 507d952..016d0b5 100644 --- a/chrome/browser/password_manager/native_backend_kwallet_x.cc +++ b/chrome/browser/password_manager/native_backend_kwallet_x.cc @@ -20,7 +20,7 @@ #include "ui/base/l10n/l10n_util.h" using content::BrowserThread; -using webkit_glue::PasswordForm; +using webkit::forms::PasswordForm; // We could localize this string, but then changing your locale would cause // you to lose access to all your stored passwords. Maybe best not to do that. diff --git a/chrome/browser/password_manager/native_backend_kwallet_x.h b/chrome/browser/password_manager/native_backend_kwallet_x.h index b40d3d8..23d259b 100644 --- a/chrome/browser/password_manager/native_backend_kwallet_x.h +++ b/chrome/browser/password_manager/native_backend_kwallet_x.h @@ -17,9 +17,11 @@ class Pickle; class PrefService; -namespace webkit_glue { +namespace webkit { +namespace forms { struct PasswordForm; } +} namespace base { class WaitableEvent; @@ -40,12 +42,12 @@ class NativeBackendKWallet : public PasswordStoreX::NativeBackend { virtual bool Init() OVERRIDE; // Implements NativeBackend interface. - virtual bool AddLogin(const webkit_glue::PasswordForm& form) OVERRIDE; - virtual bool UpdateLogin(const webkit_glue::PasswordForm& form) OVERRIDE; - virtual bool RemoveLogin(const webkit_glue::PasswordForm& form) OVERRIDE; + virtual bool AddLogin(const webkit::forms::PasswordForm& form) OVERRIDE; + virtual bool UpdateLogin(const webkit::forms::PasswordForm& form) OVERRIDE; + virtual bool RemoveLogin(const webkit::forms::PasswordForm& form) OVERRIDE; virtual bool RemoveLoginsCreatedBetween( const base::Time& delete_begin, const base::Time& delete_end) OVERRIDE; - virtual bool GetLogins(const webkit_glue::PasswordForm& form, + virtual bool GetLogins(const webkit::forms::PasswordForm& form, PasswordFormList* forms) OVERRIDE; virtual bool GetLoginsCreatedBetween(const base::Time& get_begin, const base::Time& get_end, @@ -113,8 +115,8 @@ class NativeBackendKWallet : public PasswordStoreX::NativeBackend { // If |update_check| is false, we only check the fields that are checked by // LoginDatabase::UpdateLogin() when updating logins; otherwise, we check the // fields that are checked by LoginDatabase::RemoveLogin() for removing them. - static bool CompareForms(const webkit_glue::PasswordForm& a, - const webkit_glue::PasswordForm& b, + static bool CompareForms(const webkit::forms::PasswordForm& a, + const webkit::forms::PasswordForm& b, bool update_check); // Serializes a list of PasswordForms to be stored in the wallet. diff --git a/chrome/browser/password_manager/native_backend_kwallet_x_unittest.cc b/chrome/browser/password_manager/native_backend_kwallet_x_unittest.cc index 75bda2f..5779be8 100644 --- a/chrome/browser/password_manager/native_backend_kwallet_x_unittest.cc +++ b/chrome/browser/password_manager/native_backend_kwallet_x_unittest.cc @@ -28,7 +28,7 @@ using content::BrowserThread; using testing::_; using testing::Invoke; using testing::Return; -using webkit_glue::PasswordForm; +using webkit::forms::PasswordForm; namespace { diff --git a/chrome/browser/password_manager/password_form_data.cc b/chrome/browser/password_manager/password_form_data.cc index b428d9a..b919770 100644 --- a/chrome/browser/password_manager/password_form_data.cc +++ b/chrome/browser/password_manager/password_form_data.cc @@ -1,4 +1,4 @@ -// 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. @@ -6,7 +6,7 @@ #include "base/utf_string_conversions.h" #include "chrome/browser/password_manager/password_form_data.h" -using webkit_glue::PasswordForm; +using webkit::forms::PasswordForm; PasswordForm* CreatePasswordFormFromData( const PasswordFormData& form_data) { @@ -69,7 +69,7 @@ std::ostream& operator<<(std::ostream& os, const PasswordForm& form) { << "date_created: " << form.date_created.ToDoubleT(); } -typedef std::set<const webkit_glue::PasswordForm*> SetOfForms; +typedef std::set<const webkit::forms::PasswordForm*> SetOfForms; bool ContainsSamePasswordFormsPtr( const std::vector<PasswordForm*>& first, @@ -98,8 +98,8 @@ bool ContainsSamePasswordFormsPtr( } bool ContainsSamePasswordForms( - std::vector<webkit_glue::PasswordForm>& first, - std::vector<webkit_glue::PasswordForm>& second) { + std::vector<webkit::forms::PasswordForm>& first, + std::vector<webkit::forms::PasswordForm>& second) { std::vector<PasswordForm*> first_ptr; for (unsigned int i = 0; i < first.size(); ++i) { first_ptr.push_back(&first[i]); diff --git a/chrome/browser/password_manager/password_form_data.h b/chrome/browser/password_manager/password_form_data.h index f48d0c8..455a39c21 100644 --- a/chrome/browser/password_manager/password_form_data.h +++ b/chrome/browser/password_manager/password_form_data.h @@ -9,12 +9,12 @@ #include <ostream> #include "testing/gmock/include/gmock/gmock.h" -#include "webkit/glue/password_form.h" +#include "webkit/forms/password_form.h" // Struct used for creation of PasswordForms from static arrays of data. // Note: This is only meant to be used in unit test. struct PasswordFormData { - const webkit_glue::PasswordForm::Scheme scheme; + const webkit::forms::PasswordForm::Scheme scheme; const char* signon_realm; const char* origin; const char* action; @@ -30,23 +30,23 @@ struct PasswordFormData { // Creates and returns a new PasswordForm built from form_data. Caller is // responsible for deleting the object when finished with it. -webkit_glue::PasswordForm* CreatePasswordFormFromData( +webkit::forms::PasswordForm* CreatePasswordFormFromData( const PasswordFormData& form_data); // Checks whether two vectors of PasswordForms contain equivalent elements, // regardless of order. bool ContainsSamePasswordFormsPtr( - const std::vector<webkit_glue::PasswordForm*>& first, - const std::vector<webkit_glue::PasswordForm*>& second); + const std::vector<webkit::forms::PasswordForm*>& first, + const std::vector<webkit::forms::PasswordForm*>& second); bool ContainsSamePasswordForms( - std::vector<webkit_glue::PasswordForm>& first, - std::vector<webkit_glue::PasswordForm>& second); + std::vector<webkit::forms::PasswordForm>& first, + std::vector<webkit::forms::PasswordForm>& second); // Pretty-prints the contents of a PasswordForm. // TODO(sync): This file must eventually be refactored away -- crbug.com/87185. std::ostream& operator<<(std::ostream& os, - const webkit_glue::PasswordForm& form); + const webkit::forms::PasswordForm& form); // This gmock matcher is used to check that the |arg| contains exactly the same // PasswordForms as |forms|, regardless of order. diff --git a/chrome/browser/password_manager/password_form_manager.cc b/chrome/browser/password_manager/password_form_manager.cc index 1cbbdec..958a2c8 100644 --- a/chrome/browser/password_manager/password_form_manager.cc +++ b/chrome/browser/password_manager/password_form_manager.cc @@ -12,11 +12,11 @@ #include "chrome/browser/password_manager/password_manager.h" #include "chrome/browser/password_manager/password_store.h" #include "chrome/browser/profiles/profile.h" -#include "webkit/glue/password_form_dom_manager.h" +#include "webkit/forms/password_form_dom_manager.h" using base::Time; -using webkit_glue::PasswordForm; -using webkit_glue::PasswordFormMap; +using webkit::forms::PasswordForm; +using webkit::forms::PasswordFormMap; PasswordFormManager::PasswordFormManager(Profile* profile, PasswordManager* password_manager, diff --git a/chrome/browser/password_manager/password_form_manager.h b/chrome/browser/password_manager/password_form_manager.h index f298af3..f9d8b59 100644 --- a/chrome/browser/password_manager/password_form_manager.h +++ b/chrome/browser/password_manager/password_form_manager.h @@ -13,7 +13,7 @@ #include "base/stl_util.h" #include "chrome/browser/password_manager/password_store_consumer.h" -#include "webkit/glue/password_form.h" +#include "webkit/forms/password_form.h" class PasswordManager; class PasswordStore; @@ -31,12 +31,12 @@ class PasswordFormManager : public PasswordStoreConsumer { // used to filter login results from database. PasswordFormManager(Profile* profile, PasswordManager* password_manager, - const webkit_glue::PasswordForm& observed_form, + const webkit::forms::PasswordForm& observed_form, bool ssl_valid); virtual ~PasswordFormManager(); // Compare basic data of observed_form_ with argument. - bool DoesManage(const webkit_glue::PasswordForm& form) const; + bool DoesManage(const webkit::forms::PasswordForm& form) const; // Retrieves potential matching logins from the database. void FetchMatchingLoginsFromPasswordStore(); @@ -69,12 +69,12 @@ class PasswordFormManager : public PasswordStoreConsumer { // Determines if we need to autofill given the results of the query. void OnRequestDone( - int handle, const std::vector<webkit_glue::PasswordForm*>& result); + int handle, const std::vector<webkit::forms::PasswordForm*>& result); // PasswordStoreConsumer implementation. virtual void OnPasswordStoreRequestDone( CancelableRequestProvider::Handle handle, - const std::vector<webkit_glue::PasswordForm*>& result) OVERRIDE; + const std::vector<webkit::forms::PasswordForm*>& result) OVERRIDE; // A user opted to 'never remember' passwords for this form. // Blacklist it so that from now on when it is seen we ignore it. @@ -83,7 +83,7 @@ class PasswordFormManager : public PasswordStoreConsumer { // If the user has submitted observed_form_, provisionally hold on to // the submitted credentials until we are told by PasswordManager whether // or not the login was successful. - void ProvisionallySave(const webkit_glue::PasswordForm& credentials); + void ProvisionallySave(const webkit::forms::PasswordForm& credentials); // Handles save-as-new or update of the form managed by this manager. // Note the basic data of updated_credentials must match that of @@ -140,7 +140,7 @@ class PasswordFormManager : public PasswordStoreConsumer { // Helper for OnPasswordStoreRequestDone to determine whether or not // the given result form is worth scoring. - bool IgnoreResult(const webkit_glue::PasswordForm& form) const; + bool IgnoreResult(const webkit::forms::PasswordForm& form) const; // Helper for Save in the case that best_matches.size() == 0, meaning // we have no prior record of this form/username/password and the user @@ -150,7 +150,7 @@ class PasswordFormManager : public PasswordStoreConsumer { // Helper for OnPasswordStoreRequestDone to score an individual result // against the observed_form_. - int ScoreResult(const webkit_glue::PasswordForm& form) const; + int ScoreResult(const webkit::forms::PasswordForm& form) const; // Helper for Save in the case that best_matches.size() > 0, meaning // we have at least one match for this form/username/password. This @@ -171,13 +171,13 @@ class PasswordFormManager : public PasswordStoreConsumer { // Set of PasswordForms from the DB that best match the form // being managed by this. Use a map instead of vector, because we most // frequently require lookups by username value in IsNewLogin. - webkit_glue::PasswordFormMap best_matches_; + webkit::forms::PasswordFormMap best_matches_; // Cleans up when best_matches_ goes out of scope. - STLValueDeleter<webkit_glue::PasswordFormMap> best_matches_deleter_; + STLValueDeleter<webkit::forms::PasswordFormMap> best_matches_deleter_; // The PasswordForm from the page or dialog managed by this. - webkit_glue::PasswordForm observed_form_; + webkit::forms::PasswordForm observed_form_; // The origin url path of observed_form_ tokenized, for convenience when // scoring. @@ -185,7 +185,7 @@ class PasswordFormManager : public PasswordStoreConsumer { // Stores updated credentials when the form was submitted but success is // still unknown. - webkit_glue::PasswordForm pending_credentials_; + webkit::forms::PasswordForm pending_credentials_; // Whether pending_credentials_ stores a new login or is an update // to an existing one. @@ -201,7 +201,7 @@ class PasswordFormManager : public PasswordStoreConsumer { // as preferred. This is only allowed to be null if there are no best matches // at all, since there will always be one preferred login when there are // multiple matches (when first saved, a login is marked preferred). - const webkit_glue::PasswordForm* preferred_match_; + const webkit::forms::PasswordForm* preferred_match_; typedef enum { PRE_MATCHING_PHASE, // Have not yet invoked a GetLogins query to find diff --git a/chrome/browser/password_manager/password_form_manager_unittest.cc b/chrome/browser/password_manager/password_form_manager_unittest.cc index d8affba..90b3772 100644 --- a/chrome/browser/password_manager/password_form_manager_unittest.cc +++ b/chrome/browser/password_manager/password_form_manager_unittest.cc @@ -1,4 +1,4 @@ -// 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. @@ -10,9 +10,9 @@ #include "chrome/browser/password_manager/password_manager.h" #include "chrome/browser/profiles/profile_manager.h" #include "chrome/test/base/testing_profile.h" -#include "webkit/glue/password_form.h" +#include "webkit/forms/password_form.h" -using webkit_glue::PasswordForm; +using webkit::forms::PasswordForm; class PasswordFormManagerTest : public testing::Test { public: diff --git a/chrome/browser/password_manager/password_manager.cc b/chrome/browser/password_manager/password_manager.cc index 274cc56..daf6706 100644 --- a/chrome/browser/password_manager/password_manager.cc +++ b/chrome/browser/password_manager/password_manager.cc @@ -20,8 +20,8 @@ #include "grit/generated_resources.h" using content::UserMetricsAction; -using webkit_glue::PasswordForm; -using webkit_glue::PasswordFormMap; +using webkit::forms::PasswordForm; +using webkit::forms::PasswordFormMap; // static void PasswordManager::RegisterUserPrefs(PrefService* prefs) { @@ -226,8 +226,8 @@ void PasswordManager::Autofill( case PasswordForm::SCHEME_HTML: { // Note the check above is required because the observer_ for a non-HTML // schemed password form may have been freed, so we need to distinguish. - webkit_glue::PasswordFormFillData fill_data; - webkit_glue::PasswordFormDomManager::InitFillData(form_for_autofill, + webkit::forms::PasswordFormFillData fill_data; + webkit::forms::PasswordFormDomManager::InitFillData(form_for_autofill, best_matches, preferred_match, wait_for_username, diff --git a/chrome/browser/password_manager/password_manager.h b/chrome/browser/password_manager/password_manager.h index 2b44000..882066b 100644 --- a/chrome/browser/password_manager/password_manager.h +++ b/chrome/browser/password_manager/password_manager.h @@ -12,8 +12,8 @@ #include "chrome/browser/prefs/pref_member.h" #include "chrome/browser/ui/login/login_model.h" #include "content/browser/tab_contents/tab_contents_observer.h" -#include "webkit/glue/password_form.h" -#include "webkit/glue/password_form_dom_manager.h" +#include "webkit/forms/password_form.h" +#include "webkit/forms/password_form_dom_manager.h" class PasswordManagerDelegate; class PasswordManagerTest; @@ -36,9 +36,9 @@ class PasswordManager : public LoginModel, // Called by a PasswordFormManager when it decides a form can be autofilled // on the page. - void Autofill(const webkit_glue::PasswordForm& form_for_autofill, - const webkit_glue::PasswordFormMap& best_matches, - const webkit_glue::PasswordForm* const preferred_match, + void Autofill(const webkit::forms::PasswordForm& form_for_autofill, + const webkit::forms::PasswordFormMap& best_matches, + const webkit::forms::PasswordForm* const preferred_match, bool wait_for_username) const; // LoginModel implementation. @@ -47,7 +47,7 @@ class PasswordManager : public LoginModel, // When a form is submitted, we prepare to save the password but wait // until we decide the user has successfully logged in. This is step 1 // of 2 (see SavePassword). - void ProvisionallySavePassword(webkit_glue::PasswordForm form); + void ProvisionallySavePassword(webkit::forms::PasswordForm form); // TabContentsObserver overrides. virtual void DidStopLoading() OVERRIDE; @@ -57,9 +57,9 @@ class PasswordManager : public LoginModel, virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; void OnPasswordFormsFound( - const std::vector<webkit_glue::PasswordForm>& forms); + const std::vector<webkit::forms::PasswordForm>& forms); void OnPasswordFormsVisible( - const std::vector<webkit_glue::PasswordForm>& visible_forms); + const std::vector<webkit::forms::PasswordForm>& visible_forms); private: FRIEND_TEST_ALL_PREFIXES(PasswordManagerTest, FormSeenThenLeftPage); diff --git a/chrome/browser/password_manager/password_manager_delegate.h b/chrome/browser/password_manager/password_manager_delegate.h index 087fe76..63ec908 100644 --- a/chrome/browser/password_manager/password_manager_delegate.h +++ b/chrome/browser/password_manager/password_manager_delegate.h @@ -1,4 +1,4 @@ -// 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. @@ -6,9 +6,11 @@ #define CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_MANAGER_DELEGATE_H_ #pragma once -namespace webkit_glue { +namespace webkit { +namespace forms { struct PasswordFormFillData; -} // namespace webkit_glue +} +} class PasswordFormManager; class Profile; @@ -25,7 +27,7 @@ class PasswordManagerDelegate { // through the RenderViewHost to FillPasswordForm. Tests can override this // to sever the dependency on the entire rendering stack. virtual void FillPasswordForm( - const webkit_glue::PasswordFormFillData& form_data) = 0; + const webkit::forms::PasswordFormFillData& form_data) = 0; // A mechanism to show an infobar in the current tab at our request. virtual void AddSavePasswordInfoBar(PasswordFormManager* form_to_save) = 0; diff --git a/chrome/browser/password_manager/password_manager_unittest.cc b/chrome/browser/password_manager/password_manager_unittest.cc index 5b7cc70..ced8c50 100644 --- a/chrome/browser/password_manager/password_manager_unittest.cc +++ b/chrome/browser/password_manager/password_manager_unittest.cc @@ -19,7 +19,7 @@ #include "testing/gtest/include/gtest/gtest.h" using content::BrowserThread; -using webkit_glue::PasswordForm; +using webkit::forms::PasswordForm; using testing::_; using testing::DoAll; using ::testing::Exactly; @@ -29,7 +29,7 @@ using ::testing::Return; class MockPasswordManagerDelegate : public PasswordManagerDelegate { public: MOCK_METHOD1(FillPasswordForm, void( - const webkit_glue::PasswordFormFillData&)); + const webkit::forms::PasswordFormFillData&)); MOCK_METHOD1(AddSavePasswordInfoBar, void(PasswordFormManager*)); MOCK_METHOD0(GetProfileForPasswordManager, Profile*()); MOCK_METHOD0(DidLastPageLoadEncounterSSLErrors, bool()); @@ -66,9 +66,9 @@ class MockPasswordStore : public PasswordStore { MOCK_METHOD1(GetAutofillableLoginsImpl, void(GetLoginsRequest*)); MOCK_METHOD1(GetBlacklistLoginsImpl, void(GetLoginsRequest*)); MOCK_METHOD1(FillAutofillableLogins, - bool(std::vector<webkit_glue::PasswordForm*>*)); + bool(std::vector<webkit::forms::PasswordForm*>*)); MOCK_METHOD1(FillBlacklistLogins, - bool(std::vector<webkit_glue::PasswordForm*>*)); + bool(std::vector<webkit::forms::PasswordForm*>*)); }; ACTION_P2(InvokeConsumer, handle, forms) { diff --git a/chrome/browser/password_manager/password_store.cc b/chrome/browser/password_manager/password_store.cc index 3127170..6f35655 100644 --- a/chrome/browser/password_manager/password_store.cc +++ b/chrome/browser/password_manager/password_store.cc @@ -10,15 +10,15 @@ #include "base/task.h" #include "chrome/browser/password_manager/password_store_consumer.h" #include "content/public/browser/browser_thread.h" -#include "webkit/glue/password_form.h" +#include "webkit/forms/password_form.h" using content::BrowserThread; using std::vector; -using webkit_glue::PasswordForm; +using webkit::forms::PasswordForm; PasswordStore::GetLoginsRequest::GetLoginsRequest(GetLoginsCallback* callback) : CancelableRequest1<GetLoginsCallback, - std::vector<webkit_glue::PasswordForm*> >(callback) { + std::vector<webkit::forms::PasswordForm*> >(callback) { } PasswordStore::GetLoginsRequest::~GetLoginsRequest() { diff --git a/chrome/browser/password_manager/password_store.h b/chrome/browser/password_manager/password_store.h index eb656bf..222d198 100644 --- a/chrome/browser/password_manager/password_store.h +++ b/chrome/browser/password_manager/password_store.h @@ -24,17 +24,19 @@ namespace browser_sync { class PasswordDataTypeController; class PasswordModelAssociator; class PasswordModelWorker; -}; +} -namespace webkit_glue { +namespace webkit { +namespace forms { struct PasswordForm; -}; +} +} namespace passwords_helper { -void AddLogin(PasswordStore* store, const webkit_glue::PasswordForm& form); -void RemoveLogin(PasswordStore* store, const webkit_glue::PasswordForm& form); -void UpdateLogin(PasswordStore* store, const webkit_glue::PasswordForm& form); -}; +void AddLogin(PasswordStore* store, const webkit::forms::PasswordForm& form); +void RemoveLogin(PasswordStore* store, const webkit::forms::PasswordForm& form); +void UpdateLogin(PasswordStore* store, const webkit::forms::PasswordForm& form); +} // Interface for storing form passwords in a platform-specific secure way. // The login request/manipulation API is not threadsafe and must be used @@ -44,7 +46,7 @@ class PasswordStore public CancelableRequestProvider { public: typedef Callback2<Handle, - const std::vector<webkit_glue::PasswordForm*>&>::Type + const std::vector<webkit::forms::PasswordForm*>&>::Type GetLoginsCallback; // PasswordForm vector elements are meant to be owned by the @@ -56,7 +58,7 @@ class PasswordStore // provide a destructor, which cleans up after canceled requests by deleting // vector elements. class GetLoginsRequest : public CancelableRequest1< - GetLoginsCallback, std::vector<webkit_glue::PasswordForm*> > { + GetLoginsCallback, std::vector<webkit::forms::PasswordForm*> > { public: explicit GetLoginsRequest(GetLoginsCallback* callback); virtual ~GetLoginsRequest(); @@ -86,13 +88,13 @@ class PasswordStore virtual void Shutdown(); // Adds the given PasswordForm to the secure password store asynchronously. - virtual void AddLogin(const webkit_glue::PasswordForm& form); + virtual void AddLogin(const webkit::forms::PasswordForm& form); // Updates the matching PasswordForm in the secure password store (async). - void UpdateLogin(const webkit_glue::PasswordForm& form); + void UpdateLogin(const webkit::forms::PasswordForm& form); // Removes the matching PasswordForm from the secure password store (async). - void RemoveLogin(const webkit_glue::PasswordForm& form); + void RemoveLogin(const webkit::forms::PasswordForm& form); // Removes all logins created in the given date range. void RemoveLoginsCreatedBetween(const base::Time& delete_begin, @@ -101,7 +103,7 @@ class PasswordStore // Searches for a matching PasswordForm and returns a handle so the async // request can be tracked. Implement the PasswordStoreConsumer interface to be // notified on completion. - virtual Handle GetLogins(const webkit_glue::PasswordForm& form, + virtual Handle GetLogins(const webkit::forms::PasswordForm& form, PasswordStoreConsumer* consumer); // Gets the complete list of PasswordForms that are not blacklist entries--and @@ -130,11 +132,11 @@ class PasswordStore friend class browser_sync::PasswordModelAssociator; friend class browser_sync::PasswordModelWorker; friend void passwords_helper::AddLogin(PasswordStore*, - const webkit_glue::PasswordForm&); + const webkit::forms::PasswordForm&); friend void passwords_helper::RemoveLogin(PasswordStore*, - const webkit_glue::PasswordForm&); + const webkit::forms::PasswordForm&); friend void passwords_helper::UpdateLogin(PasswordStore*, - const webkit_glue::PasswordForm&); + const webkit::forms::PasswordForm&); virtual ~PasswordStore(); @@ -151,11 +153,11 @@ class PasswordStore // Synchronous implementation that reports usage metrics. virtual void ReportMetricsImpl() = 0; // Synchronous implementation to add the given login. - virtual void AddLoginImpl(const webkit_glue::PasswordForm& form) = 0; + virtual void AddLoginImpl(const webkit::forms::PasswordForm& form) = 0; // Synchronous implementation to update the given login. - virtual void UpdateLoginImpl(const webkit_glue::PasswordForm& form) = 0; + virtual void UpdateLoginImpl(const webkit::forms::PasswordForm& form) = 0; // Synchronous implementation to remove the given login. - virtual void RemoveLoginImpl(const webkit_glue::PasswordForm& form) = 0; + virtual void RemoveLoginImpl(const webkit::forms::PasswordForm& form) = 0; // Synchronous implementation to remove the given logins. virtual void RemoveLoginsCreatedBetweenImpl(const base::Time& delete_begin, const base::Time& delete_end) = 0; @@ -163,7 +165,7 @@ class PasswordStore // will then be scored by the PasswordFormManager. Once they are found // (or not), the consumer should be notified. virtual void GetLoginsImpl(GetLoginsRequest* request, - const webkit_glue::PasswordForm& form) = 0; + const webkit::forms::PasswordForm& form) = 0; // Finds all non-blacklist PasswordForms, and notifies the consumer. virtual void GetAutofillableLoginsImpl(GetLoginsRequest* request) = 0; // Finds all blacklist PasswordForms, and notifies the consumer. @@ -171,10 +173,10 @@ class PasswordStore // Finds all non-blacklist PasswordForms, and fills the vector. virtual bool FillAutofillableLogins( - std::vector<webkit_glue::PasswordForm*>* forms) = 0; + std::vector<webkit::forms::PasswordForm*>* forms) = 0; // Finds all blacklist PasswordForms, and fills the vector. virtual bool FillBlacklistLogins( - std::vector<webkit_glue::PasswordForm*>* forms) = 0; + std::vector<webkit::forms::PasswordForm*>* forms) = 0; // Dispatches the result to the PasswordStoreConsumer on the original caller's // thread so the callback can be executed there. This should be the UI diff --git a/chrome/browser/password_manager/password_store_change.h b/chrome/browser/password_manager/password_store_change.h index 885b6b7..1e68f52 100644 --- a/chrome/browser/password_manager/password_store_change.h +++ b/chrome/browser/password_manager/password_store_change.h @@ -1,4 +1,4 @@ -// 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. @@ -8,7 +8,7 @@ #include <vector> -#include "webkit/glue/password_form.h" +#include "webkit/forms/password_form.h" class PasswordStoreChange { public: @@ -18,13 +18,13 @@ class PasswordStoreChange { REMOVE, }; - PasswordStoreChange(Type type, const webkit_glue::PasswordForm& form) + PasswordStoreChange(Type type, const webkit::forms::PasswordForm& form) : type_(type), form_(form) { } virtual ~PasswordStoreChange() {} Type type() const { return type_; } - const webkit_glue::PasswordForm& form() const { return form_; } + const webkit::forms::PasswordForm& form() const { return form_; } bool operator==(const PasswordStoreChange& other) const { return type() == other.type() && @@ -46,7 +46,7 @@ class PasswordStoreChange { private: Type type_; - webkit_glue::PasswordForm form_; + webkit::forms::PasswordForm form_; }; typedef std::vector<PasswordStoreChange> PasswordStoreChangeList; diff --git a/chrome/browser/password_manager/password_store_consumer.h b/chrome/browser/password_manager/password_store_consumer.h index a515092..dc6c66b 100644 --- a/chrome/browser/password_manager/password_store_consumer.h +++ b/chrome/browser/password_manager/password_store_consumer.h @@ -8,9 +8,11 @@ #include "content/browser/cancelable_request.h" -namespace webkit_glue { +namespace webkit { +namespace forms { struct PasswordForm; -}; +} +} // Reads from the PasswordStore are done asynchronously on a separate // thread. PasswordStoreConsumer provides the virtual callback method, which is @@ -25,7 +27,7 @@ class PasswordStoreConsumer { // anyway with an empty vector. virtual void OnPasswordStoreRequestDone( CancelableRequestProvider::Handle handle, - const std::vector<webkit_glue::PasswordForm*>& result) = 0; + const std::vector<webkit::forms::PasswordForm*>& result) = 0; // The CancelableRequest framework needs both a callback (the // PasswordStoreConsumer::OnPasswordStoreRequestDone) as well as a diff --git a/chrome/browser/password_manager/password_store_default.cc b/chrome/browser/password_manager/password_store_default.cc index 0931f31..a0544b6 100644 --- a/chrome/browser/password_manager/password_store_default.cc +++ b/chrome/browser/password_manager/password_store_default.cc @@ -19,7 +19,7 @@ #include "content/public/browser/notification_service.h" using content::BrowserThread; -using webkit_glue::PasswordForm; +using webkit::forms::PasswordForm; // MigrateHelper handles migration from WebDB to PasswordStore. It runs // entirely on the UI thread and is owned by PasswordStoreDefault. @@ -181,7 +181,7 @@ void PasswordStoreDefault::RemoveLoginsCreatedBetweenImpl( } void PasswordStoreDefault::GetLoginsImpl( - GetLoginsRequest* request, const webkit_glue::PasswordForm& form) { + GetLoginsRequest* request, const webkit::forms::PasswordForm& form) { login_db_->GetLogins(form, &request->value); ForwardLoginsResult(request); } diff --git a/chrome/browser/password_manager/password_store_default.h b/chrome/browser/password_manager/password_store_default.h index e4b356f..a796c43 100644 --- a/chrome/browser/password_manager/password_store_default.h +++ b/chrome/browser/password_manager/password_store_default.h @@ -31,19 +31,21 @@ class PasswordStoreDefault : public PasswordStore { // Implements PasswordStore interface. virtual void Shutdown() OVERRIDE; virtual void ReportMetricsImpl() OVERRIDE; - virtual void AddLoginImpl(const webkit_glue::PasswordForm& form) OVERRIDE; - virtual void UpdateLoginImpl(const webkit_glue::PasswordForm& form) OVERRIDE; - virtual void RemoveLoginImpl(const webkit_glue::PasswordForm& form) OVERRIDE; + virtual void AddLoginImpl(const webkit::forms::PasswordForm& form) OVERRIDE; + virtual void UpdateLoginImpl( + const webkit::forms::PasswordForm& form) OVERRIDE; + virtual void RemoveLoginImpl( + const webkit::forms::PasswordForm& form) OVERRIDE; virtual void RemoveLoginsCreatedBetweenImpl( const base::Time& delete_begin, const base::Time& delete_end) OVERRIDE; virtual void GetLoginsImpl(GetLoginsRequest* request, - const webkit_glue::PasswordForm& form) OVERRIDE; + const webkit::forms::PasswordForm& form) OVERRIDE; virtual void GetAutofillableLoginsImpl(GetLoginsRequest* request) OVERRIDE; virtual void GetBlacklistLoginsImpl(GetLoginsRequest* request) OVERRIDE; virtual bool FillAutofillableLogins( - std::vector<webkit_glue::PasswordForm*>* forms) OVERRIDE; + std::vector<webkit::forms::PasswordForm*>* forms) OVERRIDE; virtual bool FillBlacklistLogins( - std::vector<webkit_glue::PasswordForm*>* forms) OVERRIDE; + std::vector<webkit::forms::PasswordForm*>* forms) OVERRIDE; scoped_refptr<WebDataService> web_data_service_; diff --git a/chrome/browser/password_manager/password_store_default_unittest.cc b/chrome/browser/password_manager/password_store_default_unittest.cc index cbb22bb..0422649 100644 --- a/chrome/browser/password_manager/password_store_default_unittest.cc +++ b/chrome/browser/password_manager/password_store_default_unittest.cc @@ -36,7 +36,7 @@ using testing::ElementsAreArray; using testing::Pointee; using testing::Property; using testing::WithArg; -using webkit_glue::PasswordForm; +using webkit::forms::PasswordForm; namespace { @@ -44,7 +44,7 @@ class MockPasswordStoreConsumer : public PasswordStoreConsumer { public: MOCK_METHOD2(OnPasswordStoreRequestDone, void(CancelableRequestProvider::Handle, - const std::vector<webkit_glue::PasswordForm*>&)); + const std::vector<webkit::forms::PasswordForm*>&)); }; class MockWebDataServiceConsumer : public WebDataServiceConsumer { diff --git a/chrome/browser/password_manager/password_store_mac.cc b/chrome/browser/password_manager/password_store_mac.cc index ef4e421..28015d9 100644 --- a/chrome/browser/password_manager/password_store_mac.cc +++ b/chrome/browser/password_manager/password_store_mac.cc @@ -23,7 +23,7 @@ #include "chrome/common/chrome_notification_types.h" #include "content/public/browser/notification_service.h" -using webkit_glue::PasswordForm; +using webkit::forms::PasswordForm; // Utility class to handle the details of constructing and running a keychain // search from a set of attributes. @@ -641,7 +641,7 @@ SecKeychainItemRef MacKeychainPasswordFormAdapter::KeychainItemForForm( std::vector<SecKeychainItemRef> MacKeychainPasswordFormAdapter::MatchingKeychainItems( const std::string& signon_realm, - webkit_glue::PasswordForm::Scheme scheme, + webkit::forms::PasswordForm::Scheme scheme, const char* path, const char* username) { std::vector<SecKeychainItemRef> matches; @@ -887,7 +887,7 @@ void PasswordStoreMac::RemoveLoginsCreatedBetweenImpl( } void PasswordStoreMac::GetLoginsImpl(GetLoginsRequest* request, - const webkit_glue::PasswordForm& form) { + const webkit::forms::PasswordForm& form) { MacKeychainPasswordFormAdapter keychain_adapter(keychain_.get()); std::vector<PasswordForm*> keychain_forms = keychain_adapter.PasswordsFillingForm(form); @@ -960,7 +960,7 @@ bool PasswordStoreMac::AddToKeychainIfNecessary(const PasswordForm& form) { } bool PasswordStoreMac::DatabaseHasFormMatchingKeychainForm( - const webkit_glue::PasswordForm& form) { + const webkit::forms::PasswordForm& form) { bool has_match = false; std::vector<PasswordForm*> database_forms; login_metadata_db_->GetLogins(form, &database_forms); diff --git a/chrome/browser/password_manager/password_store_mac.h b/chrome/browser/password_manager/password_store_mac.h index 3a509ef..d7ccb04 100644 --- a/chrome/browser/password_manager/password_store_mac.h +++ b/chrome/browser/password_manager/password_store_mac.h @@ -43,42 +43,44 @@ class PasswordStoreMac : public PasswordStore { private: virtual void ReportMetricsImpl() OVERRIDE; - virtual void AddLoginImpl(const webkit_glue::PasswordForm& form) OVERRIDE; - virtual void UpdateLoginImpl(const webkit_glue::PasswordForm& form) OVERRIDE; - virtual void RemoveLoginImpl(const webkit_glue::PasswordForm& form) OVERRIDE; + virtual void AddLoginImpl(const webkit::forms::PasswordForm& form) OVERRIDE; + virtual void UpdateLoginImpl( + const webkit::forms::PasswordForm& form) OVERRIDE; + virtual void RemoveLoginImpl( + const webkit::forms::PasswordForm& form) OVERRIDE; virtual void RemoveLoginsCreatedBetweenImpl( const base::Time& delete_begin, const base::Time& delete_end) OVERRIDE; virtual void GetLoginsImpl(GetLoginsRequest* request, - const webkit_glue::PasswordForm& form) OVERRIDE; + const webkit::forms::PasswordForm& form) OVERRIDE; virtual void GetAutofillableLoginsImpl(GetLoginsRequest* request) OVERRIDE; virtual void GetBlacklistLoginsImpl(GetLoginsRequest* request) OVERRIDE; virtual bool FillAutofillableLogins( - std::vector<webkit_glue::PasswordForm*>* forms) OVERRIDE; + std::vector<webkit::forms::PasswordForm*>* forms) OVERRIDE; virtual bool FillBlacklistLogins( - std::vector<webkit_glue::PasswordForm*>* forms) OVERRIDE; + std::vector<webkit::forms::PasswordForm*>* forms) OVERRIDE; // Adds the given form to the Keychain if it's something we want to store // there (i.e., not a blacklist entry). Returns true if the operation // succeeded (either we added successfully, or we didn't need to). - bool AddToKeychainIfNecessary(const webkit_glue::PasswordForm& form); + bool AddToKeychainIfNecessary(const webkit::forms::PasswordForm& form); // Returns true if our database contains a form that exactly matches the given // keychain form. bool DatabaseHasFormMatchingKeychainForm( - const webkit_glue::PasswordForm& form); + const webkit::forms::PasswordForm& form); // Returns all the Keychain entries that we own but no longer have // corresponding metadata for in our database. // Caller is responsible for deleting the forms. - std::vector<webkit_glue::PasswordForm*> GetUnusedKeychainForms(); + std::vector<webkit::forms::PasswordForm*> GetUnusedKeychainForms(); // Removes the given forms from the database. void RemoveDatabaseForms( - const std::vector<webkit_glue::PasswordForm*>& forms); + const std::vector<webkit::forms::PasswordForm*>& forms); // Removes the given forms from the Keychain. void RemoveKeychainForms( - const std::vector<webkit_glue::PasswordForm*>& forms); + const std::vector<webkit::forms::PasswordForm*>& forms); // Allows the creation of |notification_service_| to be scheduled on the right // thread. diff --git a/chrome/browser/password_manager/password_store_mac_internal.h b/chrome/browser/password_manager/password_store_mac_internal.h index 7e6fb9a..c70af27 100644 --- a/chrome/browser/password_manager/password_store_mac_internal.h +++ b/chrome/browser/password_manager/password_store_mac_internal.h @@ -1,4 +1,4 @@ -// Copyright (c) 2009 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. @@ -25,40 +25,40 @@ class MacKeychainPasswordFormAdapter { // Returns PasswordForms for each keychain entry that could be used to fill // |form|. Caller is responsible for deleting the returned forms. - std::vector<webkit_glue::PasswordForm*> PasswordsFillingForm( - const webkit_glue::PasswordForm& query_form); + std::vector<webkit::forms::PasswordForm*> PasswordsFillingForm( + const webkit::forms::PasswordForm& query_form); // Returns PasswordForms for each keychain entry that could be merged with // |form|. Differs from PasswordsFillingForm in that the username must match. // Caller is responsible for deleting the returned forms. - std::vector<webkit_glue::PasswordForm*> PasswordsMergeableWithForm( - const webkit_glue::PasswordForm& query_form); + std::vector<webkit::forms::PasswordForm*> PasswordsMergeableWithForm( + const webkit::forms::PasswordForm& query_form); // Returns the PasswordForm for the Keychain entry that matches |form| on all // of the fields that uniquely identify a Keychain item, or NULL if there is // no such entry. // Caller is responsible for deleting the returned form. - webkit_glue::PasswordForm* PasswordExactlyMatchingForm( - const webkit_glue::PasswordForm& query_form); + webkit::forms::PasswordForm* PasswordExactlyMatchingForm( + const webkit::forms::PasswordForm& query_form); // Returns true if PasswordsMergeableWithForm would return any items. This is // a separate method because calling PasswordsMergeableWithForm and checking // the return count would require reading the passwords from the keychain, // thus potentially triggering authorizaiton UI, whereas this won't. bool HasPasswordsMergeableWithForm( - const webkit_glue::PasswordForm& query_form); + const webkit::forms::PasswordForm& query_form); // Returns all keychain items of types corresponding to password forms. - std::vector<webkit_glue::PasswordForm*> GetAllPasswordFormPasswords(); + std::vector<webkit::forms::PasswordForm*> GetAllPasswordFormPasswords(); // Creates a new keychain entry from |form|, or updates the password of an // existing keychain entry if there is a collision. Returns true if a keychain // entry was successfully added/updated. - bool AddPassword(const webkit_glue::PasswordForm& form); + bool AddPassword(const webkit::forms::PasswordForm& form); // Removes the keychain password matching |form| if any. Returns true if a // keychain item was found and successfully removed. - bool RemovePassword(const webkit_glue::PasswordForm& form); + bool RemovePassword(const webkit::forms::PasswordForm& form); // Controls whether or not Chrome will restrict Keychain searches to items // that it created. Defaults to false. @@ -68,22 +68,24 @@ class MacKeychainPasswordFormAdapter { // Returns PasswordForms constructed from the given Keychain items, calling // MacKeychain::Free on all of the keychain items and clearing the vector. // Caller is responsible for deleting the returned forms. - std::vector<webkit_glue::PasswordForm*> ConvertKeychainItemsToForms( + std::vector<webkit::forms::PasswordForm*> ConvertKeychainItemsToForms( std::vector<SecKeychainItemRef>* items); // Searches |keychain| for the specific keychain entry that corresponds to the // given form, and returns it (or NULL if no match is found). The caller is // responsible for calling MacKeychain::Free on on the returned item. SecKeychainItemRef KeychainItemForForm( - const webkit_glue::PasswordForm& form); + const webkit::forms::PasswordForm& form); // Returns the Keychain items matching the given signon_realm, scheme, and // optionally path and username (either of both can be NULL). // The caller is responsible for calling MacKeychain::Free on the // returned items. std::vector<SecKeychainItemRef> MatchingKeychainItems( - const std::string& signon_realm, webkit_glue::PasswordForm::Scheme scheme, - const char* path, const char* username); + const std::string& signon_realm, + webkit::forms::PasswordForm::Scheme scheme, + const char* path, + const char* username); // Takes a PasswordForm's signon_realm and parses it into its component parts, // which are returned though the appropriate out parameters. @@ -97,7 +99,7 @@ class MacKeychainPasswordFormAdapter { // Returns the Keychain SecAuthenticationType type corresponding to |scheme|. SecAuthenticationType AuthTypeForScheme( - webkit_glue::PasswordForm::Scheme scheme); + webkit::forms::PasswordForm::Scheme scheme); // Changes the password for keychain_item to |password|; returns true if the // password was successfully changed. @@ -139,12 +141,12 @@ namespace internal_keychain_helpers { // require authorization). bool FillPasswordFormFromKeychainItem(const MacKeychain& keychain, const SecKeychainItemRef& keychain_item, - webkit_glue::PasswordForm* form); + webkit::forms::PasswordForm* form); // Returns true if the two given forms match based on signon_reaml, scheme, and // username_value, and are thus suitable for merging (see MergePasswordForms). -bool FormsMatchForMerge(const webkit_glue::PasswordForm& form_a, - const webkit_glue::PasswordForm& form_b); +bool FormsMatchForMerge(const webkit::forms::PasswordForm& form_a, + const webkit::forms::PasswordForm& form_b); // Populates merged_forms by combining the password data from keychain_forms and // the metadata from database_forms, removing used entries from the two source @@ -155,16 +157,17 @@ bool FormsMatchForMerge(const webkit_glue::PasswordForm& form_a, // password can be found (and which aren't blacklist entries), and for // keychain_forms it's entries that weren't merged into at least one database // form. -void MergePasswordForms(std::vector<webkit_glue::PasswordForm*>* keychain_forms, - std::vector<webkit_glue::PasswordForm*>* database_forms, - std::vector<webkit_glue::PasswordForm*>* merged_forms); +void MergePasswordForms( + std::vector<webkit::forms::PasswordForm*>* keychain_forms, + std::vector<webkit::forms::PasswordForm*>* database_forms, + std::vector<webkit::forms::PasswordForm*>* merged_forms); // Fills in the passwords for as many of the forms in |database_forms| as // possible using entries from |keychain| and returns them. On return, // |database_forms| will contain only the forms for which no password was found. -std::vector<webkit_glue::PasswordForm*> GetPasswordsForForms( +std::vector<webkit::forms::PasswordForm*> GetPasswordsForForms( const MacKeychain& keychain, - std::vector<webkit_glue::PasswordForm*>* database_forms); + std::vector<webkit::forms::PasswordForm*>* database_forms); } // internal_keychain_helpers diff --git a/chrome/browser/password_manager/password_store_mac_unittest.cc b/chrome/browser/password_manager/password_store_mac_unittest.cc index 7061ca4..36fb22e 100644 --- a/chrome/browser/password_manager/password_store_mac_unittest.cc +++ b/chrome/browser/password_manager/password_store_mac_unittest.cc @@ -20,7 +20,7 @@ #include "content/test/test_browser_thread.h" using content::BrowserThread; -using webkit_glue::PasswordForm; +using webkit::forms::PasswordForm; using testing::_; using testing::DoAll; using testing::WithArg; @@ -31,7 +31,7 @@ class MockPasswordStoreConsumer : public PasswordStoreConsumer { public: MOCK_METHOD2(OnPasswordStoreRequestDone, void(CancelableRequestProvider::Handle, - const std::vector<webkit_glue::PasswordForm*>&)); + const std::vector<webkit::forms::PasswordForm*>&)); }; ACTION(STLDeleteElements0) { diff --git a/chrome/browser/password_manager/password_store_win.cc b/chrome/browser/password_manager/password_store_win.cc index acb296d..122f5db 100644 --- a/chrome/browser/password_manager/password_store_win.cc +++ b/chrome/browser/password_manager/password_store_win.cc @@ -16,7 +16,7 @@ #include "chrome/browser/webdata/web_data_service.h" using content::BrowserThread; -using webkit_glue::PasswordForm; +using webkit::forms::PasswordForm; namespace { // Subclass GetLoginsRequest in order to hold a copy of the form information diff --git a/chrome/browser/password_manager/password_store_win.h b/chrome/browser/password_manager/password_store_win.h index 6b1fe8b..689c948 100644 --- a/chrome/browser/password_manager/password_store_win.h +++ b/chrome/browser/password_manager/password_store_win.h @@ -13,9 +13,11 @@ class LoginDatabase; class Profile; class WebDataService; -namespace webkit_glue { +namespace webkit { +namespace forms { struct PasswordForm; } +} // Windows PasswordStore implementation that uses the default implementation, // but also uses IE7 passwords if no others found. @@ -43,7 +45,7 @@ class PasswordStoreWin : public PasswordStoreDefault { // Overridden so that we can save the form for later use. virtual void GetLoginsImpl(GetLoginsRequest* request, - const webkit_glue::PasswordForm& form) OVERRIDE; + const webkit::forms::PasswordForm& form) OVERRIDE; scoped_ptr<DBHandler> db_handler_; diff --git a/chrome/browser/password_manager/password_store_win_unittest.cc b/chrome/browser/password_manager/password_store_win_unittest.cc index 09e6d96..8e1a185 100644 --- a/chrome/browser/password_manager/password_store_win_unittest.cc +++ b/chrome/browser/password_manager/password_store_win_unittest.cc @@ -32,7 +32,7 @@ using content::BrowserThread; using testing::_; using testing::DoAll; using testing::WithArg; -using webkit_glue::PasswordForm; +using webkit::forms::PasswordForm; namespace { @@ -40,7 +40,7 @@ class MockPasswordStoreConsumer : public PasswordStoreConsumer { public: MOCK_METHOD2(OnPasswordStoreRequestDone, void(CancelableRequestProvider::Handle, - const std::vector<webkit_glue::PasswordForm*>&)); + const std::vector<webkit::forms::PasswordForm*>&)); }; class MockWebDataServiceConsumer : public WebDataServiceConsumer { diff --git a/chrome/browser/password_manager/password_store_x.cc b/chrome/browser/password_manager/password_store_x.cc index fe9640d..f72e951 100644 --- a/chrome/browser/password_manager/password_store_x.cc +++ b/chrome/browser/password_manager/password_store_x.cc @@ -20,7 +20,7 @@ using content::BrowserThread; using std::vector; -using webkit_glue::PasswordForm; +using webkit::forms::PasswordForm; PasswordStoreX::PasswordStoreX(LoginDatabase* login_db, Profile* profile, diff --git a/chrome/browser/password_manager/password_store_x.h b/chrome/browser/password_manager/password_store_x.h index ae64993..9fddfcd 100644 --- a/chrome/browser/password_manager/password_store_x.h +++ b/chrome/browser/password_manager/password_store_x.h @@ -30,18 +30,18 @@ class PasswordStoreX : public PasswordStoreDefault { // with return values rather than implicit consumer notification. class NativeBackend { public: - typedef std::vector<webkit_glue::PasswordForm*> PasswordFormList; + typedef std::vector<webkit::forms::PasswordForm*> PasswordFormList; virtual ~NativeBackend() {} virtual bool Init() = 0; - virtual bool AddLogin(const webkit_glue::PasswordForm& form) = 0; - virtual bool UpdateLogin(const webkit_glue::PasswordForm& form) = 0; - virtual bool RemoveLogin(const webkit_glue::PasswordForm& form) = 0; + virtual bool AddLogin(const webkit::forms::PasswordForm& form) = 0; + virtual bool UpdateLogin(const webkit::forms::PasswordForm& form) = 0; + virtual bool RemoveLogin(const webkit::forms::PasswordForm& form) = 0; virtual bool RemoveLoginsCreatedBetween(const base::Time& delete_begin, const base::Time& delete_end) = 0; - virtual bool GetLogins(const webkit_glue::PasswordForm& form, + virtual bool GetLogins(const webkit::forms::PasswordForm& form, PasswordFormList* forms) = 0; virtual bool GetLoginsCreatedBetween(const base::Time& get_begin, const base::Time& get_end, @@ -76,19 +76,21 @@ class PasswordStoreX : public PasswordStoreDefault { virtual ~PasswordStoreX(); // Implements PasswordStore interface. - virtual void AddLoginImpl(const webkit_glue::PasswordForm& form) OVERRIDE; - virtual void UpdateLoginImpl(const webkit_glue::PasswordForm& form) OVERRIDE; - virtual void RemoveLoginImpl(const webkit_glue::PasswordForm& form) OVERRIDE; + virtual void AddLoginImpl(const webkit::forms::PasswordForm& form) OVERRIDE; + virtual void UpdateLoginImpl( + const webkit::forms::PasswordForm& form) OVERRIDE; + virtual void RemoveLoginImpl( + const webkit::forms::PasswordForm& form) OVERRIDE; virtual void RemoveLoginsCreatedBetweenImpl( const base::Time& delete_begin, const base::Time& delete_end) OVERRIDE; virtual void GetLoginsImpl(GetLoginsRequest* request, - const webkit_glue::PasswordForm& form) OVERRIDE; + const webkit::forms::PasswordForm& form) OVERRIDE; virtual void GetAutofillableLoginsImpl(GetLoginsRequest* request) OVERRIDE; virtual void GetBlacklistLoginsImpl(GetLoginsRequest* request) OVERRIDE; virtual bool FillAutofillableLogins( - std::vector<webkit_glue::PasswordForm*>* forms) OVERRIDE; + std::vector<webkit::forms::PasswordForm*>* forms) OVERRIDE; virtual bool FillBlacklistLogins( - std::vector<webkit_glue::PasswordForm*>* forms) OVERRIDE; + std::vector<webkit::forms::PasswordForm*>* forms) OVERRIDE; // Sort logins by origin, like the ORDER BY clause in login_database.cc. void SortLoginsByOrigin(NativeBackend::PasswordFormList* list); diff --git a/chrome/browser/password_manager/password_store_x_unittest.cc b/chrome/browser/password_manager/password_store_x_unittest.cc index ad33db6..15a4a62 100644 --- a/chrome/browser/password_manager/password_store_x_unittest.cc +++ b/chrome/browser/password_manager/password_store_x_unittest.cc @@ -40,7 +40,7 @@ using testing::ElementsAreArray; using testing::Pointee; using testing::Property; using testing::WithArg; -using webkit_glue::PasswordForm; +using webkit::forms::PasswordForm; typedef std::vector<PasswordForm*> VectorOfForms; |