summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvabr@chromium.org <vabr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-09 13:07:31 +0000
committervabr@chromium.org <vabr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-09 13:07:31 +0000
commit73cd58306c197de2f13e6f529c2f4e13f413263c (patch)
tree64ced88180c7e21a9fecb13fc13b653546dcde2f
parent0c9052ee54f48b9813ddfbd018902e5029a97160 (diff)
downloadchromium_src-73cd58306c197de2f13e6f529c2f4e13f413263c.zip
chromium_src-73cd58306c197de2f13e6f529c2f4e13f413263c.tar.gz
chromium_src-73cd58306c197de2f13e6f529c2f4e13f413263c.tar.bz2
Put all in components/password_manager in password_manager namespace.
BUG=348523 TBR=jochen@chromium.org Review URL: https://codereview.chromium.org/225093012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@262680 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/browsing_data/browsing_data_remover.cc5
-rw-r--r--chrome/browser/password_manager/chrome_password_manager_client.cc22
-rw-r--r--chrome/browser/password_manager/chrome_password_manager_client.h30
-rw-r--r--chrome/browser/password_manager/chrome_password_manager_client_unittest.cc3
-rw-r--r--chrome/browser/password_manager/mock_password_store_service.cc5
-rw-r--r--chrome/browser/password_manager/mock_password_store_service.h8
-rw-r--r--chrome/browser/password_manager/native_backend_gnome_x.cc1
-rw-r--r--chrome/browser/password_manager/native_backend_gnome_x_unittest.cc2
-rw-r--r--chrome/browser/password_manager/password_manager_metrics_util_unittest.cc13
-rw-r--r--chrome/browser/password_manager/password_manager_util_win.cc20
-rw-r--r--chrome/browser/password_manager/password_store_factory.cc16
-rw-r--r--chrome/browser/password_manager/password_store_factory.h17
-rw-r--r--chrome/browser/password_manager/password_store_mac.cc10
-rw-r--r--chrome/browser/password_manager/password_store_mac.h21
-rw-r--r--chrome/browser/password_manager/password_store_mac_unittest.cc3
-rw-r--r--chrome/browser/password_manager/password_store_win.cc3
-rw-r--r--chrome/browser/password_manager/password_store_win.h9
-rw-r--r--chrome/browser/password_manager/password_store_win_unittest.cc5
-rw-r--r--chrome/browser/password_manager/password_store_x.cc5
-rw-r--r--chrome/browser/password_manager/password_store_x.h20
-rw-r--r--chrome/browser/password_manager/password_store_x_unittest.cc60
-rw-r--r--chrome/browser/password_manager/save_password_infobar_delegate.cc24
-rw-r--r--chrome/browser/password_manager/save_password_infobar_delegate.h11
-rw-r--r--chrome/browser/password_manager/test_password_store_service.cc5
-rw-r--r--chrome/browser/password_manager/test_password_store_service.h8
-rw-r--r--chrome/browser/policy/configuration_policy_handler_list_factory.cc4
-rw-r--r--chrome/browser/prefs/browser_prefs.cc4
-rw-r--r--chrome/browser/prerender/prerender_tab_helper.cc7
-rw-r--r--chrome/browser/prerender/prerender_tab_helper.h10
-rw-r--r--chrome/browser/profiles/profile.h1
-rw-r--r--chrome/browser/sync/glue/password_data_type_controller.h7
-rw-r--r--chrome/browser/sync/glue/password_model_worker.cc5
-rw-r--r--chrome/browser/sync/glue/password_model_worker.h13
-rw-r--r--chrome/browser/sync/glue/sync_backend_registrar.cc2
-rw-r--r--chrome/browser/sync/profile_sync_components_factory_impl.cc5
-rw-r--r--chrome/browser/sync/test/integration/passwords_helper.cc12
-rw-r--r--chrome/browser/sync/test/integration/passwords_helper.h19
-rw-r--r--chrome/browser/sync/test/integration/two_client_preferences_sync_test.cc30
-rw-r--r--chrome/browser/ui/android/login_prompt_android.cc2
-rw-r--r--chrome/browser/ui/autofill/password_generation_popup_controller_impl.cc4
-rw-r--r--chrome/browser/ui/autofill/password_generation_popup_controller_impl.h8
-rw-r--r--chrome/browser/ui/autofill/tab_autofill_manager_delegate.cc2
-rw-r--r--chrome/browser/ui/cocoa/browser/password_generation_bubble_controller.h9
-rw-r--r--chrome/browser/ui/cocoa/browser/password_generation_bubble_controller.mm2
-rw-r--r--chrome/browser/ui/cocoa/login_prompt_cocoa.mm2
-rw-r--r--chrome/browser/ui/login/login_prompt.cc7
-rw-r--r--chrome/browser/ui/login/login_prompt.h12
-rw-r--r--chrome/browser/ui/passwords/manage_passwords_bubble_model.cc5
-rw-r--r--chrome/browser/ui/passwords/manage_passwords_bubble_ui_controller.cc1
-rw-r--r--chrome/browser/ui/passwords/manage_passwords_bubble_ui_controller.h4
-rw-r--r--chrome/browser/ui/passwords/password_manager_presenter.cc6
-rw-r--r--chrome/browser/ui/passwords/password_manager_presenter.h10
-rw-r--r--chrome/browser/ui/sync/one_click_signin_helper.cc7
-rw-r--r--chrome/browser/ui/sync/one_click_signin_helper.h9
-rw-r--r--chrome/browser/ui/views/login_prompt_views.cc2
-rw-r--r--chrome/browser/ui/views/login_view.cc3
-rw-r--r--chrome/browser/ui/views/login_view.h8
-rw-r--r--chrome/browser/ui/views/password_generation_bubble_view.cc2
-rw-r--r--chrome/browser/ui/views/password_generation_bubble_view.h21
-rw-r--r--chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc26
-rw-r--r--chrome/browser/ui/views/passwords/manage_passwords_bubble_view.h6
-rw-r--r--chrome/browser/ui/views/passwords/manage_passwords_icon_view.cc2
-rw-r--r--chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc2
-rw-r--r--chrome/browser/ui/webui/password_manager_internals/password_manager_internals_ui.h5
-rw-r--r--chrome/browser/ui/webui/password_manager_internals/password_manager_internals_ui_browsertest.cc3
-rw-r--r--chrome/test/base/profile_mock.h7
-rw-r--r--components/password_manager/content/browser/content_password_manager_driver.cc4
-rw-r--r--components/password_manager/content/browser/content_password_manager_driver.h4
-rw-r--r--components/password_manager/core/browser/login_database.cc4
-rw-r--r--components/password_manager/core/browser/login_database.h4
-rw-r--r--components/password_manager/core/browser/login_database_mac.cc4
-rw-r--r--components/password_manager/core/browser/login_database_posix.cc4
-rw-r--r--components/password_manager/core/browser/login_database_unittest.cc4
-rw-r--r--components/password_manager/core/browser/login_database_win.cc4
-rw-r--r--components/password_manager/core/browser/login_model.h4
-rw-r--r--components/password_manager/core/browser/mock_password_store.cc4
-rw-r--r--components/password_manager/core/browser/mock_password_store.h4
-rw-r--r--components/password_manager/core/browser/password_form_data.cc4
-rw-r--r--components/password_manager/core/browser/password_form_data.h4
-rw-r--r--components/password_manager/core/browser/password_form_manager.cc4
-rw-r--r--components/password_manager/core/browser/password_form_manager.h5
-rw-r--r--components/password_manager/core/browser/password_form_manager_unittest.cc4
-rw-r--r--components/password_manager/core/browser/password_generation_manager.cc4
-rw-r--r--components/password_manager/core/browser/password_generation_manager.h10
-rw-r--r--components/password_manager/core/browser/password_generation_manager_unittest.cc4
-rw-r--r--components/password_manager/core/browser/password_manager.cc14
-rw-r--r--components/password_manager/core/browser/password_manager.h13
-rw-r--r--components/password_manager/core/browser/password_manager_client.cc4
-rw-r--r--components/password_manager/core/browser/password_manager_client.h7
-rw-r--r--components/password_manager/core/browser/password_manager_driver.h10
-rw-r--r--components/password_manager/core/browser/password_manager_logger.h4
-rw-r--r--components/password_manager/core/browser/password_manager_metrics_util.cc8
-rw-r--r--components/password_manager/core/browser/password_manager_metrics_util.h8
-rw-r--r--components/password_manager/core/browser/password_manager_unittest.cc4
-rw-r--r--components/password_manager/core/browser/password_store.cc4
-rw-r--r--components/password_manager/core/browser/password_store.h23
-rw-r--r--components/password_manager/core/browser/password_store_change.h4
-rw-r--r--components/password_manager/core/browser/password_store_consumer.cc4
-rw-r--r--components/password_manager/core/browser/password_store_consumer.h4
-rw-r--r--components/password_manager/core/browser/password_store_default.cc4
-rw-r--r--components/password_manager/core/browser/password_store_default.h4
-rw-r--r--components/password_manager/core/browser/password_store_default_unittest.cc4
-rw-r--r--components/password_manager/core/browser/password_store_unittest.cc4
-rw-r--r--components/password_manager/core/browser/password_syncable_service.cc4
-rw-r--r--components/password_manager/core/browser/password_syncable_service.h4
-rw-r--r--components/password_manager/core/browser/password_syncable_service_unittest.cc4
-rw-r--r--components/password_manager/core/browser/psl_matching_helper.cc4
-rw-r--r--components/password_manager/core/browser/psl_matching_helper.h4
-rw-r--r--components/password_manager/core/browser/psl_matching_helper_unittest.cc8
-rw-r--r--components/password_manager/core/browser/test_password_store.cc4
-rw-r--r--components/password_manager/core/browser/test_password_store.h4
-rw-r--r--components/password_manager/core/common/password_manager_pref_names.cc4
-rw-r--r--components/password_manager/core/common/password_manager_pref_names.h4
-rw-r--r--components/password_manager/core/common/password_manager_switches.cc4
-rw-r--r--components/password_manager/core/common/password_manager_switches.h4
115 files changed, 604 insertions, 280 deletions
diff --git a/chrome/browser/browsing_data/browsing_data_remover.cc b/chrome/browser/browsing_data/browsing_data_remover.cc
index 2c070d1..55a7dc8 100644
--- a/chrome/browser/browsing_data/browsing_data_remover.cc
+++ b/chrome/browser/browsing_data/browsing_data_remover.cc
@@ -514,8 +514,9 @@ void BrowsingDataRemover::RemoveImpl(int remove_mask,
if (remove_mask & REMOVE_PASSWORDS) {
content::RecordAction(UserMetricsAction("ClearBrowsingData_Passwords"));
- PasswordStore* password_store = PasswordStoreFactory::GetForProfile(
- profile_, Profile::EXPLICIT_ACCESS).get();
+ password_manager::PasswordStore* password_store =
+ PasswordStoreFactory::GetForProfile(profile_, Profile::EXPLICIT_ACCESS)
+ .get();
if (password_store)
password_store->RemoveLoginsCreatedBetween(delete_begin_, delete_end_);
diff --git a/chrome/browser/password_manager/chrome_password_manager_client.cc b/chrome/browser/password_manager/chrome_password_manager_client.cc
index 24b1d4d..586087a 100644
--- a/chrome/browser/password_manager/chrome_password_manager_client.cc
+++ b/chrome/browser/password_manager/chrome_password_manager_client.cc
@@ -64,7 +64,7 @@ ChromePasswordManagerClient::ChromePasswordManagerClient(
ChromePasswordManagerClient::~ChromePasswordManagerClient() {}
void ChromePasswordManagerClient::PromptUserToSavePassword(
- PasswordFormManager* form_to_save) {
+ password_manager::PasswordFormManager* form_to_save) {
if (IsTheHotNewBubbleUIEnabled()) {
ManagePasswordsBubbleUIController* manage_passwords_bubble_ui_controller =
ManagePasswordsBubbleUIController::FromWebContents(web_contents());
@@ -75,8 +75,8 @@ void ChromePasswordManagerClient::PromptUserToSavePassword(
}
} else {
std::string uma_histogram_suffix(
- password_manager_metrics_util::GroupIdToString(
- password_manager_metrics_util::MonitoredDomainGroupId(
+ password_manager::metrics_util::GroupIdToString(
+ password_manager::metrics_util::MonitoredDomainGroupId(
form_to_save->realm(), GetPrefs())));
SavePasswordInfoBarDelegate::Create(
web_contents(), form_to_save, uma_histogram_suffix);
@@ -126,7 +126,8 @@ PrefService* ChromePasswordManagerClient::GetPrefs() {
return GetProfile()->GetPrefs();
}
-PasswordStore* ChromePasswordManagerClient::GetPasswordStore() {
+password_manager::PasswordStore*
+ChromePasswordManagerClient::GetPasswordStore() {
// Always use EXPLICIT_ACCESS as the password manager checks IsOffTheRecord
// itself when it shouldn't access the PasswordStore.
// TODO(gcasto): Is is safe to change this to Profile::IMPLICIT_ACCESS?
@@ -134,7 +135,8 @@ PasswordStore* ChromePasswordManagerClient::GetPasswordStore() {
Profile::EXPLICIT_ACCESS).get();
}
-PasswordManagerDriver* ChromePasswordManagerClient::GetDriver() {
+password_manager::PasswordManagerDriver*
+ChromePasswordManagerClient::GetDriver() {
return &driver_;
}
@@ -142,7 +144,8 @@ base::FieldTrial::Probability
ChromePasswordManagerClient::GetProbabilityForExperiment(
const std::string& experiment_name) {
base::FieldTrial::Probability enabled_probability = 0;
- if (experiment_name == PasswordManager::kOtherPossibleUsernamesExperiment) {
+ if (experiment_name ==
+ password_manager::PasswordManager::kOtherPossibleUsernamesExperiment) {
switch (chrome::VersionInfo::GetChannel()) {
case chrome::VersionInfo::CHANNEL_DEV:
case chrome::VersionInfo::CHANNEL_BETA:
@@ -164,7 +167,7 @@ bool ChromePasswordManagerClient::IsPasswordSyncEnabled() {
}
void ChromePasswordManagerClient::SetLogger(
- PasswordManagerLogger* logger) {
+ password_manager::PasswordManagerLogger* logger) {
// We should never be replacing one logger with a different one, because that
// will leave the first without further updates, and the user likely confused.
// TODO(vabr): For the reason above, before moving the internals page from
@@ -181,7 +184,7 @@ void ChromePasswordManagerClient::LogSavePasswordProgress(
}
// static
-PasswordGenerationManager*
+password_manager::PasswordGenerationManager*
ChromePasswordManagerClient::GetGenerationManagerFromWebContents(
content::WebContents* contents) {
ChromePasswordManagerClient* client =
@@ -192,7 +195,8 @@ ChromePasswordManagerClient::GetGenerationManagerFromWebContents(
}
// static
-PasswordManager* ChromePasswordManagerClient::GetManagerFromWebContents(
+password_manager::PasswordManager*
+ChromePasswordManagerClient::GetManagerFromWebContents(
content::WebContents* contents) {
ChromePasswordManagerClient* client =
ChromePasswordManagerClient::FromWebContents(contents);
diff --git a/chrome/browser/password_manager/chrome_password_manager_client.h b/chrome/browser/password_manager/chrome_password_manager_client.h
index bfdc6faf..216e445 100644
--- a/chrome/browser/password_manager/chrome_password_manager_client.h
+++ b/chrome/browser/password_manager/chrome_password_manager_client.h
@@ -13,8 +13,6 @@
#include "content/public/browser/web_contents_user_data.h"
#include "ui/gfx/rect.h"
-class PasswordGenerationManager;
-class PasswordManager;
class Profile;
namespace autofill {
@@ -26,29 +24,35 @@ namespace content {
class WebContents;
}
+namespace password_manager {
+class PasswordGenerationManager;
+class PasswordManager;
+}
+
// ChromePasswordManagerClient implements the PasswordManagerClient interface.
class ChromePasswordManagerClient
- : public PasswordManagerClient,
+ : public password_manager::PasswordManagerClient,
public content::WebContentsObserver,
public content::WebContentsUserData<ChromePasswordManagerClient> {
public:
virtual ~ChromePasswordManagerClient();
// PasswordManagerClient implementation.
- virtual void PromptUserToSavePassword(PasswordFormManager* form_to_save)
- OVERRIDE;
+ virtual void PromptUserToSavePassword(
+ password_manager::PasswordFormManager* form_to_save) OVERRIDE;
virtual void PasswordWasAutofilled(
const autofill::PasswordFormMap& best_matches) const OVERRIDE;
virtual void PasswordAutofillWasBlocked() const OVERRIDE;
virtual void AuthenticateAutofillAndFillForm(
scoped_ptr<autofill::PasswordFormFillData> fill_data) OVERRIDE;
virtual PrefService* GetPrefs() OVERRIDE;
- virtual PasswordStore* GetPasswordStore() OVERRIDE;
- virtual PasswordManagerDriver* GetDriver() OVERRIDE;
+ virtual password_manager::PasswordStore* GetPasswordStore() OVERRIDE;
+ virtual password_manager::PasswordManagerDriver* GetDriver() OVERRIDE;
virtual base::FieldTrial::Probability GetProbabilityForExperiment(
const std::string& experiment_name) OVERRIDE;
virtual bool IsPasswordSyncEnabled() OVERRIDE;
- virtual void SetLogger(PasswordManagerLogger* logger) OVERRIDE;
+ virtual void SetLogger(password_manager::PasswordManagerLogger* logger)
+ OVERRIDE;
virtual void LogSavePasswordProgress(const std::string& text) OVERRIDE;
// Hides any visible generation UI.
@@ -56,13 +60,13 @@ class ChromePasswordManagerClient
// Convenience method to allow //chrome code easy access to a PasswordManager
// from a WebContents instance.
- static PasswordManager* GetManagerFromWebContents(
+ static password_manager::PasswordManager* GetManagerFromWebContents(
content::WebContents* contents);
// Convenience method to allow //chrome code easy access to a
// PasswordGenerationManager from a WebContents instance.
- static PasswordGenerationManager* GetGenerationManagerFromWebContents(
- content::WebContents* contents);
+ static password_manager::PasswordGenerationManager*
+ GetGenerationManagerFromWebContents(content::WebContents* contents);
// Observer for PasswordGenerationPopup events. Used for testing.
void SetTestObserver(autofill::PasswordGenerationPopupObserver* observer);
@@ -96,7 +100,7 @@ class ChromePasswordManagerClient
Profile* GetProfile();
- ContentPasswordManagerDriver driver_;
+ password_manager::ContentPasswordManagerDriver driver_;
// Observer for password generation popup.
autofill::PasswordGenerationPopupObserver* observer_;
@@ -111,7 +115,7 @@ class ChromePasswordManagerClient
// Points to an active logger instance to use for, e.g., reporting progress on
// saving passwords. If there is no active logger (most of the time), the
// pointer will be NULL.
- PasswordManagerLogger* logger_;
+ password_manager::PasswordManagerLogger* logger_;
DISALLOW_COPY_AND_ASSIGN(ChromePasswordManagerClient);
};
diff --git a/chrome/browser/password_manager/chrome_password_manager_client_unittest.cc b/chrome/browser/password_manager/chrome_password_manager_client_unittest.cc
index 6a75ab7..e2b31e3 100644
--- a/chrome/browser/password_manager/chrome_password_manager_client_unittest.cc
+++ b/chrome/browser/password_manager/chrome_password_manager_client_unittest.cc
@@ -16,7 +16,8 @@ using content::WebContents;
namespace {
-class MockPasswordManagerLogger : public PasswordManagerLogger {
+class MockPasswordManagerLogger
+ : public password_manager::PasswordManagerLogger {
public:
MockPasswordManagerLogger() {}
diff --git a/chrome/browser/password_manager/mock_password_store_service.cc b/chrome/browser/password_manager/mock_password_store_service.cc
index 64d8da5..925431e 100644
--- a/chrome/browser/password_manager/mock_password_store_service.cc
+++ b/chrome/browser/password_manager/mock_password_store_service.cc
@@ -9,14 +9,15 @@
// static
KeyedService* MockPasswordStoreService::Build(
content::BrowserContext* /*profile*/) {
- scoped_refptr<PasswordStore> store(new MockPasswordStore);
+ scoped_refptr<password_manager::PasswordStore> store(
+ new password_manager::MockPasswordStore);
if (!store || !store->Init(syncer::SyncableService::StartSyncFlare()))
return NULL;
return new MockPasswordStoreService(store);
}
MockPasswordStoreService::MockPasswordStoreService(
- scoped_refptr<PasswordStore> password_store)
+ scoped_refptr<password_manager::PasswordStore> password_store)
: PasswordStoreService(password_store) {}
MockPasswordStoreService::~MockPasswordStoreService() {}
diff --git a/chrome/browser/password_manager/mock_password_store_service.h b/chrome/browser/password_manager/mock_password_store_service.h
index 1552b42a..3f0fda5 100644
--- a/chrome/browser/password_manager/mock_password_store_service.h
+++ b/chrome/browser/password_manager/mock_password_store_service.h
@@ -7,19 +7,21 @@
#include "chrome/browser/password_manager/password_store_factory.h"
-class PasswordStore;
-
namespace content {
class BrowserContext;
}
+namespace password_manager {
+class PasswordStore;
+}
+
class MockPasswordStoreService : public PasswordStoreService {
public:
static KeyedService* Build(content::BrowserContext* profile);
private:
explicit MockPasswordStoreService(
- scoped_refptr<PasswordStore> password_store);
+ scoped_refptr<password_manager::PasswordStore> password_store);
virtual ~MockPasswordStoreService();
diff --git a/chrome/browser/password_manager/native_backend_gnome_x.cc b/chrome/browser/password_manager/native_backend_gnome_x.cc
index ca3059b..83522a4 100644
--- a/chrome/browser/password_manager/native_backend_gnome_x.cc
+++ b/chrome/browser/password_manager/native_backend_gnome_x.cc
@@ -30,6 +30,7 @@ using autofill::PasswordForm;
using base::UTF8ToUTF16;
using base::UTF16ToUTF8;
using content::BrowserThread;
+using password_manager::PSLMatchingHelper;
#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_unittest.cc b/chrome/browser/password_manager/native_backend_gnome_x_unittest.cc
index bdc9dfa..66f9902 100644
--- a/chrome/browser/password_manager/native_backend_gnome_x_unittest.cc
+++ b/chrome/browser/password_manager/native_backend_gnome_x_unittest.cc
@@ -402,7 +402,7 @@ class NativeBackendGnomeTest : public testing::Test {
void CheckCredentialAvailability(const PasswordForm& credentials,
const std::string& url,
bool should_credential_be_available_to_url) {
- PSLMatchingHelper helper;
+ password_manager::PSLMatchingHelper helper;
ASSERT_TRUE(helper.IsMatchingEnabled())
<< "PSL matching needs to be enabled.";
diff --git a/chrome/browser/password_manager/password_manager_metrics_util_unittest.cc b/chrome/browser/password_manager/password_manager_metrics_util_unittest.cc
index bac1304..b662dc2 100644
--- a/chrome/browser/password_manager/password_manager_metrics_util_unittest.cc
+++ b/chrome/browser/password_manager/password_manager_metrics_util_unittest.cc
@@ -20,7 +20,7 @@ class PasswordManagerMetricsUtilTest : public testing::Test {
protected:
bool IsMonitored(const char* url_host) {
- size_t group_id = password_manager_metrics_util::MonitoredDomainGroupId(
+ size_t group_id = password_manager::metrics_util::MonitoredDomainGroupId(
url_host, profile_.GetPrefs());
return group_id > 0;
}
@@ -50,16 +50,17 @@ TEST_F(PasswordManagerMetricsUtilTest, MonitoredDomainGroupAssigmentTest) {
// Provide all possible values of the group id parameter for each monitored
// website.
for (size_t i = 0; i < kMonitoredWebsitesLength; ++i) {
- for (size_t j = 0; j < password_manager_metrics_util::kGroupsPerDomain;
+ for (size_t j = 0; j < password_manager::metrics_util::kGroupsPerDomain;
++j) {
{ // Set the group index for domain |i| to |j|.
- ListPrefUpdate group_indices(profile_.GetPrefs(),
- prefs::kPasswordManagerGroupsForDomains);
+ ListPrefUpdate group_indices(
+ profile_.GetPrefs(),
+ password_manager::prefs::kPasswordManagerGroupsForDomains);
group_indices->Set(i, new base::FundamentalValue(static_cast<int>(j)));
} // At the end of the scope the prefs get updated.
- ++groups[password_manager_metrics_util::MonitoredDomainGroupId(
- kMonitoredWebsites[i], profile_.GetPrefs())];
+ ++groups[password_manager::metrics_util::MonitoredDomainGroupId(
+ kMonitoredWebsites[i], profile_.GetPrefs())];
}
}
diff --git a/chrome/browser/password_manager/password_manager_util_win.cc b/chrome/browser/password_manager/password_manager_util_win.cc
index c38a35a..bee9733 100644
--- a/chrome/browser/password_manager/password_manager_util_win.cc
+++ b/chrome/browser/password_manager/password_manager_util_win.cc
@@ -35,9 +35,12 @@
#endif
// static
-void PasswordManager::RegisterLocalPrefs(PrefRegistrySimple* registry) {
- registry->RegisterInt64Pref(prefs::kOsPasswordLastChanged, 0);
- registry->RegisterBooleanPref(prefs::kOsPasswordBlank, false);
+void password_manager::PasswordManager::RegisterLocalPrefs(
+ PrefRegistrySimple* registry) {
+ registry->RegisterInt64Pref(password_manager::prefs::kOsPasswordLastChanged,
+ 0);
+ registry->RegisterBooleanPref(password_manager::prefs::kOsPasswordBlank,
+ false);
}
namespace password_manager_util {
@@ -81,9 +84,10 @@ static bool CheckBlankPassword(WCHAR* username) {
if (last_changed == -1)
return false;
- blank_password = local_state->GetBoolean(prefs::kOsPasswordBlank);
+ blank_password =
+ local_state->GetBoolean(password_manager::prefs::kOsPasswordBlank);
int64 pref_last_changed =
- local_state->GetInt64(prefs::kOsPasswordLastChanged);
+ local_state->GetInt64(password_manager::prefs::kOsPasswordLastChanged);
if (pref_last_changed > 0 && last_changed <= pref_last_changed) {
need_recheck = false;
}
@@ -116,8 +120,10 @@ static bool CheckBlankPassword(WCHAR* username) {
last_changed += base::Time::kMicrosecondsPerSecond;
// Save the blank password status for later.
- local_state->SetBoolean(prefs::kOsPasswordBlank, blank_password);
- local_state->SetInt64(prefs::kOsPasswordLastChanged, last_changed);
+ local_state->SetBoolean(password_manager::prefs::kOsPasswordBlank,
+ blank_password);
+ local_state->SetInt64(password_manager::prefs::kOsPasswordLastChanged,
+ last_changed);
return blank_password;
}
diff --git a/chrome/browser/password_manager/password_store_factory.cc b/chrome/browser/password_manager/password_store_factory.cc
index 7266546..c0c527a 100644
--- a/chrome/browser/password_manager/password_store_factory.cc
+++ b/chrome/browser/password_manager/password_store_factory.cc
@@ -39,6 +39,8 @@
#include "chrome/browser/password_manager/password_store_x.h"
#endif
+using password_manager::PasswordStore;
+
#if !defined(OS_CHROMEOS) && defined(USE_X11)
namespace {
@@ -97,7 +99,8 @@ PasswordStoreFactory::~PasswordStoreFactory() {}
#if !defined(OS_CHROMEOS) && defined(USE_X11)
LocalProfileId PasswordStoreFactory::GetLocalProfileId(
PrefService* prefs) const {
- LocalProfileId id = prefs->GetInteger(prefs::kLocalProfileId);
+ LocalProfileId id =
+ prefs->GetInteger(password_manager::prefs::kLocalProfileId);
if (id == kInvalidLocalProfileId) {
// Note that there are many more users than this. Thus, by design, this is
// not a unique id. However, it is large enough that it is very unlikely
@@ -110,7 +113,7 @@ LocalProfileId PasswordStoreFactory::GetLocalProfileId(
id = rand() & kLocalProfileIdMask;
// TODO(mdm): scan other profiles to make sure they are not using this id?
} while (id == kInvalidLocalProfileId);
- prefs->SetInteger(prefs::kLocalProfileId, id);
+ prefs->SetInteger(password_manager::prefs::kLocalProfileId, id);
}
return id;
}
@@ -122,7 +125,8 @@ KeyedService* PasswordStoreFactory::BuildServiceInstanceFor(
base::FilePath login_db_file_path = profile->GetPath();
login_db_file_path = login_db_file_path.Append(chrome::kLoginDataFileName);
- scoped_ptr<LoginDatabase> login_db(new LoginDatabase());
+ scoped_ptr<password_manager::LoginDatabase> login_db(
+ new password_manager::LoginDatabase());
{
// TODO(paivanof@gmail.com): execution of login_db->Init() should go
// to DB thread. http://crbug.com/138903
@@ -155,7 +159,7 @@ KeyedService* PasswordStoreFactory::BuildServiceInstanceFor(
#elif defined(OS_CHROMEOS) || defined(OS_ANDROID)
// For now, we use PasswordStoreDefault. We might want to make a native
// backend for PasswordStoreX (see below) in the future though.
- ps = new PasswordStoreDefault(
+ ps = new password_manager::PasswordStoreDefault(
main_thread_runner, db_thread_runner, login_db.release());
#elif defined(USE_X11)
// On POSIX systems, we try to use the "native" password management system of
@@ -216,7 +220,7 @@ KeyedService* PasswordStoreFactory::BuildServiceInstanceFor(
login_db.release(),
backend.release());
#elif defined(USE_OZONE)
- ps = new PasswordStoreDefault(
+ ps = new password_manager::PasswordStoreDefault(
main_thread_runner, db_thread_runner, login_db.release());
#else
NOTIMPLEMENTED();
@@ -236,7 +240,7 @@ void PasswordStoreFactory::RegisterProfilePrefs(
// Notice that the preprocessor conditions above are exactly those that will
// result in using PasswordStoreX in BuildServiceInstanceFor().
registry->RegisterIntegerPref(
- prefs::kLocalProfileId,
+ password_manager::prefs::kLocalProfileId,
kInvalidLocalProfileId,
user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
#endif
diff --git a/chrome/browser/password_manager/password_store_factory.h b/chrome/browser/password_manager/password_store_factory.h
index ae26a0e..3a318a5 100644
--- a/chrome/browser/password_manager/password_store_factory.h
+++ b/chrome/browser/password_manager/password_store_factory.h
@@ -10,9 +10,12 @@
#include "chrome/browser/profiles/profile.h"
#include "components/keyed_service/content/browser_context_keyed_service_factory.h"
-class PasswordStore;
class Profile;
+namespace password_manager {
+class PasswordStore;
+}
+
#if !defined(OS_MACOSX) && !defined(OS_CHROMEOS) && defined(OS_POSIX)
// Local profile ids are used to associate resources stored outside the profile
// directory, like saved passwords in GNOME Keyring / KWallet, with a profile.
@@ -26,16 +29,17 @@ class PasswordStoreService : public KeyedService {
public:
// |password_store| needs to be not-NULL, and the constructor expects that
// Init() was already called successfully on it.
- explicit PasswordStoreService(scoped_refptr<PasswordStore> password_store);
+ explicit PasswordStoreService(
+ scoped_refptr<password_manager::PasswordStore> password_store);
virtual ~PasswordStoreService();
- scoped_refptr<PasswordStore> GetPasswordStore();
+ scoped_refptr<password_manager::PasswordStore> GetPasswordStore();
// KeyedService implementation.
virtual void Shutdown() OVERRIDE;
private:
- scoped_refptr<PasswordStore> password_store_;
+ scoped_refptr<password_manager::PasswordStore> password_store_;
DISALLOW_COPY_AND_ASSIGN(PasswordStoreService);
};
@@ -43,8 +47,9 @@ class PasswordStoreService : public KeyedService {
// Profiles.
class PasswordStoreFactory : public BrowserContextKeyedServiceFactory {
public:
- static scoped_refptr<PasswordStore> GetForProfile(
- Profile* profile, Profile::ServiceAccessType set);
+ static scoped_refptr<password_manager::PasswordStore> GetForProfile(
+ Profile* profile,
+ Profile::ServiceAccessType set);
static PasswordStoreFactory* GetInstance();
diff --git a/chrome/browser/password_manager/password_store_mac.cc b/chrome/browser/password_manager/password_store_mac.cc
index 80ba51d..99aeff0 100644
--- a/chrome/browser/password_manager/password_store_mac.cc
+++ b/chrome/browser/password_manager/password_store_mac.cc
@@ -27,6 +27,8 @@
using autofill::PasswordForm;
using crypto::AppleKeychain;
+using password_manager::PasswordStoreChange;
+using password_manager::PasswordStoreChangeList;
// Utility class to handle the details of constructing and running a keychain
// search from a set of attributes.
@@ -829,8 +831,8 @@ PasswordStoreMac::PasswordStoreMac(
scoped_refptr<base::SingleThreadTaskRunner> main_thread_runner,
scoped_refptr<base::SingleThreadTaskRunner> db_thread_runner,
AppleKeychain* keychain,
- LoginDatabase* login_db)
- : PasswordStore(main_thread_runner, db_thread_runner),
+ password_manager::LoginDatabase* login_db)
+ : password_manager::PasswordStore(main_thread_runner, db_thread_runner),
keychain_(keychain),
login_metadata_db_(login_db) {
DCHECK(keychain_.get());
@@ -848,12 +850,12 @@ bool PasswordStoreMac::Init(
thread_.reset(NULL);
return false;
}
- return PasswordStore::Init(flare);
+ return password_manager::PasswordStore::Init(flare);
}
void PasswordStoreMac::Shutdown() {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
- PasswordStore::Shutdown();
+ password_manager::PasswordStore::Shutdown();
thread_->Stop();
}
diff --git a/chrome/browser/password_manager/password_store_mac.h b/chrome/browser/password_manager/password_store_mac.h
index 52f74eb..87cc61b 100644
--- a/chrome/browser/password_manager/password_store_mac.h
+++ b/chrome/browser/password_manager/password_store_mac.h
@@ -17,12 +17,16 @@ namespace crypto {
class AppleKeychain;
}
+namespace password_manager {
+class LoginDatabase;
+}
+
// Implements PasswordStore on top of the OS X Keychain, with an internal
// database for extra metadata. For an overview of the interactions with the
// Keychain, as well as the rationale for some of the behaviors, see the
// Keychain integration design doc:
// http://dev.chromium.org/developers/design-documents/os-x-password-manager-keychain-integration
-class PasswordStoreMac : public PasswordStore {
+class PasswordStoreMac : public password_manager::PasswordStore {
public:
// Takes ownership of |keychain| and |login_db|, both of which must be
// non-NULL.
@@ -30,7 +34,7 @@ class PasswordStoreMac : public PasswordStore {
scoped_refptr<base::SingleThreadTaskRunner> main_thread_runner,
scoped_refptr<base::SingleThreadTaskRunner> db_thread_runner,
crypto::AppleKeychain* keychain,
- LoginDatabase* login_db);
+ password_manager::LoginDatabase* login_db);
// Initializes |thread_|.
virtual bool Init(
@@ -47,14 +51,15 @@ class PasswordStoreMac : public PasswordStore {
private:
virtual void ReportMetricsImpl() OVERRIDE;
- virtual PasswordStoreChangeList AddLoginImpl(
+ virtual password_manager::PasswordStoreChangeList AddLoginImpl(
const autofill::PasswordForm& form) OVERRIDE;
- virtual PasswordStoreChangeList UpdateLoginImpl(
+ virtual password_manager::PasswordStoreChangeList UpdateLoginImpl(
const autofill::PasswordForm& form) OVERRIDE;
- virtual PasswordStoreChangeList RemoveLoginImpl(
+ virtual password_manager::PasswordStoreChangeList RemoveLoginImpl(
const autofill::PasswordForm& form) OVERRIDE;
- virtual PasswordStoreChangeList RemoveLoginsCreatedBetweenImpl(
- const base::Time& delete_begin, const base::Time& delete_end) OVERRIDE;
+ virtual password_manager::PasswordStoreChangeList
+ RemoveLoginsCreatedBetweenImpl(const base::Time& delete_begin,
+ const base::Time& delete_end) OVERRIDE;
virtual void GetLoginsImpl(
const autofill::PasswordForm& form,
AuthorizationPromptPolicy prompt_policy,
@@ -90,7 +95,7 @@ class PasswordStoreMac : public PasswordStore {
const std::vector<autofill::PasswordForm*>& forms);
scoped_ptr<crypto::AppleKeychain> keychain_;
- scoped_ptr<LoginDatabase> login_metadata_db_;
+ scoped_ptr<password_manager::LoginDatabase> login_metadata_db_;
// Thread that the synchronous methods are run on.
scoped_ptr<base::Thread> thread_;
diff --git a/chrome/browser/password_manager/password_store_mac_unittest.cc b/chrome/browser/password_manager/password_store_mac_unittest.cc
index 64d0a3e..82e60db 100644
--- a/chrome/browser/password_manager/password_store_mac_unittest.cc
+++ b/chrome/browser/password_manager/password_store_mac_unittest.cc
@@ -25,6 +25,9 @@ using content::BrowserThread;
using crypto::MockAppleKeychain;
using internal_keychain_helpers::FormsMatchForMerge;
using internal_keychain_helpers::STRICT_FORM_MATCH;
+using password_manager::LoginDatabase;
+using password_manager::PasswordStore;
+using password_manager::PasswordStoreConsumer;
using testing::_;
using testing::DoAll;
using testing::Invoke;
diff --git a/chrome/browser/password_manager/password_store_win.cc b/chrome/browser/password_manager/password_store_win.cc
index c501b74..bf2e5b1 100644
--- a/chrome/browser/password_manager/password_store_win.cc
+++ b/chrome/browser/password_manager/password_store_win.cc
@@ -18,6 +18,7 @@
using autofill::PasswordForm;
using content::BrowserThread;
+using password_manager::PasswordStoreDefault;
// Handles requests to WebDataService.
class PasswordStoreWin::DBHandler : public WebDataServiceConsumer {
@@ -166,7 +167,7 @@ void PasswordStoreWin::DBHandler::OnWebDataServiceRequestDone(
PasswordStoreWin::PasswordStoreWin(
scoped_refptr<base::SingleThreadTaskRunner> main_thread_runner,
scoped_refptr<base::SingleThreadTaskRunner> db_thread_runner,
- LoginDatabase* login_database,
+ password_manager::LoginDatabase* login_database,
WebDataService* web_data_service)
: PasswordStoreDefault(main_thread_runner,
db_thread_runner,
diff --git a/chrome/browser/password_manager/password_store_win.h b/chrome/browser/password_manager/password_store_win.h
index e96973f..a8f665e 100644
--- a/chrome/browser/password_manager/password_store_win.h
+++ b/chrome/browser/password_manager/password_store_win.h
@@ -8,22 +8,25 @@
#include "base/memory/scoped_ptr.h"
#include "components/password_manager/core/browser/password_store_default.h"
-class LoginDatabase;
class WebDataService;
namespace autofill {
struct PasswordForm;
}
+namespace password_manager {
+class LoginDatabase;
+}
+
// Windows PasswordStore implementation that uses the default implementation,
// but also uses IE7 passwords if no others found.
-class PasswordStoreWin : public PasswordStoreDefault {
+class PasswordStoreWin : public password_manager::PasswordStoreDefault {
public:
// WebDataService is only used for IE7 password fetching.
PasswordStoreWin(
scoped_refptr<base::SingleThreadTaskRunner> main_thread_runner,
scoped_refptr<base::SingleThreadTaskRunner> db_thread_runner,
- LoginDatabase* login_database,
+ password_manager::LoginDatabase* login_database,
WebDataService* web_data_service);
// PasswordStore:
diff --git a/chrome/browser/password_manager/password_store_win_unittest.cc b/chrome/browser/password_manager/password_store_win_unittest.cc
index dc020d1..37ef50d 100644
--- a/chrome/browser/password_manager/password_store_win_unittest.cc
+++ b/chrome/browser/password_manager/password_store_win_unittest.cc
@@ -32,6 +32,11 @@
using autofill::PasswordForm;
using base::WaitableEvent;
using content::BrowserThread;
+using password_manager::LoginDatabase;
+using password_manager::ContainsAllPasswordForms;
+using password_manager::PasswordFormData;
+using password_manager::PasswordStore;
+using password_manager::PasswordStoreConsumer;
using testing::_;
using testing::DoAll;
using testing::WithArg;
diff --git a/chrome/browser/password_manager/password_store_x.cc b/chrome/browser/password_manager/password_store_x.cc
index ce44e1b..36e0bc8 100644
--- a/chrome/browser/password_manager/password_store_x.cc
+++ b/chrome/browser/password_manager/password_store_x.cc
@@ -21,12 +21,15 @@
using autofill::PasswordForm;
using content::BrowserThread;
+using password_manager::PasswordStoreChange;
+using password_manager::PasswordStoreChangeList;
+using password_manager::PasswordStoreDefault;
using std::vector;
PasswordStoreX::PasswordStoreX(
scoped_refptr<base::SingleThreadTaskRunner> main_thread_runner,
scoped_refptr<base::SingleThreadTaskRunner> db_thread_runner,
- LoginDatabase* login_db,
+ password_manager::LoginDatabase* login_db,
NativeBackend* backend)
: PasswordStoreDefault(main_thread_runner, db_thread_runner, login_db),
backend_(backend),
diff --git a/chrome/browser/password_manager/password_store_x.h b/chrome/browser/password_manager/password_store_x.h
index 739a9ac..0eb2bea 100644
--- a/chrome/browser/password_manager/password_store_x.h
+++ b/chrome/browser/password_manager/password_store_x.h
@@ -11,13 +11,16 @@
#include "base/time/time.h"
#include "components/password_manager/core/browser/password_store_default.h"
-class LoginDatabase;
class PrefService;
namespace user_prefs {
class PrefRegistrySyncable;
}
+namespace password_manager {
+class LoginDatabase;
+}
+
// PasswordStoreX is used on Linux and other non-Windows, non-Mac OS X
// operating systems. It uses a "native backend" to actually store the password
// data when such a backend is available, and otherwise falls back to using the
@@ -25,7 +28,7 @@ class PrefRegistrySyncable;
// migrating password data to a native backend from the login database.
//
// There are currently native backends for GNOME Keyring and KWallet.
-class PasswordStoreX : public PasswordStoreDefault {
+class PasswordStoreX : public password_manager::PasswordStoreDefault {
public:
// NativeBackends more or less implement the PaswordStore interface, but
// with return values rather than implicit consumer notification.
@@ -55,7 +58,7 @@ class PasswordStoreX : public PasswordStoreDefault {
// case this PasswordStoreX will act the same as PasswordStoreDefault.
PasswordStoreX(scoped_refptr<base::SingleThreadTaskRunner> main_thread_runner,
scoped_refptr<base::SingleThreadTaskRunner> db_thread_runner,
- LoginDatabase* login_db,
+ password_manager::LoginDatabase* login_db,
NativeBackend* backend);
private:
@@ -64,14 +67,15 @@ class PasswordStoreX : public PasswordStoreDefault {
virtual ~PasswordStoreX();
// Implements PasswordStore interface.
- virtual PasswordStoreChangeList AddLoginImpl(
+ virtual password_manager::PasswordStoreChangeList AddLoginImpl(
const autofill::PasswordForm& form) OVERRIDE;
- virtual PasswordStoreChangeList UpdateLoginImpl(
+ virtual password_manager::PasswordStoreChangeList UpdateLoginImpl(
const autofill::PasswordForm& form) OVERRIDE;
- virtual PasswordStoreChangeList RemoveLoginImpl(
+ virtual password_manager::PasswordStoreChangeList RemoveLoginImpl(
const autofill::PasswordForm& form) OVERRIDE;
- virtual PasswordStoreChangeList RemoveLoginsCreatedBetweenImpl(
- const base::Time& delete_begin, const base::Time& delete_end) OVERRIDE;
+ virtual password_manager::PasswordStoreChangeList
+ RemoveLoginsCreatedBetweenImpl(const base::Time& delete_begin,
+ const base::Time& delete_end) OVERRIDE;
virtual void GetLoginsImpl(
const autofill::PasswordForm& form,
AuthorizationPromptPolicy prompt_policy,
diff --git a/chrome/browser/password_manager/password_store_x_unittest.cc b/chrome/browser/password_manager/password_store_x_unittest.cc
index 1183da9..dbd8065 100644
--- a/chrome/browser/password_manager/password_store_x_unittest.cc
+++ b/chrome/browser/password_manager/password_store_x_unittest.cc
@@ -28,6 +28,8 @@
using autofill::PasswordForm;
using content::BrowserThread;
+using password_manager::ContainsAllPasswordForms;
+using password_manager::PasswordStoreChange;
using testing::_;
using testing::DoAll;
using testing::ElementsAreArray;
@@ -39,16 +41,18 @@ typedef std::vector<PasswordForm*> VectorOfForms;
namespace {
-class MockPasswordStoreConsumer : public PasswordStoreConsumer {
+class MockPasswordStoreConsumer
+ : public password_manager::PasswordStoreConsumer {
public:
MOCK_METHOD1(OnGetPasswordStoreResults,
void(const std::vector<PasswordForm*>&));
};
-class MockPasswordStoreObserver : public PasswordStore::Observer {
+class MockPasswordStoreObserver
+ : public password_manager::PasswordStore::Observer {
public:
MOCK_METHOD1(OnLoginsChanged,
- void(const PasswordStoreChangeList& changes));
+ void(const password_manager::PasswordStoreChangeList& changes));
};
class FailingBackend : public PasswordStoreX::NativeBackend {
@@ -177,7 +181,7 @@ class MockLoginDatabaseReturn {
void(const std::vector<PasswordForm*>&));
};
-void LoginDatabaseQueryCallback(LoginDatabase* login_db,
+void LoginDatabaseQueryCallback(password_manager::LoginDatabase* login_db,
bool autofillable,
MockLoginDatabaseReturn* mock_return) {
std::vector<PasswordForm*> forms;
@@ -197,17 +201,19 @@ void InitExpectedForms(bool autofillable, size_t count, VectorOfForms* forms) {
i, domain);
std::string action = base::StringPrintf("http://%zu.%s.com/action",
i, domain);
- PasswordFormData data = {
- PasswordForm::SCHEME_HTML,
- realm.c_str(),
- origin.c_str(),
- action.c_str(),
- L"submit_element",
- L"username_element",
- L"password_element",
- autofillable ? L"username_value" : NULL,
- autofillable ? L"password_value" : NULL,
- autofillable, false, static_cast<double>(i + 1) };
+ password_manager::PasswordFormData data = {
+ PasswordForm::SCHEME_HTML,
+ realm.c_str(),
+ origin.c_str(),
+ action.c_str(),
+ L"submit_element",
+ L"username_element",
+ L"password_element",
+ autofillable ? L"username_value" : NULL,
+ autofillable ? L"password_value" : NULL,
+ autofillable,
+ false,
+ static_cast<double>(i + 1)};
forms->push_back(CreatePasswordFormFromData(data));
}
}
@@ -225,7 +231,7 @@ class PasswordStoreXTest : public testing::TestWithParam<BackendType> {
virtual void SetUp() {
ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
- login_db_.reset(new LoginDatabase());
+ login_db_.reset(new password_manager::LoginDatabase());
ASSERT_TRUE(login_db_->Init(temp_dir_.path().Append("login_test")));
}
@@ -246,7 +252,7 @@ class PasswordStoreXTest : public testing::TestWithParam<BackendType> {
content::TestBrowserThreadBundle thread_bundle_;
- scoped_ptr<LoginDatabase> login_db_;
+ scoped_ptr<password_manager::LoginDatabase> login_db_;
base::ScopedTempDir temp_dir_;
};
@@ -262,17 +268,13 @@ TEST_P(PasswordStoreXTest, Notifications) {
GetBackend()));
store->Init(syncer::SyncableService::StartSyncFlare());
- PasswordFormData form_data =
- { PasswordForm::SCHEME_HTML,
- "http://bar.example.com",
- "http://bar.example.com/origin",
- "http://bar.example.com/action",
- L"submit_element",
- L"username_element",
- L"password_element",
- L"username_value",
- L"password_value",
- true, false, 1 };
+ password_manager::PasswordFormData form_data = {
+ PasswordForm::SCHEME_HTML, "http://bar.example.com",
+ "http://bar.example.com/origin", "http://bar.example.com/action",
+ L"submit_element", L"username_element",
+ L"password_element", L"username_value",
+ L"password_value", true,
+ false, 1};
scoped_ptr<PasswordForm> form(CreatePasswordFormFromData(form_data));
MockPasswordStoreObserver observer;
@@ -342,7 +344,7 @@ TEST_P(PasswordStoreXTest, NativeMigration) {
base::File::Info db_file_start_info;
ASSERT_TRUE(base::GetFileInfo(login_db_file, &db_file_start_info));
- LoginDatabase* login_db = login_db_.get();
+ password_manager::LoginDatabase* login_db = login_db_.get();
// Populate the login DB with logins that should be migrated.
for (VectorOfForms::iterator it = expected_autofillable.begin();
diff --git a/chrome/browser/password_manager/save_password_infobar_delegate.cc b/chrome/browser/password_manager/save_password_infobar_delegate.cc
index fe039d8..5b7ef25 100644
--- a/chrome/browser/password_manager/save_password_infobar_delegate.cc
+++ b/chrome/browser/password_manager/save_password_infobar_delegate.cc
@@ -22,7 +22,7 @@
// static
void SavePasswordInfoBarDelegate::Create(
content::WebContents* web_contents,
- PasswordFormManager* form_to_save,
+ password_manager::PasswordFormManager* form_to_save,
const std::string& uma_histogram_suffix) {
#if defined(ENABLE_ONE_CLICK_SIGNIN)
// Don't show the password manager infobar if this form is for a google
@@ -53,9 +53,9 @@ void SavePasswordInfoBarDelegate::Create(
SavePasswordInfoBarDelegate::~SavePasswordInfoBarDelegate() {
UMA_HISTOGRAM_ENUMERATION("PasswordManager.InfoBarResponse",
infobar_response_,
- password_manager_metrics_util::NUM_RESPONSE_TYPES);
+ password_manager::metrics_util::NUM_RESPONSE_TYPES);
- password_manager_metrics_util::LogUIDismissalReason(infobar_response_);
+ password_manager::metrics_util::LogUIDismissalReason(infobar_response_);
// The shortest period for which the prompt needs to live, so that we don't
// consider it killed prematurely, as might happen, e.g., if a pre-rendered
@@ -64,11 +64,11 @@ SavePasswordInfoBarDelegate::~SavePasswordInfoBarDelegate() {
base::TimeDelta::FromSeconds(1);
if (!uma_histogram_suffix_.empty()) {
- password_manager_metrics_util::LogUMAHistogramEnumeration(
+ password_manager::metrics_util::LogUMAHistogramEnumeration(
"PasswordManager.SavePasswordPromptResponse_" + uma_histogram_suffix_,
infobar_response_,
- password_manager_metrics_util::NUM_RESPONSE_TYPES);
- password_manager_metrics_util::LogUMAHistogramBoolean(
+ password_manager::metrics_util::NUM_RESPONSE_TYPES);
+ password_manager::metrics_util::LogUMAHistogramBoolean(
"PasswordManager.SavePasswordPromptDisappearedQuickly_" +
uma_histogram_suffix_,
timer_.Elapsed() < kMinimumPromptDisplayTime);
@@ -82,14 +82,14 @@ void SavePasswordInfoBarDelegate::SetUseAdditionalPasswordAuthentication(
}
SavePasswordInfoBarDelegate::SavePasswordInfoBarDelegate(
- PasswordFormManager* form_to_save,
+ password_manager::PasswordFormManager* form_to_save,
const std::string& uma_histogram_suffix)
: ConfirmInfoBarDelegate(),
form_to_save_(form_to_save),
- infobar_response_(password_manager_metrics_util::NO_RESPONSE),
+ infobar_response_(password_manager::metrics_util::NO_RESPONSE),
uma_histogram_suffix_(uma_histogram_suffix) {
if (!uma_histogram_suffix_.empty()) {
- password_manager_metrics_util::LogUMAHistogramBoolean(
+ password_manager::metrics_util::LogUMAHistogramBoolean(
"PasswordManager.SavePasswordPromptDisplayed_" + uma_histogram_suffix_,
true);
}
@@ -136,20 +136,20 @@ base::string16 SavePasswordInfoBarDelegate::GetButtonLabel(
bool SavePasswordInfoBarDelegate::Accept() {
DCHECK(form_to_save_.get());
form_to_save_->Save();
- infobar_response_ = password_manager_metrics_util::REMEMBER_PASSWORD;
+ infobar_response_ = password_manager::metrics_util::REMEMBER_PASSWORD;
return true;
}
bool SavePasswordInfoBarDelegate::Cancel() {
DCHECK(form_to_save_.get());
form_to_save_->PermanentlyBlacklist();
- infobar_response_ = password_manager_metrics_util::NEVER_REMEMBER_PASSWORD;
+ infobar_response_ = password_manager::metrics_util::NEVER_REMEMBER_PASSWORD;
return true;
}
void SavePasswordInfoBarDelegate::InfoBarDismissed() {
DCHECK(form_to_save_.get());
- infobar_response_ = password_manager_metrics_util::INFOBAR_DISMISSED;
+ infobar_response_ = password_manager::metrics_util::INFOBAR_DISMISSED;
}
InfoBarDelegate::InfoBarAutomationType
diff --git a/chrome/browser/password_manager/save_password_infobar_delegate.h b/chrome/browser/password_manager/save_password_infobar_delegate.h
index 653e3c3..775efaf 100644
--- a/chrome/browser/password_manager/save_password_infobar_delegate.h
+++ b/chrome/browser/password_manager/save_password_infobar_delegate.h
@@ -33,7 +33,7 @@ class SavePasswordInfoBarDelegate : public ConfirmInfoBarDelegate {
// if empty, the usage is not reported, otherwise the suffix is used to choose
// the right histogram.
static void Create(content::WebContents* web_contents,
- PasswordFormManager* form_to_save,
+ password_manager::PasswordFormManager* form_to_save,
const std::string& uma_histogram_suffix);
virtual ~SavePasswordInfoBarDelegate();
@@ -44,8 +44,9 @@ class SavePasswordInfoBarDelegate : public ConfirmInfoBarDelegate {
bool use_additional_authentication);
private:
- SavePasswordInfoBarDelegate(PasswordFormManager* form_to_save,
- const std::string& uma_histogram_suffix);
+ SavePasswordInfoBarDelegate(
+ password_manager::PasswordFormManager* form_to_save,
+ const std::string& uma_histogram_suffix);
// Returns a save password infobar that owns |delegate|.
static scoped_ptr<InfoBar> CreateInfoBar(
@@ -67,10 +68,10 @@ class SavePasswordInfoBarDelegate : public ConfirmInfoBarDelegate {
// The PasswordFormManager managing the form we're asking the user about,
// and should update as per her decision.
- scoped_ptr<PasswordFormManager> form_to_save_;
+ scoped_ptr<password_manager::PasswordFormManager> form_to_save_;
// Used to track the results we get from the info bar.
- password_manager_metrics_util::ResponseType infobar_response_;
+ password_manager::metrics_util::ResponseType infobar_response_;
// Measures the "Save password?" prompt lifetime. Used to report an UMA
// signal.
diff --git a/chrome/browser/password_manager/test_password_store_service.cc b/chrome/browser/password_manager/test_password_store_service.cc
index 29829cf..a32731a 100644
--- a/chrome/browser/password_manager/test_password_store_service.cc
+++ b/chrome/browser/password_manager/test_password_store_service.cc
@@ -9,14 +9,15 @@
// static
KeyedService* TestPasswordStoreService::Build(
content::BrowserContext* /*profile*/) {
- scoped_refptr<PasswordStore> store(new TestPasswordStore);
+ scoped_refptr<password_manager::PasswordStore> store(
+ new password_manager::TestPasswordStore);
if (!store || !store->Init(syncer::SyncableService::StartSyncFlare()))
return NULL;
return new TestPasswordStoreService(store);
}
TestPasswordStoreService::TestPasswordStoreService(
- scoped_refptr<PasswordStore> password_store)
+ scoped_refptr<password_manager::PasswordStore> password_store)
: PasswordStoreService(password_store) {}
TestPasswordStoreService::~TestPasswordStoreService() {}
diff --git a/chrome/browser/password_manager/test_password_store_service.h b/chrome/browser/password_manager/test_password_store_service.h
index fae7f3a..b628faf 100644
--- a/chrome/browser/password_manager/test_password_store_service.h
+++ b/chrome/browser/password_manager/test_password_store_service.h
@@ -7,19 +7,21 @@
#include "chrome/browser/password_manager/password_store_factory.h"
-class PasswordStore;
-
namespace content {
class BrowserContext;
}
+namespace password_manager {
+class PasswordStore;
+}
+
class TestPasswordStoreService : public PasswordStoreService {
public:
static KeyedService* Build(content::BrowserContext* profile);
private:
explicit TestPasswordStoreService(
- scoped_refptr<PasswordStore> password_store);
+ scoped_refptr<password_manager::PasswordStore> password_store);
virtual ~TestPasswordStoreService();
diff --git a/chrome/browser/policy/configuration_policy_handler_list_factory.cc b/chrome/browser/policy/configuration_policy_handler_list_factory.cc
index abb98ea..71ac801 100644
--- a/chrome/browser/policy/configuration_policy_handler_list_factory.cc
+++ b/chrome/browser/policy/configuration_policy_handler_list_factory.cc
@@ -99,10 +99,10 @@ const PolicyToPreferenceMapEntry kSimplePolicyMap[] = {
prefs::kForceSafeSearch,
base::Value::TYPE_BOOLEAN },
{ key::kPasswordManagerEnabled,
- prefs::kPasswordManagerEnabled,
+ password_manager::prefs::kPasswordManagerEnabled,
base::Value::TYPE_BOOLEAN },
{ key::kPasswordManagerAllowShowPasswords,
- prefs::kPasswordManagerAllowShowPasswords,
+ password_manager::prefs::kPasswordManagerAllowShowPasswords,
base::Value::TYPE_BOOLEAN },
{ key::kPrintingEnabled,
prefs::kPrintingEnabled,
diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc
index fa6d8ad..58153ca 100644
--- a/chrome/browser/prefs/browser_prefs.cc
+++ b/chrome/browser/prefs/browser_prefs.cc
@@ -325,7 +325,7 @@ void RegisterLocalState(PrefRegistrySimple* registry) {
#if defined(OS_WIN)
app_metro_launch::RegisterPrefs(registry);
- PasswordManager::RegisterLocalPrefs(registry);
+ password_manager::PasswordManager::RegisterLocalPrefs(registry);
#endif
#if defined(TOOLKIT_VIEWS)
@@ -364,7 +364,7 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
NetPrefObserver::RegisterProfilePrefs(registry);
NetworkTimeService::RegisterProfilePrefs(registry);
NewTabUI::RegisterProfilePrefs(registry);
- PasswordManager::RegisterProfilePrefs(registry);
+ password_manager::PasswordManager::RegisterProfilePrefs(registry);
PrefProxyConfigTrackerImpl::RegisterProfilePrefs(registry);
PrefsTabHelper::RegisterProfilePrefs(registry);
Profile::RegisterProfilePrefs(registry);
diff --git a/chrome/browser/prerender/prerender_tab_helper.cc b/chrome/browser/prerender/prerender_tab_helper.cc
index 7e15157..3fe0dcd 100644
--- a/chrome/browser/prerender/prerender_tab_helper.cc
+++ b/chrome/browser/prerender/prerender_tab_helper.cc
@@ -45,7 +45,7 @@ void ReportTabHelperURLSeenToLocalPredictor(
// static
void PrerenderTabHelper::CreateForWebContentsWithPasswordManager(
content::WebContents* web_contents,
- PasswordManager* password_manager) {
+ password_manager::PasswordManager* password_manager) {
if (!FromWebContents(web_contents)) {
web_contents->SetUserData(UserDataKey(),
new PrerenderTabHelper(web_contents,
@@ -53,8 +53,9 @@ void PrerenderTabHelper::CreateForWebContentsWithPasswordManager(
}
}
-PrerenderTabHelper::PrerenderTabHelper(content::WebContents* web_contents,
- PasswordManager* password_manager)
+PrerenderTabHelper::PrerenderTabHelper(
+ content::WebContents* web_contents,
+ password_manager::PasswordManager* password_manager)
: content::WebContentsObserver(web_contents),
origin_(ORIGIN_NONE),
next_load_is_control_prerender_(false),
diff --git a/chrome/browser/prerender/prerender_tab_helper.h b/chrome/browser/prerender/prerender_tab_helper.h
index 4f30af8..4fb6013 100644
--- a/chrome/browser/prerender/prerender_tab_helper.h
+++ b/chrome/browser/prerender/prerender_tab_helper.h
@@ -14,12 +14,14 @@
#include "content/public/browser/web_contents_user_data.h"
#include "url/gurl.h"
-class PasswordManager;
-
namespace autofill {
struct PasswordForm;
}
+namespace password_manager {
+class PasswordManager;
+}
+
namespace prerender {
class PrerenderManager;
@@ -44,7 +46,7 @@ class PrerenderTabHelper
static void CreateForWebContentsWithPasswordManager(
content::WebContents* web_contents,
- PasswordManager* password_manager);
+ password_manager::PasswordManager* password_manager);
virtual ~PrerenderTabHelper();
@@ -81,7 +83,7 @@ class PrerenderTabHelper
private:
PrerenderTabHelper(content::WebContents* web_contents,
- PasswordManager* password_manager);
+ password_manager::PasswordManager* password_manager);
friend class content::WebContentsUserData<PrerenderTabHelper>;
void RecordEvent(Event event) const;
diff --git a/chrome/browser/profiles/profile.h b/chrome/browser/profiles/profile.h
index 34937b2..364fcf5 100644
--- a/chrome/browser/profiles/profile.h
+++ b/chrome/browser/profiles/profile.h
@@ -21,7 +21,6 @@ class ExtensionService;
class ExtensionSpecialStoragePolicy;
class FaviconService;
class HostContentSettingsMap;
-class PasswordStore;
class PrefProxyConfigTracker;
class PrefService;
class PromoCounter;
diff --git a/chrome/browser/sync/glue/password_data_type_controller.h b/chrome/browser/sync/glue/password_data_type_controller.h
index d92b104..4762ba0 100644
--- a/chrome/browser/sync/glue/password_data_type_controller.h
+++ b/chrome/browser/sync/glue/password_data_type_controller.h
@@ -10,9 +10,12 @@
#include "base/memory/ref_counted.h"
#include "chrome/browser/sync/glue/non_ui_data_type_controller.h"
-class PasswordStore;
class ProfileSyncServicePasswordTest;
+namespace password_manager {
+class PasswordStore;
+}
+
namespace browser_sync {
// A class that manages the startup and shutdown of password sync.
@@ -37,7 +40,7 @@ class PasswordDataTypeController : public NonUIDataTypeController {
virtual bool StartModels() OVERRIDE;
private:
- scoped_refptr<PasswordStore> password_store_;
+ scoped_refptr<password_manager::PasswordStore> password_store_;
DISALLOW_COPY_AND_ASSIGN(PasswordDataTypeController);
};
diff --git a/chrome/browser/sync/glue/password_model_worker.cc b/chrome/browser/sync/glue/password_model_worker.cc
index de87567..6ad5cfd 100644
--- a/chrome/browser/sync/glue/password_model_worker.cc
+++ b/chrome/browser/sync/glue/password_model_worker.cc
@@ -14,10 +14,9 @@ using base::WaitableEvent;
namespace browser_sync {
PasswordModelWorker::PasswordModelWorker(
- const scoped_refptr<PasswordStore>& password_store,
+ const scoped_refptr<password_manager::PasswordStore>& password_store,
syncer::WorkerLoopDestructionObserver* observer)
- : syncer::ModelSafeWorker(observer),
- password_store_(password_store) {
+ : syncer::ModelSafeWorker(observer), password_store_(password_store) {
DCHECK(password_store.get());
}
diff --git a/chrome/browser/sync/glue/password_model_worker.h b/chrome/browser/sync/glue/password_model_worker.h
index ecb7c61..be4e17b 100644
--- a/chrome/browser/sync/glue/password_model_worker.h
+++ b/chrome/browser/sync/glue/password_model_worker.h
@@ -12,12 +12,14 @@
#include "base/compiler_specific.h"
#include "base/memory/ref_counted.h"
-class PasswordStore;
-
namespace base {
class WaitableEvent;
}
+namespace password_manager {
+class PasswordStore;
+}
+
namespace browser_sync {
// A syncer::ModelSafeWorker for password models that accepts requests
@@ -25,8 +27,9 @@ namespace browser_sync {
// which is the DB thread on Linux and Windows.
class PasswordModelWorker : public syncer::ModelSafeWorker {
public:
- PasswordModelWorker(const scoped_refptr<PasswordStore>& password_store,
- syncer::WorkerLoopDestructionObserver* observer);
+ PasswordModelWorker(
+ const scoped_refptr<password_manager::PasswordStore>& password_store,
+ syncer::WorkerLoopDestructionObserver* observer);
// syncer::ModelSafeWorker implementation. Called on syncapi SyncerThread.
virtual void RegisterForLoopDestruction() OVERRIDE;
@@ -52,7 +55,7 @@ class PasswordModelWorker : public syncer::ModelSafeWorker {
// |password_store_| is used on password thread but released on UI thread.
// Protected by |password_store_lock_|.
base::Lock password_store_lock_;
- scoped_refptr<PasswordStore> password_store_;
+ scoped_refptr<password_manager::PasswordStore> password_store_;
DISALLOW_COPY_AND_ASSIGN(PasswordModelWorker);
};
diff --git a/chrome/browser/sync/glue/sync_backend_registrar.cc b/chrome/browser/sync/glue/sync_backend_registrar.cc
index aa76d3b..20a919e 100644
--- a/chrome/browser/sync/glue/sync_backend_registrar.cc
+++ b/chrome/browser/sync/glue/sync_backend_registrar.cc
@@ -94,7 +94,7 @@ SyncBackendRegistrar::SyncBackendRegistrar(
}
- scoped_refptr<PasswordStore> password_store =
+ scoped_refptr<password_manager::PasswordStore> password_store =
PasswordStoreFactory::GetForProfile(profile, Profile::IMPLICIT_ACCESS);
if (password_store.get()) {
workers_[syncer::GROUP_PASSWORD] =
diff --git a/chrome/browser/sync/profile_sync_components_factory_impl.cc b/chrome/browser/sync/profile_sync_components_factory_impl.cc
index 09716d6..1c0389f 100644
--- a/chrome/browser/sync/profile_sync_components_factory_impl.cc
+++ b/chrome/browser/sync/profile_sync_components_factory_impl.cc
@@ -573,8 +573,9 @@ base::WeakPtr<syncer::SyncableService> ProfileSyncComponentsFactoryImpl::
}
case syncer::PASSWORDS: {
#if defined(PASSWORD_MANAGER_ENABLE_SYNC)
- PasswordStore* password_store = PasswordStoreFactory::GetForProfile(
- profile_, Profile::EXPLICIT_ACCESS);
+ password_manager::PasswordStore* password_store =
+ PasswordStoreFactory::GetForProfile(profile_,
+ Profile::EXPLICIT_ACCESS);
return password_store ? password_store->GetPasswordSyncableService()
: base::WeakPtr<syncer::SyncableService>();
#else
diff --git a/chrome/browser/sync/test/integration/passwords_helper.cc b/chrome/browser/sync/test/integration/passwords_helper.cc
index 8ac4b8b..82bd1a7 100644
--- a/chrome/browser/sync/test/integration/passwords_helper.cc
+++ b/chrome/browser/sync/test/integration/passwords_helper.cc
@@ -20,6 +20,7 @@
#include "components/password_manager/core/browser/password_store_consumer.h"
using autofill::PasswordForm;
+using password_manager::PasswordStore;
using sync_datatype_helper::test;
const std::string kFakeSignonRealm = "http://fake-signon-realm.google.com/";
@@ -35,11 +36,11 @@ void PasswordStoreCallback(base::WaitableEvent* wait_event) {
wait_event->Signal();
}
-class PasswordStoreConsumerHelper : public PasswordStoreConsumer {
+class PasswordStoreConsumerHelper
+ : public password_manager::PasswordStoreConsumer {
public:
explicit PasswordStoreConsumerHelper(std::vector<PasswordForm>* result)
- : PasswordStoreConsumer(),
- result_(result) {}
+ : password_manager::PasswordStoreConsumer(), result_(result) {}
virtual void OnGetPasswordStoreResults(
const std::vector<PasswordForm*>& result) OVERRIDE {
@@ -134,7 +135,8 @@ bool ProfileContainsSamePasswordFormsAsVerifier(int index) {
std::vector<PasswordForm> forms;
GetLogins(GetVerifierPasswordStore(), verifier_forms);
GetLogins(GetPasswordStore(index), forms);
- bool result = ContainsSamePasswordForms(verifier_forms, forms);
+ bool result =
+ password_manager::ContainsSamePasswordForms(verifier_forms, forms);
if (!result) {
LOG(ERROR) << "Password forms in Verifier Profile:";
for (std::vector<PasswordForm>::iterator it = verifier_forms.begin();
@@ -155,7 +157,7 @@ bool ProfilesContainSamePasswordForms(int index_a, int index_b) {
std::vector<PasswordForm> forms_b;
GetLogins(GetPasswordStore(index_a), forms_a);
GetLogins(GetPasswordStore(index_b), forms_b);
- bool result = ContainsSamePasswordForms(forms_a, forms_b);
+ bool result = password_manager::ContainsSamePasswordForms(forms_a, forms_b);
if (!result) {
LOG(ERROR) << "Password forms in Profile" << index_a << ":";
for (std::vector<PasswordForm>::iterator it = forms_a.begin();
diff --git a/chrome/browser/sync/test/integration/passwords_helper.h b/chrome/browser/sync/test/integration/passwords_helper.h
index 7857c67..85877bc 100644
--- a/chrome/browser/sync/test/integration/passwords_helper.h
+++ b/chrome/browser/sync/test/integration/passwords_helper.h
@@ -12,31 +12,36 @@
#include "chrome/browser/sync/test/integration/sync_test.h"
#include "components/autofill/core/common/password_form.h"
+namespace password_manager {
class PasswordStore;
+}
namespace passwords_helper {
// Adds the login held in |form| to the password store |store|. Even though
// logins are normally added asynchronously, this method will block until the
// login is added.
-void AddLogin(PasswordStore* store, const autofill::PasswordForm& form);
+void AddLogin(password_manager::PasswordStore* store,
+ const autofill::PasswordForm& form);
// Update the data held in password store |store| with a modified |form|.
// This method blocks until the operation is complete.
-void UpdateLogin(PasswordStore* store, const autofill::PasswordForm& form);
+void UpdateLogin(password_manager::PasswordStore* store,
+ const autofill::PasswordForm& form);
// Searches |store| for all logins matching a fake signon realm used only by
// LivePasswordsSyncTest and adds the results to |matches|. Note that the
// caller is responsible for deleting the forms added to |matches|.
-void GetLogins(PasswordStore* store,
+void GetLogins(password_manager::PasswordStore* store,
std::vector<autofill::PasswordForm>& matches);
// Removes the login held in |form| from the password store |store|. This
// method blocks until the operation is complete.
-void RemoveLogin(PasswordStore* store, const autofill::PasswordForm& form);
+void RemoveLogin(password_manager::PasswordStore* store,
+ const autofill::PasswordForm& form);
// Removes all password forms from the password store |store|.
-void RemoveLogins(PasswordStore* store);
+void RemoveLogins(password_manager::PasswordStore* store);
// Sets the cryptographer's encryption passphrase for the profile at index
// |index| to |passphrase|, and passphrase type |type|.
@@ -50,10 +55,10 @@ void SetEncryptionPassphrase(int index,
bool SetDecryptionPassphrase(int index, const std::string& passphrase);
// Gets the password store of the profile with index |index|.
-PasswordStore* GetPasswordStore(int index);
+password_manager::PasswordStore* GetPasswordStore(int index);
// Gets the password store of the verifier profile.
-PasswordStore* GetVerifierPasswordStore();
+password_manager::PasswordStore* GetVerifierPasswordStore();
// Returns true iff the profile with index |index| contains the same password
// forms as the verifier profile.
diff --git a/chrome/browser/sync/test/integration/two_client_preferences_sync_test.cc b/chrome/browser/sync/test/integration/two_client_preferences_sync_test.cc
index 3fa837c..a16191c8 100644
--- a/chrome/browser/sync/test/integration/two_client_preferences_sync_test.cc
+++ b/chrome/browser/sync/test/integration/two_client_preferences_sync_test.cc
@@ -74,11 +74,13 @@ IN_PROC_BROWSER_TEST_F(TwoClientPreferencesSyncTest, Race) {
IN_PROC_BROWSER_TEST_F(TwoClientPreferencesSyncTest,
kPasswordManagerEnabled) {
ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
- ASSERT_TRUE(BooleanPrefMatches(prefs::kPasswordManagerEnabled));
+ ASSERT_TRUE(
+ BooleanPrefMatches(password_manager::prefs::kPasswordManagerEnabled));
- ChangeBooleanPref(0, prefs::kPasswordManagerEnabled);
+ ChangeBooleanPref(0, password_manager::prefs::kPasswordManagerEnabled);
ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1)));
- ASSERT_TRUE(BooleanPrefMatches(prefs::kPasswordManagerEnabled));
+ ASSERT_TRUE(
+ BooleanPrefMatches(password_manager::prefs::kPasswordManagerEnabled));
}
// TCM ID - 3699293.
@@ -102,16 +104,19 @@ IN_PROC_BROWSER_TEST_F(LegacyTwoClientPreferencesSyncTest, DisablePreferences) {
DisableVerifier();
ASSERT_TRUE(BooleanPrefMatches(sync_driver::prefs::kSyncPreferences));
- ASSERT_TRUE(BooleanPrefMatches(prefs::kPasswordManagerEnabled));
+ ASSERT_TRUE(
+ BooleanPrefMatches(password_manager::prefs::kPasswordManagerEnabled));
GetClient(1)->DisableSyncForDatatype(syncer::PREFERENCES);
- ChangeBooleanPref(0, prefs::kPasswordManagerEnabled);
+ ChangeBooleanPref(0, password_manager::prefs::kPasswordManagerEnabled);
ASSERT_TRUE(AwaitCommitActivityCompletion(GetSyncService((0))));
- ASSERT_FALSE(BooleanPrefMatches(prefs::kPasswordManagerEnabled));
+ ASSERT_FALSE(
+ BooleanPrefMatches(password_manager::prefs::kPasswordManagerEnabled));
GetClient(1)->EnableSyncForDatatype(syncer::PREFERENCES);
ASSERT_TRUE(AwaitQuiescence());
- ASSERT_TRUE(BooleanPrefMatches(prefs::kPasswordManagerEnabled));
+ ASSERT_TRUE(
+ BooleanPrefMatches(password_manager::prefs::kPasswordManagerEnabled));
}
// TCM ID - 3664292.
@@ -120,20 +125,23 @@ IN_PROC_BROWSER_TEST_F(TwoClientPreferencesSyncTest, DisableSync) {
DisableVerifier();
ASSERT_TRUE(BooleanPrefMatches(sync_driver::prefs::kSyncPreferences));
- ASSERT_TRUE(BooleanPrefMatches(prefs::kPasswordManagerEnabled));
+ ASSERT_TRUE(
+ BooleanPrefMatches(password_manager::prefs::kPasswordManagerEnabled));
ASSERT_TRUE(BooleanPrefMatches(prefs::kShowHomeButton));
GetClient(1)->DisableSyncForAllDatatypes();
- ChangeBooleanPref(0, prefs::kPasswordManagerEnabled);
+ ChangeBooleanPref(0, password_manager::prefs::kPasswordManagerEnabled);
ASSERT_TRUE(AwaitCommitActivityCompletion(GetSyncService((0))));
- ASSERT_FALSE(BooleanPrefMatches(prefs::kPasswordManagerEnabled));
+ ASSERT_FALSE(
+ BooleanPrefMatches(password_manager::prefs::kPasswordManagerEnabled));
ChangeBooleanPref(1, prefs::kShowHomeButton);
ASSERT_FALSE(BooleanPrefMatches(prefs::kShowHomeButton));
GetClient(1)->EnableSyncForAllDatatypes();
ASSERT_TRUE(AwaitQuiescence());
- ASSERT_TRUE(BooleanPrefMatches(prefs::kPasswordManagerEnabled));
+ ASSERT_TRUE(
+ BooleanPrefMatches(password_manager::prefs::kPasswordManagerEnabled));
ASSERT_TRUE(BooleanPrefMatches(prefs::kShowHomeButton));
}
diff --git a/chrome/browser/ui/android/login_prompt_android.cc b/chrome/browser/ui/android/login_prompt_android.cc
index f832a40..169ba90 100644
--- a/chrome/browser/ui/android/login_prompt_android.cc
+++ b/chrome/browser/ui/android/login_prompt_android.cc
@@ -38,7 +38,7 @@ class LoginHandlerAndroid : public LoginHandler {
virtual void OnLoginModelDestroying() OVERRIDE {}
virtual void BuildViewForPasswordManager(
- PasswordManager* manager,
+ password_manager::PasswordManager* manager,
const base::string16& explanation) OVERRIDE {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
diff --git a/chrome/browser/ui/autofill/password_generation_popup_controller_impl.cc b/chrome/browser/ui/autofill/password_generation_popup_controller_impl.cc
index 64c40b1..2289e5f 100644
--- a/chrome/browser/ui/autofill/password_generation_popup_controller_impl.cc
+++ b/chrome/browser/ui/autofill/password_generation_popup_controller_impl.cc
@@ -37,7 +37,7 @@ PasswordGenerationPopupControllerImpl::GetOrCreate(
const gfx::RectF& bounds,
const PasswordForm& form,
int max_length,
- PasswordManager* password_manager,
+ password_manager::PasswordManager* password_manager,
PasswordGenerationPopupObserver* observer,
content::WebContents* web_contents,
gfx::NativeView container_view) {
@@ -67,7 +67,7 @@ PasswordGenerationPopupControllerImpl::PasswordGenerationPopupControllerImpl(
const gfx::RectF& bounds,
const PasswordForm& form,
int max_length,
- PasswordManager* password_manager,
+ password_manager::PasswordManager* password_manager,
PasswordGenerationPopupObserver* observer,
content::WebContents* web_contents,
gfx::NativeView container_view)
diff --git a/chrome/browser/ui/autofill/password_generation_popup_controller_impl.h b/chrome/browser/ui/autofill/password_generation_popup_controller_impl.h
index f20287b..b2a95b1 100644
--- a/chrome/browser/ui/autofill/password_generation_popup_controller_impl.h
+++ b/chrome/browser/ui/autofill/password_generation_popup_controller_impl.h
@@ -23,7 +23,9 @@ struct NativeWebKeyboardEvent;
class WebContents;
}
+namespace password_manager {
class PasswordManager;
+}
namespace autofill {
@@ -50,7 +52,7 @@ class PasswordGenerationPopupControllerImpl
const gfx::RectF& bounds,
const PasswordForm& form,
int max_length,
- PasswordManager* password_manager,
+ password_manager::PasswordManager* password_manager,
PasswordGenerationPopupObserver* observer,
content::WebContents* web_contents,
gfx::NativeView container_view);
@@ -78,7 +80,7 @@ class PasswordGenerationPopupControllerImpl
const gfx::RectF& bounds,
const PasswordForm& form,
int max_length,
- PasswordManager* password_manager,
+ password_manager::PasswordManager* password_manager,
PasswordGenerationPopupObserver* observer,
content::WebContents* web_contents,
gfx::NativeView container_view);
@@ -126,7 +128,7 @@ class PasswordGenerationPopupControllerImpl
void CalculateBounds();
PasswordForm form_;
- PasswordManager* password_manager_;
+ password_manager::PasswordManager* password_manager_;
// May be NULL.
PasswordGenerationPopupObserver* observer_;
diff --git a/chrome/browser/ui/autofill/tab_autofill_manager_delegate.cc b/chrome/browser/ui/autofill/tab_autofill_manager_delegate.cc
index e2baa5e..bc70bb1 100644
--- a/chrome/browser/ui/autofill/tab_autofill_manager_delegate.cc
+++ b/chrome/browser/ui/autofill/tab_autofill_manager_delegate.cc
@@ -174,7 +174,7 @@ void TabAutofillManagerDelegate::WebContentsDestroyed(
void TabAutofillManagerDelegate::DetectAccountCreationForms(
const std::vector<autofill::FormStructure*>& forms) {
- PasswordGenerationManager* manager =
+ password_manager::PasswordGenerationManager* manager =
ChromePasswordManagerClient::GetGenerationManagerFromWebContents(
web_contents_);
if (manager)
diff --git a/chrome/browser/ui/cocoa/browser/password_generation_bubble_controller.h b/chrome/browser/ui/cocoa/browser/password_generation_bubble_controller.h
index 6683d42..c21a16c 100644
--- a/chrome/browser/ui/cocoa/browser/password_generation_bubble_controller.h
+++ b/chrome/browser/ui/cocoa/browser/password_generation_bubble_controller.h
@@ -21,9 +21,12 @@ class RenderViewHost;
}
class Browser;
-class PasswordManager;
@class PasswordGenerationBubbleController;
+namespace password_manager {
+class PasswordManager;
+}
+
// Customized text field that is used to display the regenerate icon.
@interface PasswordGenerationTextField : StyledTextField {
}
@@ -39,7 +42,7 @@ class PasswordManager;
@private
// |renderViewHost_| and |passwordManager_| may be nil in testing.
content::RenderViewHost* renderViewHost_;
- PasswordManager* passwordManager_;
+ password_manager::PasswordManager* passwordManager_;
autofill::PasswordGenerator* passwordGenerator_;
autofill::PasswordForm form_;
autofill::password_generation::PasswordGenerationActions actions_;
@@ -52,7 +55,7 @@ class PasswordManager;
- (id)initWithWindow:(NSWindow*)parentWindow
anchoredAt:(NSPoint)point
renderViewHost:(content::RenderViewHost*)renderViewHost
- passwordManager:(PasswordManager*)passwordManager
+ passwordManager:(password_manager::PasswordManager*)passwordManager
usingGenerator:(autofill::PasswordGenerator*)passwordGenerator
forForm:(const autofill::PasswordForm&)form;
- (void)performLayout;
diff --git a/chrome/browser/ui/cocoa/browser/password_generation_bubble_controller.mm b/chrome/browser/ui/cocoa/browser/password_generation_bubble_controller.mm
index 3f863a7..755bc27cb 100644
--- a/chrome/browser/ui/cocoa/browser/password_generation_bubble_controller.mm
+++ b/chrome/browser/ui/cocoa/browser/password_generation_bubble_controller.mm
@@ -293,7 +293,7 @@ const CGFloat kIconSize = 26.0;
- (id)initWithWindow:(NSWindow*)parentWindow
anchoredAt:(NSPoint)point
renderViewHost:(content::RenderViewHost*)renderViewHost
- passwordManager:(PasswordManager*)passwordManager
+ passwordManager:(password_manager::PasswordManager*)passwordManager
usingGenerator:(autofill::PasswordGenerator*)passwordGenerator
forForm:(const autofill::PasswordForm&)form {
CGFloat width = (kBorderSize*2 +
diff --git a/chrome/browser/ui/cocoa/login_prompt_cocoa.mm b/chrome/browser/ui/cocoa/login_prompt_cocoa.mm
index 8f4201e..8215bcc 100644
--- a/chrome/browser/ui/cocoa/login_prompt_cocoa.mm
+++ b/chrome/browser/ui/cocoa/login_prompt_cocoa.mm
@@ -55,7 +55,7 @@ class LoginHandlerMac : public LoginHandler,
// LoginHandler:
virtual void BuildViewForPasswordManager(
- PasswordManager* manager,
+ password_manager::PasswordManager* manager,
const base::string16& explanation) OVERRIDE {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
diff --git a/chrome/browser/ui/login/login_prompt.cc b/chrome/browser/ui/login/login_prompt.cc
index 92bdd6f..3792226 100644
--- a/chrome/browser/ui/login/login_prompt.cc
+++ b/chrome/browser/ui/login/login_prompt.cc
@@ -118,7 +118,8 @@ void LoginHandler::SetPasswordForm(const autofill::PasswordForm& form) {
password_form_ = form;
}
-void LoginHandler::SetPasswordManager(PasswordManager* password_manager) {
+void LoginHandler::SetPasswordManager(
+ password_manager::PasswordManager* password_manager) {
password_manager_ = password_manager;
}
@@ -235,7 +236,7 @@ LoginHandler::~LoginHandler() {
SetModel(NULL);
}
-void LoginHandler::SetModel(LoginModel* model) {
+void LoginHandler::SetModel(password_manager::LoginModel* model) {
if (login_model_)
login_model_->RemoveObserver(this);
login_model_ = model;
@@ -434,7 +435,7 @@ void LoginDialogCallback(const GURL& request_url,
return;
}
- PasswordManager* password_manager =
+ password_manager::PasswordManager* password_manager =
ChromePasswordManagerClient::GetManagerFromWebContents(parent_contents);
if (!password_manager) {
// Same logic as above.
diff --git a/chrome/browser/ui/login/login_prompt.h b/chrome/browser/ui/login/login_prompt.h
index 9c227da..19f5381 100644
--- a/chrome/browser/ui/login/login_prompt.h
+++ b/chrome/browser/ui/login/login_prompt.h
@@ -30,7 +30,7 @@ class URLRequest;
// authentication info to the net::URLRequest that needs it. These functions
// must be implemented in a thread safe manner.
class LoginHandler : public content::ResourceDispatcherHostLoginDelegate,
- public LoginModelObserver,
+ public password_manager::LoginModelObserver,
public content::NotificationObserver {
public:
LoginHandler(net::AuthChallengeInfo* auth_info, net::URLRequest* request);
@@ -45,13 +45,13 @@ class LoginHandler : public content::ResourceDispatcherHostLoginDelegate,
// Initializes the underlying platform specific view.
virtual void BuildViewForPasswordManager(
- PasswordManager* manager,
+ password_manager::PasswordManager* manager,
const base::string16& explanation) = 0;
// Sets information about the authentication type (|form|) and the
// |password_manager| for this profile.
void SetPasswordForm(const autofill::PasswordForm& form);
- void SetPasswordManager(PasswordManager* password_manager);
+ void SetPasswordManager(password_manager::PasswordManager* password_manager);
// Returns the WebContents that needs authentication.
content::WebContents* GetWebContentsForLogin() const;
@@ -81,7 +81,7 @@ class LoginHandler : public content::ResourceDispatcherHostLoginDelegate,
protected:
virtual ~LoginHandler();
- void SetModel(LoginModel* model);
+ void SetModel(password_manager::LoginModel* model);
// Notify observers that authentication is needed.
void NotifyAuthNeeded();
@@ -142,7 +142,7 @@ class LoginHandler : public content::ResourceDispatcherHostLoginDelegate,
// Points to the password manager owned by the WebContents requesting auth.
// This should only be accessed on the UI loop.
- PasswordManager* password_manager_;
+ password_manager::PasswordManager* password_manager_;
// Cached from the net::URLRequest, in case it goes NULL on us.
int render_process_host_id_;
@@ -150,7 +150,7 @@ class LoginHandler : public content::ResourceDispatcherHostLoginDelegate,
// If not null, points to a model we need to notify of our own destruction
// so it doesn't try and access this when its too late.
- LoginModel* login_model_;
+ password_manager::LoginModel* login_model_;
// Observes other login handlers so this login handler can respond.
// This is only accessed on the UI thread.
diff --git a/chrome/browser/ui/passwords/manage_passwords_bubble_model.cc b/chrome/browser/ui/passwords/manage_passwords_bubble_model.cc
index 274eb50..16c4cf2 100644
--- a/chrome/browser/ui/passwords/manage_passwords_bubble_model.cc
+++ b/chrome/browser/ui/passwords/manage_passwords_bubble_model.cc
@@ -81,8 +81,9 @@ void ManagePasswordsBubbleModel::OnPasswordAction(
return;
Profile* profile =
Profile::FromBrowserContext(web_contents_->GetBrowserContext());
- PasswordStore* password_store = PasswordStoreFactory::GetForProfile(
- profile, Profile::EXPLICIT_ACCESS).get();
+ password_manager::PasswordStore* password_store =
+ PasswordStoreFactory::GetForProfile(profile, Profile::EXPLICIT_ACCESS)
+ .get();
DCHECK(password_store);
if (action == REMOVE_PASSWORD)
password_store->RemoveLogin(password_form);
diff --git a/chrome/browser/ui/passwords/manage_passwords_bubble_ui_controller.cc b/chrome/browser/ui/passwords/manage_passwords_bubble_ui_controller.cc
index bf79ffd..1de52bc 100644
--- a/chrome/browser/ui/passwords/manage_passwords_bubble_ui_controller.cc
+++ b/chrome/browser/ui/passwords/manage_passwords_bubble_ui_controller.cc
@@ -11,6 +11,7 @@
#include "content/public/browser/notification_service.h"
using autofill::PasswordFormMap;
+using password_manager::PasswordFormManager;
DEFINE_WEB_CONTENTS_USER_DATA_KEY(ManagePasswordsBubbleUIController);
diff --git a/chrome/browser/ui/passwords/manage_passwords_bubble_ui_controller.h b/chrome/browser/ui/passwords/manage_passwords_bubble_ui_controller.h
index e7e7118..16b717d 100644
--- a/chrome/browser/ui/passwords/manage_passwords_bubble_ui_controller.h
+++ b/chrome/browser/ui/passwords/manage_passwords_bubble_ui_controller.h
@@ -25,7 +25,7 @@ class ManagePasswordsBubbleUIController
// can handle later requests to save or blacklist that login information.
// This stores the provided object in form_manager_ and triggers the UI to
// prompt the user about whether they would like to save the password.
- void OnPasswordSubmitted(PasswordFormManager* form_manager);
+ void OnPasswordSubmitted(password_manager::PasswordFormManager* form_manager);
// Called when a form is autofilled with login information, so we can manage
// password credentials for the current site which are stored in
@@ -112,7 +112,7 @@ class ManagePasswordsBubbleUIController
// information. If the user responds to a subsequent "Do you want to save
// this password?" prompt, we ask this object to save or blacklist the
// associated login information in Chrome's password store.
- scoped_ptr<PasswordFormManager> form_manager_;
+ scoped_ptr<password_manager::PasswordFormManager> form_manager_;
// All previously stored credentials for a specific site. Set by
// OnPasswordSubmitted() or OnPasswordAutofilled().
diff --git a/chrome/browser/ui/passwords/password_manager_presenter.cc b/chrome/browser/ui/passwords/password_manager_presenter.cc
index f1f2010..0179892 100644
--- a/chrome/browser/ui/passwords/password_manager_presenter.cc
+++ b/chrome/browser/ui/passwords/password_manager_presenter.cc
@@ -19,6 +19,8 @@
#include "content/public/browser/user_metrics.h"
#include "content/public/browser/web_contents.h"
+using password_manager::PasswordStore;
+
PasswordManagerPresenter::PasswordManagerPresenter(
PasswordUIView* password_view)
: populater_(this),
@@ -44,7 +46,7 @@ void PasswordManagerPresenter::Initialize() {
return;
show_passwords_.Init(
- prefs::kPasswordManagerAllowShowPasswords,
+ password_manager::prefs::kPasswordManagerAllowShowPasswords,
password_view_->GetProfile()->GetPrefs(),
base::Bind(&PasswordManagerPresenter::UpdatePasswordLists,
base::Unretained(this)));
@@ -56,7 +58,7 @@ void PasswordManagerPresenter::Initialize() {
}
void PasswordManagerPresenter::OnLoginsChanged(
- const PasswordStoreChangeList& changes) {
+ const password_manager::PasswordStoreChangeList& changes) {
// Entire list is updated for convenience.
UpdatePasswordLists();
}
diff --git a/chrome/browser/ui/passwords/password_manager_presenter.h b/chrome/browser/ui/passwords/password_manager_presenter.h
index eb4d9e1..bd3b07d 100644
--- a/chrome/browser/ui/passwords/password_manager_presenter.h
+++ b/chrome/browser/ui/passwords/password_manager_presenter.h
@@ -24,14 +24,16 @@ class Profile;
// Contains the common logic used by a PasswordUIView to
// interact with PasswordStore. It provides completion callbacks for
// PasswordStore operations and updates the view on PasswordStore changes.
-class PasswordManagerPresenter : public PasswordStore::Observer {
+class PasswordManagerPresenter
+ : public password_manager::PasswordStore::Observer {
public:
// |password_view| the UI view that owns this presenter, must not be NULL.
explicit PasswordManagerPresenter(PasswordUIView* password_view);
virtual ~PasswordManagerPresenter();
// PasswordStore::Observer implementation.
- virtual void OnLoginsChanged(const PasswordStoreChangeList& changes) OVERRIDE;
+ virtual void OnLoginsChanged(
+ const password_manager::PasswordStoreChangeList& changes) OVERRIDE;
// Repopulates the password and exception entries.
void UpdatePasswordLists();
@@ -60,7 +62,7 @@ class PasswordManagerPresenter : public PasswordStore::Observer {
friend class PasswordManagerPresenterTest;
// Returns the password store associated with the currently active profile.
- PasswordStore* GetPasswordStore();
+ password_manager::PasswordStore* GetPasswordStore();
// Returns true if the user needs to be authenticated before a plaintext
// password is revealed.
@@ -71,7 +73,7 @@ class PasswordManagerPresenter : public PasswordStore::Observer {
void SetPasswordExceptionList();
// A short class to mediate requests to the password store.
- class ListPopulater : public PasswordStoreConsumer {
+ class ListPopulater : public password_manager::PasswordStoreConsumer {
public:
explicit ListPopulater(PasswordManagerPresenter* page);
virtual ~ListPopulater();
diff --git a/chrome/browser/ui/sync/one_click_signin_helper.cc b/chrome/browser/ui/sync/one_click_signin_helper.cc
index c3136ce..5ab9e9d 100644
--- a/chrome/browser/ui/sync/one_click_signin_helper.cc
+++ b/chrome/browser/ui/sync/one_click_signin_helper.cc
@@ -680,8 +680,9 @@ DEFINE_WEB_CONTENTS_USER_DATA_KEY(OneClickSigninHelper);
// static
const int OneClickSigninHelper::kMaxNavigationsSince = 10;
-OneClickSigninHelper::OneClickSigninHelper(content::WebContents* web_contents,
- PasswordManager* password_manager)
+OneClickSigninHelper::OneClickSigninHelper(
+ content::WebContents* web_contents,
+ password_manager::PasswordManager* password_manager)
: content::WebContentsObserver(web_contents),
showing_signin_(false),
auto_accept_(AUTO_ACCEPT_NONE),
@@ -771,7 +772,7 @@ void OneClickSigninHelper::LogHistogramValue(
// static
void OneClickSigninHelper::CreateForWebContentsWithPasswordManager(
content::WebContents* contents,
- PasswordManager* password_manager) {
+ password_manager::PasswordManager* password_manager) {
if (!FromWebContents(contents)) {
contents->SetUserData(UserDataKey(),
new OneClickSigninHelper(contents, password_manager));
diff --git a/chrome/browser/ui/sync/one_click_signin_helper.h b/chrome/browser/ui/sync/one_click_signin_helper.h
index f966c6e..675719e 100644
--- a/chrome/browser/ui/sync/one_click_signin_helper.h
+++ b/chrome/browser/ui/sync/one_click_signin_helper.h
@@ -20,7 +20,6 @@
class Browser;
class GURL;
-class PasswordManager;
class ProfileIOData;
namespace autofill {
@@ -37,6 +36,10 @@ namespace net {
class URLRequest;
}
+namespace password_manager {
+class PasswordManager;
+}
+
// Per-tab one-click signin helper. When a user signs in to a Google service
// and the profile is not yet connected to a Google account, will start the
// process of helping the user connect his profile with one click. The process
@@ -171,7 +174,7 @@ class OneClickSigninHelper
static void CreateForWebContentsWithPasswordManager(
content::WebContents* contents,
- PasswordManager* password_manager);
+ password_manager::PasswordManager* password_manager);
// Returns true if the one-click signin feature can be offered at this time.
// If |email| is not empty, then the profile is checked to see if it's
@@ -285,7 +288,7 @@ class OneClickSigninHelper
static const int kMaxNavigationsSince;
OneClickSigninHelper(content::WebContents* web_contents,
- PasswordManager* password_manager);
+ password_manager::PasswordManager* password_manager);
virtual ~OneClickSigninHelper();
diff --git a/chrome/browser/ui/views/login_prompt_views.cc b/chrome/browser/ui/views/login_prompt_views.cc
index 651926d..0591b70 100644
--- a/chrome/browser/ui/views/login_prompt_views.cc
+++ b/chrome/browser/ui/views/login_prompt_views.cc
@@ -126,7 +126,7 @@ class LoginHandlerViews : public LoginHandler,
// LoginHandler:
virtual void BuildViewForPasswordManager(
- PasswordManager* manager,
+ password_manager::PasswordManager* manager,
const base::string16& explanation) OVERRIDE {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
diff --git a/chrome/browser/ui/views/login_view.cc b/chrome/browser/ui/views/login_view.cc
index 60a192a7..dcbd275 100644
--- a/chrome/browser/ui/views/login_view.cc
+++ b/chrome/browser/ui/views/login_view.cc
@@ -14,6 +14,7 @@
static const int kMessageWidth = 320;
static const int kTextfieldStackHorizontalSpacing = 30;
+using password_manager::LoginModel;
using views::GridLayout;
///////////////////////////////////////////////////////////////////////////////
@@ -96,7 +97,7 @@ views::View* LoginView::GetInitiallyFocusedView() {
}
///////////////////////////////////////////////////////////////////////////////
-// LoginView, views::View, views::LoginModelObserver overrides:
+// LoginView, views::View, password_manager::LoginModelObserver overrides:
void LoginView::OnAutofillDataAvailable(const base::string16& username,
const base::string16& password) {
diff --git a/chrome/browser/ui/views/login_view.h b/chrome/browser/ui/views/login_view.h
index c318e3e..6fc201d 100644
--- a/chrome/browser/ui/views/login_view.h
+++ b/chrome/browser/ui/views/login_view.h
@@ -16,11 +16,13 @@ class Textfield;
// This class is responsible for displaying the contents of a login window
// for HTTP/FTP authentication.
-class LoginView : public views::View, public LoginModelObserver {
+class LoginView : public views::View,
+ public password_manager::LoginModelObserver {
public:
// |model| is observed for the entire lifetime of the LoginView.
// Therefore |model| should not be destroyed before the LoginView object.
- LoginView(const base::string16& explanation, LoginModel* model);
+ LoginView(const base::string16& explanation,
+ password_manager::LoginModel* model);
virtual ~LoginView();
// Access the data in the username/password text fields.
@@ -49,7 +51,7 @@ class LoginView : public views::View, public LoginModelObserver {
// If not null, points to a model we need to notify of our own destruction
// so it doesn't try and access this when its too late.
- LoginModel* login_model_;
+ password_manager::LoginModel* login_model_;
DISALLOW_COPY_AND_ASSIGN(LoginView);
};
diff --git a/chrome/browser/ui/views/password_generation_bubble_view.cc b/chrome/browser/ui/views/password_generation_bubble_view.cc
index 47f00c3..73b623f 100644
--- a/chrome/browser/ui/views/password_generation_bubble_view.cc
+++ b/chrome/browser/ui/views/password_generation_bubble_view.cc
@@ -121,7 +121,7 @@ PasswordGenerationBubbleView::PasswordGenerationBubbleView(
const gfx::Rect& anchor_rect,
views::View* anchor_view,
content::RenderViewHost* render_view_host,
- PasswordManager* password_manager,
+ password_manager::PasswordManager* password_manager,
autofill::PasswordGenerator* password_generator,
content::PageNavigator* navigator,
ui::ThemeProvider* theme_provider)
diff --git a/chrome/browser/ui/views/password_generation_bubble_view.h b/chrome/browser/ui/views/password_generation_bubble_view.h
index 4743884..dcfdd75 100644
--- a/chrome/browser/ui/views/password_generation_bubble_view.h
+++ b/chrome/browser/ui/views/password_generation_bubble_view.h
@@ -29,7 +29,9 @@ class Label;
class LabelButton;
}
+namespace password_manager {
class PasswordManager;
+}
// PasswordGenerationBubbleView is a bubble used to show possible generated
// passwords to users. It is set in the page content, anchored at |anchor_rect|.
@@ -39,14 +41,15 @@ class PasswordGenerationBubbleView : public views::BubbleDelegateView,
public views::ButtonListener,
public views::TextfieldController {
public:
- PasswordGenerationBubbleView(const autofill::PasswordForm& form,
- const gfx::Rect& anchor_rect,
- views::View* anchor_view,
- content::RenderViewHost* render_view_host,
- PasswordManager* password_manager,
- autofill::PasswordGenerator* password_generator,
- content::PageNavigator* navigator,
- ui::ThemeProvider* theme_provider);
+ PasswordGenerationBubbleView(
+ const autofill::PasswordForm& form,
+ const gfx::Rect& anchor_rect,
+ views::View* anchor_view,
+ content::RenderViewHost* render_view_host,
+ password_manager::PasswordManager* password_manager,
+ autofill::PasswordGenerator* password_generator,
+ content::PageNavigator* navigator,
+ ui::ThemeProvider* theme_provider);
virtual ~PasswordGenerationBubbleView();
// views::View
@@ -89,7 +92,7 @@ class PasswordGenerationBubbleView : public views::BubbleDelegateView,
content::RenderViewHost* render_view_host_;
// PasswordManager associated with this tab.
- PasswordManager* password_manager_;
+ password_manager::PasswordManager* password_manager_;
// Object to generate passwords. The class won't take the ownership of it.
autofill::PasswordGenerator* password_generator_;
diff --git a/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc b/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc
index c351630..73133a8 100644
--- a/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc
+++ b/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc
@@ -123,7 +123,7 @@ void ManagePasswordsBubbleView::ShowBubble(content::WebContents* web_contents,
// static
void ManagePasswordsBubbleView::CloseBubble(
- password_manager_metrics_util::UIDismissalReason reason) {
+ password_manager::metrics_util::UIDismissalReason reason) {
if (manage_passwords_bubble_)
manage_passwords_bubble_->Close(reason);
}
@@ -167,10 +167,10 @@ ManagePasswordsBubbleView::ManagePasswordsBubbleView(
}
ManagePasswordsBubbleView::~ManagePasswordsBubbleView() {
- if (dismissal_reason_ == password_manager_metrics_util::NOT_DISPLAYED)
+ if (dismissal_reason_ == password_manager::metrics_util::NOT_DISPLAYED)
return;
- password_manager_metrics_util::LogUIDismissalReason(dismissal_reason_);
+ password_manager::metrics_util::LogUIDismissalReason(dismissal_reason_);
}
void ManagePasswordsBubbleView::BuildColumnSet(views::GridLayout* layout,
@@ -236,7 +236,7 @@ void ManagePasswordsBubbleView::AdjustForFullscreen(
}
void ManagePasswordsBubbleView::Close(
- password_manager_metrics_util::UIDismissalReason reason) {
+ password_manager::metrics_util::UIDismissalReason reason) {
dismissal_reason_ = reason;
icon_view_->SetTooltip(
manage_passwords_bubble_model_->manage_passwords_bubble_state() ==
@@ -250,7 +250,7 @@ void ManagePasswordsBubbleView::Init() {
// Default to a dismissal reason of "no interaction". If the user interacts
// with the button in such a way that it closes, we'll reset this value
// accordingly.
- dismissal_reason_ = password_manager_metrics_util::NO_DIRECT_INTERACTION;
+ dismissal_reason_ = password_manager::metrics_util::NO_DIRECT_INTERACTION;
GridLayout* layout = new GridLayout(this);
SetFocusable(true);
@@ -393,12 +393,12 @@ void ManagePasswordsBubbleView::ButtonPressed(views::Button* sender,
const ui::Event& event) {
DCHECK(sender == save_button_ || sender == done_button_);
- password_manager_metrics_util::UIDismissalReason reason;
+ password_manager::metrics_util::UIDismissalReason reason;
if (sender == save_button_) {
manage_passwords_bubble_model_->OnSaveClicked();
- reason = password_manager_metrics_util::CLICKED_SAVE;
+ reason = password_manager::metrics_util::CLICKED_SAVE;
} else {
- reason = password_manager_metrics_util::CLICKED_DONE;
+ reason = password_manager::metrics_util::CLICKED_DONE;
}
Close(reason);
}
@@ -407,21 +407,21 @@ void ManagePasswordsBubbleView::LinkClicked(views::Link* source,
int event_flags) {
DCHECK_EQ(source, manage_link_);
manage_passwords_bubble_model_->OnManageLinkClicked();
- Close(password_manager_metrics_util::CLICKED_MANAGE);
+ Close(password_manager::metrics_util::CLICKED_MANAGE);
}
void ManagePasswordsBubbleView::OnPerformAction(views::Combobox* source) {
DCHECK_EQ(source, refuse_combobox_);
- password_manager_metrics_util::UIDismissalReason reason =
- password_manager_metrics_util::NOT_DISPLAYED;
+ password_manager::metrics_util::UIDismissalReason reason =
+ password_manager::metrics_util::NOT_DISPLAYED;
switch (refuse_combobox_->selected_index()) {
case SavePasswordRefusalComboboxModel::INDEX_NOPE:
manage_passwords_bubble_model_->OnNopeClicked();
- reason = password_manager_metrics_util::CLICKED_NOPE;
+ reason = password_manager::metrics_util::CLICKED_NOPE;
break;
case SavePasswordRefusalComboboxModel::INDEX_NEVER_FOR_THIS_SITE:
manage_passwords_bubble_model_->OnNeverForThisSiteClicked();
- reason = password_manager_metrics_util::CLICKED_NEVER;
+ reason = password_manager::metrics_util::CLICKED_NEVER;
break;
default:
NOTREACHED();
diff --git a/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.h b/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.h
index 6e4ee89..bda7182 100644
--- a/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.h
+++ b/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.h
@@ -43,7 +43,7 @@ class ManagePasswordsBubbleView : public views::BubbleDelegateView,
// Closes any existing bubble.
static void CloseBubble(
- password_manager_metrics_util::UIDismissalReason reason);
+ password_manager::metrics_util::UIDismissalReason reason);
// Whether the bubble is currently showing.
static bool IsShowing();
@@ -82,7 +82,7 @@ class ManagePasswordsBubbleView : public views::BubbleDelegateView,
// bubble, this must be called after the bubble is created.
void AdjustForFullscreen(const gfx::Rect& screen_bounds);
- void Close(password_manager_metrics_util::UIDismissalReason reason);
+ void Close(password_manager::metrics_util::UIDismissalReason reason);
// views::BubbleDelegateView:
virtual void Init() OVERRIDE;
@@ -114,7 +114,7 @@ class ManagePasswordsBubbleView : public views::BubbleDelegateView,
views::LabelButton* done_button_;
// We track the dismissal reason so we can log it correctly in the destructor.
- password_manager_metrics_util::UIDismissalReason dismissal_reason_;
+ password_manager::metrics_util::UIDismissalReason dismissal_reason_;
DISALLOW_COPY_AND_ASSIGN(ManagePasswordsBubbleView);
};
diff --git a/chrome/browser/ui/views/passwords/manage_passwords_icon_view.cc b/chrome/browser/ui/views/passwords/manage_passwords_icon_view.cc
index 2024e15..6686784 100644
--- a/chrome/browser/ui/views/passwords/manage_passwords_icon_view.cc
+++ b/chrome/browser/ui/views/passwords/manage_passwords_icon_view.cc
@@ -29,7 +29,7 @@ void ManagePasswordsIconView::Update(
!location_bar_delegate_->GetToolbarModel()->input_in_progress());
if (!visible()) {
ManagePasswordsBubbleView::CloseBubble(
- password_manager_metrics_util::NOT_DISPLAYED);
+ password_manager::metrics_util::NOT_DISPLAYED);
return;
}
int icon_to_display =
diff --git a/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc b/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc
index 2eb5c3b0..d3520ac 100644
--- a/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc
+++ b/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc
@@ -298,7 +298,7 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* web_ui,
return &NewWebUI<OmniboxUI>;
if (url.host() == chrome::kChromeUIPasswordManagerInternalsHost &&
CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnablePasswordManagerInternalsUI)) {
+ password_manager::switches::kEnablePasswordManagerInternalsUI)) {
return &NewWebUI<PasswordManagerInternalsUI>;
}
if (url.host() == chrome::kChromeUIPredictorsHost)
diff --git a/chrome/browser/ui/webui/password_manager_internals/password_manager_internals_ui.h b/chrome/browser/ui/webui/password_manager_internals/password_manager_internals_ui.h
index a2e62a2..2f1f47e 100644
--- a/chrome/browser/ui/webui/password_manager_internals/password_manager_internals_ui.h
+++ b/chrome/browser/ui/webui/password_manager_internals/password_manager_internals_ui.h
@@ -8,8 +8,9 @@
#include "components/password_manager/core/browser/password_manager_logger.h"
#include "content/public/browser/web_ui_controller.h"
-class PasswordManagerInternalsUI : public content::WebUIController,
- public PasswordManagerLogger {
+class PasswordManagerInternalsUI
+ : public content::WebUIController,
+ public password_manager::PasswordManagerLogger {
public:
explicit PasswordManagerInternalsUI(content::WebUI* web_ui);
virtual ~PasswordManagerInternalsUI();
diff --git a/chrome/browser/ui/webui/password_manager_internals/password_manager_internals_ui_browsertest.cc b/chrome/browser/ui/webui/password_manager_internals/password_manager_internals_ui_browsertest.cc
index eb165b7..bc1aada 100644
--- a/chrome/browser/ui/webui/password_manager_internals/password_manager_internals_ui_browsertest.cc
+++ b/chrome/browser/ui/webui/password_manager_internals/password_manager_internals_ui_browsertest.cc
@@ -51,7 +51,8 @@ void PasswordManagerInternalsWebUIBrowserTest::SetUpOnMainThread() {
void PasswordManagerInternalsWebUIBrowserTest::SetUpCommandLine(
CommandLine* command_line) {
- command_line->AppendSwitch(switches::kEnablePasswordManagerInternalsUI);
+ command_line->AppendSwitch(
+ password_manager::switches::kEnablePasswordManagerInternalsUI);
}
content::WebContents*
diff --git a/chrome/test/base/profile_mock.h b/chrome/test/base/profile_mock.h
index d3929a5..e85e584 100644
--- a/chrome/test/base/profile_mock.h
+++ b/chrome/test/base/profile_mock.h
@@ -9,12 +9,17 @@
#include "testing/gmock/include/gmock/gmock.h"
+namespace password_manager {
+class PasswordStore;
+}
+
class ProfileMock : public TestingProfile {
public:
ProfileMock();
virtual ~ProfileMock();
- MOCK_METHOD1(GetPasswordStore, PasswordStore* (ServiceAccessType access));
+ MOCK_METHOD1(GetPasswordStore,
+ password_manager::PasswordStore*(ServiceAccessType access));
};
#endif // CHROME_TEST_BASE_PROFILE_MOCK_H_
diff --git a/components/password_manager/content/browser/content_password_manager_driver.cc b/components/password_manager/content/browser/content_password_manager_driver.cc
index d09957f..42a9853 100644
--- a/components/password_manager/content/browser/content_password_manager_driver.cc
+++ b/components/password_manager/content/browser/content_password_manager_driver.cc
@@ -18,6 +18,8 @@
#include "ipc/ipc_message_macros.h"
#include "net/cert/cert_status_flags.h"
+namespace password_manager {
+
ContentPasswordManagerDriver::ContentPasswordManagerDriver(
content::WebContents* web_contents,
PasswordManagerClient* client)
@@ -105,3 +107,5 @@ autofill::AutofillManager* ContentPasswordManagerDriver::GetAutofillManager() {
autofill::ContentAutofillDriver::FromWebContents(web_contents());
return driver ? driver->autofill_manager() : NULL;
}
+
+} // namespace password_manager
diff --git a/components/password_manager/content/browser/content_password_manager_driver.h b/components/password_manager/content/browser/content_password_manager_driver.h
index a1480a4..cb0c07f 100644
--- a/components/password_manager/content/browser/content_password_manager_driver.h
+++ b/components/password_manager/content/browser/content_password_manager_driver.h
@@ -21,6 +21,8 @@ namespace content {
class WebContents;
}
+namespace password_manager {
+
class ContentPasswordManagerDriver : public PasswordManagerDriver,
public content::WebContentsObserver {
public:
@@ -54,4 +56,6 @@ class ContentPasswordManagerDriver : public PasswordManagerDriver,
DISALLOW_COPY_AND_ASSIGN(ContentPasswordManagerDriver);
};
+} // namespace password_manager
+
#endif // COMPONENTS_PASSWORD_MANAGER_CONTENT_BROWSER_CONTENT_PASSWORD_MANAGER_DRIVER_H_
diff --git a/components/password_manager/core/browser/login_database.cc b/components/password_manager/core/browser/login_database.cc
index cf825c6..a65bf05 100644
--- a/components/password_manager/core/browser/login_database.cc
+++ b/components/password_manager/core/browser/login_database.cc
@@ -20,6 +20,8 @@
using autofill::PasswordForm;
+namespace password_manager {
+
static const int kCurrentVersionNumber = 5;
static const int kCompatibleVersionNumber = 1;
@@ -601,3 +603,5 @@ std::vector<base::string16> LoginDatabase::DeserializeVector(
}
return ret;
}
+
+} // namespace password_manager
diff --git a/components/password_manager/core/browser/login_database.h b/components/password_manager/core/browser/login_database.h
index 0765466..70da328 100644
--- a/components/password_manager/core/browser/login_database.h
+++ b/components/password_manager/core/browser/login_database.h
@@ -19,6 +19,8 @@ namespace autofill {
struct PasswordForm;
} // namespace autofill
+namespace password_manager {
+
// 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
// the login information.
@@ -139,4 +141,6 @@ class LoginDatabase {
DISALLOW_COPY_AND_ASSIGN(LoginDatabase);
};
+} // namespace password_manager
+
#endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_LOGIN_DATABASE_H_
diff --git a/components/password_manager/core/browser/login_database_mac.cc b/components/password_manager/core/browser/login_database_mac.cc
index 9089d6d..a957457 100644
--- a/components/password_manager/core/browser/login_database_mac.cc
+++ b/components/password_manager/core/browser/login_database_mac.cc
@@ -8,6 +8,8 @@
// rest of the database as a suplemental storage system to complement Keychain,
// providing storage of fields Keychain doesn't allow.
+namespace password_manager {
+
LoginDatabase::EncryptionResult LoginDatabase::EncryptedString(
const base::string16& plain_text,
std::string* cipher_text) const {
@@ -21,3 +23,5 @@ LoginDatabase::EncryptionResult LoginDatabase::DecryptedString(
*plain_text = base::string16();
return ENCRYPTION_RESULT_SUCCESS;
}
+
+} // namespace password_manager
diff --git a/components/password_manager/core/browser/login_database_posix.cc b/components/password_manager/core/browser/login_database_posix.cc
index 77ffdc6..a042612 100644
--- a/components/password_manager/core/browser/login_database_posix.cc
+++ b/components/password_manager/core/browser/login_database_posix.cc
@@ -6,6 +6,8 @@
#include "base/strings/utf_string_conversions.h"
+namespace password_manager {
+
// TODO: Actually encrypt passwords on Linux.
LoginDatabase::EncryptionResult LoginDatabase::EncryptedString(
@@ -21,3 +23,5 @@ LoginDatabase::EncryptionResult LoginDatabase::DecryptedString(
*plain_text = base::UTF8ToUTF16(cipher_text);
return ENCRYPTION_RESULT_SUCCESS;
}
+
+} // namespace password_manager
diff --git a/components/password_manager/core/browser/login_database_unittest.cc b/components/password_manager/core/browser/login_database_unittest.cc
index 13f216c..e9e1c33 100644
--- a/components/password_manager/core/browser/login_database_unittest.cc
+++ b/components/password_manager/core/browser/login_database_unittest.cc
@@ -21,6 +21,8 @@ using autofill::PasswordForm;
using base::ASCIIToUTF16;
using ::testing::Eq;
+namespace password_manager {
+
class LoginDatabaseTest : public testing::Test {
protected:
virtual void SetUp() {
@@ -766,3 +768,5 @@ TEST_F(LoginDatabaseTest, FilePermissions) {
EXPECT_EQ((mode & base::FILE_PERMISSION_USER_MASK), mode);
}
#endif // defined(OS_POSIX)
+
+} // namespace password_manager
diff --git a/components/password_manager/core/browser/login_database_win.cc b/components/password_manager/core/browser/login_database_win.cc
index b1d75a6..19fd7df 100644
--- a/components/password_manager/core/browser/login_database_win.cc
+++ b/components/password_manager/core/browser/login_database_win.cc
@@ -7,6 +7,8 @@
#include "base/strings/string_util.h"
#include "components/os_crypt/os_crypt.h"
+namespace password_manager {
+
LoginDatabase::EncryptionResult LoginDatabase::EncryptedString(
const base::string16& plain_text,
std::string* cipher_text) const {
@@ -22,3 +24,5 @@ LoginDatabase::EncryptionResult LoginDatabase::DecryptedString(
return ENCRYPTION_RESULT_SUCCESS;
return ENCRYPTION_RESULT_ITEM_FAILURE;
}
+
+} // namespace password_manager
diff --git a/components/password_manager/core/browser/login_model.h b/components/password_manager/core/browser/login_model.h
index dd004c2..0401926 100644
--- a/components/password_manager/core/browser/login_model.h
+++ b/components/password_manager/core/browser/login_model.h
@@ -7,6 +7,8 @@
#include "base/strings/string16.h"
+namespace password_manager {
+
// Simple Model & Observer interfaces for a LoginView to facilitate exchanging
// information.
class LoginModelObserver {
@@ -33,4 +35,6 @@ class LoginModel {
virtual ~LoginModel() {}
};
+} // namespace password_manager
+
#endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_LOGIN_MODEL_H_
diff --git a/components/password_manager/core/browser/mock_password_store.cc b/components/password_manager/core/browser/mock_password_store.cc
index 4b73a3c..68a8172 100644
--- a/components/password_manager/core/browser/mock_password_store.cc
+++ b/components/password_manager/core/browser/mock_password_store.cc
@@ -4,6 +4,8 @@
#include "components/password_manager/core/browser/mock_password_store.h"
+namespace password_manager {
+
MockPasswordStore::MockPasswordStore()
: PasswordStore(
base::MessageLoopProxy::current(),
@@ -11,3 +13,5 @@ MockPasswordStore::MockPasswordStore()
}
MockPasswordStore::~MockPasswordStore() {}
+
+} // namespace password_manager
diff --git a/components/password_manager/core/browser/mock_password_store.h b/components/password_manager/core/browser/mock_password_store.h
index ac9be35..b903678 100644
--- a/components/password_manager/core/browser/mock_password_store.h
+++ b/components/password_manager/core/browser/mock_password_store.h
@@ -13,6 +13,8 @@ namespace content {
class BrowserContext;
}
+namespace password_manager {
+
class MockPasswordStore : public PasswordStore {
public:
MockPasswordStore();
@@ -49,4 +51,6 @@ class MockPasswordStore : public PasswordStore {
virtual ~MockPasswordStore();
};
+} // namespace password_manager
+
#endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_MOCK_PASSWORD_STORE_H_
diff --git a/components/password_manager/core/browser/password_form_data.cc b/components/password_manager/core/browser/password_form_data.cc
index 6c4bfb3..5b236a7 100644
--- a/components/password_manager/core/browser/password_form_data.cc
+++ b/components/password_manager/core/browser/password_form_data.cc
@@ -8,6 +8,8 @@
using autofill::PasswordForm;
+namespace password_manager {
+
PasswordForm* CreatePasswordFormFromData(
const PasswordFormData& form_data) {
PasswordForm* form = new PasswordForm();
@@ -85,3 +87,5 @@ bool ContainsSamePasswordForms(
}
return ContainsSamePasswordFormsPtr(first_ptr, second_ptr);
}
+
+} // namespace password_manager
diff --git a/components/password_manager/core/browser/password_form_data.h b/components/password_manager/core/browser/password_form_data.h
index 12bd536..5a28290 100644
--- a/components/password_manager/core/browser/password_form_data.h
+++ b/components/password_manager/core/browser/password_form_data.h
@@ -12,6 +12,8 @@
// TODO(sync): This file must eventually be refactored away -- crbug.com/87185.
+namespace password_manager {
+
// Struct used for creation of PasswordForms from static arrays of data.
// Note: This is only meant to be used in unit test.
struct PasswordFormData {
@@ -50,4 +52,6 @@ MATCHER_P(ContainsAllPasswordForms, forms, "") {
return ContainsSamePasswordFormsPtr(forms, arg);
}
+} // namespace password_manager
+
#endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_FORM_DATA_H_
diff --git a/components/password_manager/core/browser/password_form_manager.cc b/components/password_manager/core/browser/password_form_manager.cc
index 96b2783..70fc1e5 100644
--- a/components/password_manager/core/browser/password_form_manager.cc
+++ b/components/password_manager/core/browser/password_form_manager.cc
@@ -23,6 +23,8 @@ using autofill::PasswordForm;
using autofill::PasswordFormMap;
using base::Time;
+namespace password_manager {
+
namespace {
enum PasswordGenerationSubmissionEvent {
@@ -692,3 +694,5 @@ void PasswordFormManager::SubmitFailed() {
if (has_generated_password_)
LogPasswordGenerationSubmissionEvent(PASSWORD_SUBMISSION_FAILED);
}
+
+} // namespace password_manager
diff --git a/components/password_manager/core/browser/password_form_manager.h b/components/password_manager/core/browser/password_form_manager.h
index a1d0595..9f2006b 100644
--- a/components/password_manager/core/browser/password_form_manager.h
+++ b/components/password_manager/core/browser/password_form_manager.h
@@ -20,6 +20,8 @@ namespace content {
class WebContents;
} // namespace content
+namespace password_manager {
+
class PasswordManager;
class PasswordManagerClient;
@@ -315,4 +317,7 @@ class PasswordFormManager : public PasswordStoreConsumer {
DISALLOW_COPY_AND_ASSIGN(PasswordFormManager);
};
+
+} // namespace password_manager
+
#endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_FORM_MANAGER_H_
diff --git a/components/password_manager/core/browser/password_form_manager_unittest.cc b/components/password_manager/core/browser/password_form_manager_unittest.cc
index 58db999..295be77 100644
--- a/components/password_manager/core/browser/password_form_manager_unittest.cc
+++ b/components/password_manager/core/browser/password_form_manager_unittest.cc
@@ -33,6 +33,8 @@ namespace autofill {
class AutofillManager;
}
+namespace password_manager {
+
namespace {
void RunAllPendingTasks() {
@@ -699,3 +701,5 @@ TEST_F(PasswordFormManagerTest, TestUpdateIncompleteCredentials) {
EXPECT_CALL(*mock_store(), UpdateLogin(complete_form));
form_manager.Save();
}
+
+} // namespace password_manager
diff --git a/components/password_manager/core/browser/password_generation_manager.cc b/components/password_manager/core/browser/password_generation_manager.cc
index 81b623c..bb5ebaf 100644
--- a/components/password_manager/core/browser/password_generation_manager.cc
+++ b/components/password_manager/core/browser/password_generation_manager.cc
@@ -12,6 +12,8 @@
#include "components/password_manager/core/browser/password_manager_client.h"
#include "components/password_manager/core/browser/password_manager_driver.h"
+namespace password_manager {
+
PasswordGenerationManager::PasswordGenerationManager(
PasswordManagerClient* client)
: client_(client),
@@ -54,3 +56,5 @@ bool PasswordGenerationManager::IsGenerationEnabled() const {
return true;
}
+
+} // namespace password_manager
diff --git a/components/password_manager/core/browser/password_generation_manager.h b/components/password_manager/core/browser/password_generation_manager.h
index f20f641..e3f1bae 100644
--- a/components/password_manager/core/browser/password_generation_manager.h
+++ b/components/password_manager/core/browser/password_generation_manager.h
@@ -9,13 +9,15 @@
#include "base/basictypes.h"
-class PasswordManagerClient;
-class PasswordManagerDriver;
-
namespace autofill {
class FormStructure;
}
+namespace password_manager {
+
+class PasswordManagerClient;
+class PasswordManagerDriver;
+
// Per-tab manager for password generation. Will enable this feature only if
//
// - Password manager is enabled
@@ -57,4 +59,6 @@ class PasswordGenerationManager {
DISALLOW_COPY_AND_ASSIGN(PasswordGenerationManager);
};
+} // namespace password_manager
+
#endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_GENERATION_MANAGER_H_
diff --git a/components/password_manager/core/browser/password_generation_manager_unittest.cc b/components/password_manager/core/browser/password_generation_manager_unittest.cc
index 70f432f..dc3a798 100644
--- a/components/password_manager/core/browser/password_generation_manager_unittest.cc
+++ b/components/password_manager/core/browser/password_generation_manager_unittest.cc
@@ -22,6 +22,8 @@
using base::ASCIIToUTF16;
+namespace password_manager {
+
namespace {
class TestPasswordManagerDriver : public PasswordManagerDriver {
@@ -218,3 +220,5 @@ TEST_F(PasswordGenerationManagerTest, UpdatePasswordSyncStateIncognito) {
EXPECT_FALSE(IsGenerationEnabled());
}
+
+} // namespace password_manager
diff --git a/components/password_manager/core/browser/password_manager.cc b/components/password_manager/core/browser/password_manager.cc
index 16ba3f4..1ab931f 100644
--- a/components/password_manager/core/browser/password_manager.cc
+++ b/components/password_manager/core/browser/password_manager.cc
@@ -22,6 +22,8 @@
using autofill::PasswordForm;
using autofill::PasswordFormMap;
+namespace password_manager {
+
namespace {
const char kSpdyProxyRealm[] = "/SpdyProxy";
@@ -200,12 +202,12 @@ void PasswordManager::RecordFailure(ProvisionalSaveFailure failure,
UMA_HISTOGRAM_ENUMERATION("PasswordManager.ProvisionalSaveFailure",
failure, MAX_FAILURE_VALUE);
- std::string group_name = password_manager_metrics_util::GroupIdToString(
- password_manager_metrics_util::MonitoredDomainGroupId(
- form_origin, client_->GetPrefs()));
+ std::string group_name = metrics_util::GroupIdToString(
+ metrics_util::MonitoredDomainGroupId(form_origin, client_->GetPrefs()));
if (!group_name.empty()) {
- password_manager_metrics_util::LogUMAHistogramEnumeration(
- "PasswordManager.ProvisionalSaveFailure_" + group_name, failure,
+ metrics_util::LogUMAHistogramEnumeration(
+ "PasswordManager.ProvisionalSaveFailure_" + group_name,
+ failure,
MAX_FAILURE_VALUE);
}
}
@@ -390,3 +392,5 @@ void PasswordManager::Autofill(
client_->PasswordWasAutofilled(best_matches);
}
+
+} // namespace password_manager
diff --git a/components/password_manager/core/browser/password_manager.h b/components/password_manager/core/browser/password_manager.h
index 15e69c0..05a2cf3 100644
--- a/components/password_manager/core/browser/password_manager.h
+++ b/components/password_manager/core/browser/password_manager.h
@@ -18,10 +18,6 @@
#include "components/password_manager/core/browser/login_model.h"
#include "components/password_manager/core/browser/password_form_manager.h"
-class PasswordManagerClient;
-class PasswordManagerDriver;
-class PasswordManagerTest;
-class PasswordFormManager;
class PrefRegistrySimple;
namespace content {
@@ -32,6 +28,13 @@ namespace user_prefs {
class PrefRegistrySyncable;
}
+namespace password_manager {
+
+class PasswordManagerClient;
+class PasswordManagerDriver;
+class PasswordManagerTest;
+class PasswordFormManager;
+
// Per-tab password manager. Handles creation and management of UI elements,
// receiving password form data from the renderer and managing the password
// database through the PasswordStore. The PasswordManager is a LoginModel
@@ -176,4 +179,6 @@ class PasswordManager : public LoginModel {
DISALLOW_COPY_AND_ASSIGN(PasswordManager);
};
+} // namespace password_manager
+
#endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_MANAGER_H_
diff --git a/components/password_manager/core/browser/password_manager_client.cc b/components/password_manager/core/browser/password_manager_client.cc
index 1567615..4d00f08 100644
--- a/components/password_manager/core/browser/password_manager_client.cc
+++ b/components/password_manager/core/browser/password_manager_client.cc
@@ -4,6 +4,8 @@
#include "components/password_manager/core/browser/password_manager_client.h"
+namespace password_manager {
+
base::FieldTrial::Probability
PasswordManagerClient::GetProbabilityForExperiment(
const std::string& experiment_name) {
@@ -16,3 +18,5 @@ void PasswordManagerClient::SetLogger(PasswordManagerLogger* /*logger*/) {}
void PasswordManagerClient::LogSavePasswordProgress(
const std::string& /*text*/) {}
+
+} // namespace password_manager
diff --git a/components/password_manager/core/browser/password_manager_client.h b/components/password_manager/core/browser/password_manager_client.h
index a9d2972..4990a18 100644
--- a/components/password_manager/core/browser/password_manager_client.h
+++ b/components/password_manager/core/browser/password_manager_client.h
@@ -9,10 +9,13 @@
#include "components/autofill/core/common/password_form.h"
#include "components/autofill/core/common/password_form_fill_data.h"
+class PrefService;
+
+namespace password_manager {
+
class PasswordFormManager;
class PasswordManagerDriver;
class PasswordStore;
-class PrefService;
class PasswordManagerLogger;
// An abstraction of operations that depend on the embedders (e.g. Chrome)
@@ -68,4 +71,6 @@ class PasswordManagerClient {
DISALLOW_COPY_AND_ASSIGN(PasswordManagerClient);
};
+} // namespace password_manager
+
#endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_MANAGER_CLIENT_H_
diff --git a/components/password_manager/core/browser/password_manager_driver.h b/components/password_manager/core/browser/password_manager_driver.h
index e9b738c..3b25840 100644
--- a/components/password_manager/core/browser/password_manager_driver.h
+++ b/components/password_manager/core/browser/password_manager_driver.h
@@ -7,9 +7,6 @@
#include <vector>
-class PasswordGenerationManager;
-class PasswordManager;
-
namespace autofill {
class AutofillManager;
struct FormData;
@@ -17,6 +14,11 @@ struct PasswordForm;
struct PasswordFormFillData;
} // namespace autofill
+namespace password_manager {
+
+class PasswordGenerationManager;
+class PasswordManager;
+
// Interface that allows PasswordManager core code to interact with its driver
// (i.e., obtain information from it and give information to it).
class PasswordManagerDriver {
@@ -55,4 +57,6 @@ class PasswordManagerDriver {
DISALLOW_COPY_AND_ASSIGN(PasswordManagerDriver);
};
+} // namespace password_manager
+
#endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_MANAGER_DRIVER_H_
diff --git a/components/password_manager/core/browser/password_manager_logger.h b/components/password_manager/core/browser/password_manager_logger.h
index 2e0f78f..0347021 100644
--- a/components/password_manager/core/browser/password_manager_logger.h
+++ b/components/password_manager/core/browser/password_manager_logger.h
@@ -8,6 +8,8 @@
#include <string>
#include "base/macros.h"
+namespace password_manager {
+
// This interface is used by the password management code to report on progress
// of actions like saving a password.
class PasswordManagerLogger {
@@ -21,4 +23,6 @@ class PasswordManagerLogger {
DISALLOW_COPY_AND_ASSIGN(PasswordManagerLogger);
};
+} // namespace password_manager
+
#endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_MANAGER_LOGGER_H_
diff --git a/components/password_manager/core/browser/password_manager_metrics_util.cc b/components/password_manager/core/browser/password_manager_metrics_util.cc
index 6026705..b955ff9 100644
--- a/components/password_manager/core/browser/password_manager_metrics_util.cc
+++ b/components/password_manager/core/browser/password_manager_metrics_util.cc
@@ -20,7 +20,9 @@
using base::ListValue;
using base::FundamentalValue;
-namespace password_manager_metrics_util {
+namespace password_manager {
+
+namespace metrics_util {
namespace {
@@ -143,4 +145,6 @@ void LogUIDismissalReason(UIDismissalReason reason) {
NUM_UI_RESPONSES);
}
-} // namespace password_manager_metrics_util
+} // namespace metrics_util
+
+} // namespace password_manager
diff --git a/components/password_manager/core/browser/password_manager_metrics_util.h b/components/password_manager/core/browser/password_manager_metrics_util.h
index 7ce1da1..f42cd9c 100644
--- a/components/password_manager/core/browser/password_manager_metrics_util.h
+++ b/components/password_manager/core/browser/password_manager_metrics_util.h
@@ -9,7 +9,9 @@
class PrefService;
-namespace password_manager_metrics_util {
+namespace password_manager {
+
+namespace metrics_util {
// Metrics: "PasswordManager.InfoBarResponse"
enum ResponseType {
@@ -80,6 +82,8 @@ void LogUIDismissalReason(UIDismissalReason reason);
// has rolled out to stable.
void LogUIDismissalReason(ResponseType type);
-} // namespace password_manager_metrics_util
+} // namespace metrics_util
+
+} // namespace password_manager
#endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_MANAGER_METRICS_UTIL_H_
diff --git a/components/password_manager/core/browser/password_manager_unittest.cc b/components/password_manager/core/browser/password_manager_unittest.cc
index a788cd5..7ea7231 100644
--- a/components/password_manager/core/browser/password_manager_unittest.cc
+++ b/components/password_manager/core/browser/password_manager_unittest.cc
@@ -36,6 +36,8 @@ namespace autofill {
class AutofillManager;
}
+namespace password_manager {
+
namespace {
class MockPasswordManagerClient : public StubPasswordManagerClient {
@@ -603,3 +605,5 @@ TEST_F(PasswordManagerTest, PasswordFormReappearance) {
manager()->OnPasswordFormsParsed(observed);
manager()->OnPasswordFormsRendered(observed);
}
+
+} // namespace password_manager
diff --git a/components/password_manager/core/browser/password_store.cc b/components/password_manager/core/browser/password_store.cc
index 23f54db..b23b3ec 100644
--- a/components/password_manager/core/browser/password_store.cc
+++ b/components/password_manager/core/browser/password_store.cc
@@ -20,6 +20,8 @@
using autofill::PasswordForm;
+namespace password_manager {
+
namespace {
// Calls |consumer| back with the request result, if |consumer| is still alive.
@@ -253,3 +255,5 @@ void PasswordStore::DestroySyncableService() {
syncable_service_.reset();
}
#endif
+
+} // namespace password_manager
diff --git a/components/password_manager/core/browser/password_store.h b/components/password_manager/core/browser/password_store.h
index 6c62963..d2448d0 100644
--- a/components/password_manager/core/browser/password_store.h
+++ b/components/password_manager/core/browser/password_store.h
@@ -18,9 +18,6 @@
#include "components/password_manager/core/browser/password_store_change.h"
#include "sync/api/syncable_service.h"
-class PasswordStore;
-class PasswordStoreConsumer;
-class PasswordSyncableService;
class Task;
namespace autofill {
@@ -34,16 +31,28 @@ class PasswordModelAssociator;
class PasswordModelWorker;
}
+namespace password_manager {
+class PasswordStore;
+} // namespace password_manager
+
namespace passwords_helper {
-void AddLogin(PasswordStore* store, const autofill::PasswordForm& form);
-void RemoveLogin(PasswordStore* store, const autofill::PasswordForm& form);
-void UpdateLogin(PasswordStore* store, const autofill::PasswordForm& form);
+void AddLogin(password_manager::PasswordStore* store,
+ const autofill::PasswordForm& form);
+void RemoveLogin(password_manager::PasswordStore* store,
+ const autofill::PasswordForm& form);
+void UpdateLogin(password_manager::PasswordStore* store,
+ const autofill::PasswordForm& form);
}
namespace syncer {
class SyncableService;
}
+namespace password_manager {
+
+class PasswordStoreConsumer;
+class PasswordSyncableService;
+
// Interface for storing form passwords in a platform-specific secure way.
// The login request/manipulation API is not threadsafe and must be used
// from the UI thread.
@@ -299,4 +308,6 @@ class PasswordStore : public base::RefCountedThreadSafe<PasswordStore> {
DISALLOW_COPY_AND_ASSIGN(PasswordStore);
};
+} // namespace password_manager
+
#endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_STORE_H_
diff --git a/components/password_manager/core/browser/password_store_change.h b/components/password_manager/core/browser/password_store_change.h
index 84b854b..200195e 100644
--- a/components/password_manager/core/browser/password_store_change.h
+++ b/components/password_manager/core/browser/password_store_change.h
@@ -9,6 +9,8 @@
#include "components/autofill/core/common/password_form.h"
+namespace password_manager {
+
class PasswordStoreChange {
public:
enum Type {
@@ -52,4 +54,6 @@ class PasswordStoreChange {
typedef std::vector<PasswordStoreChange> PasswordStoreChangeList;
+} // namespace password_manager
+
#endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_STORE_CHANGE_H_
diff --git a/components/password_manager/core/browser/password_store_consumer.cc b/components/password_manager/core/browser/password_store_consumer.cc
index 7892910..da62aed 100644
--- a/components/password_manager/core/browser/password_store_consumer.cc
+++ b/components/password_manager/core/browser/password_store_consumer.cc
@@ -4,8 +4,12 @@
#include "components/password_manager/core/browser/password_store_consumer.h"
+namespace password_manager {
+
PasswordStoreConsumer::PasswordStoreConsumer() : weak_ptr_factory_(this) {
}
PasswordStoreConsumer::~PasswordStoreConsumer() {
}
+
+} // namespace password_manager
diff --git a/components/password_manager/core/browser/password_store_consumer.h b/components/password_manager/core/browser/password_store_consumer.h
index ce07658..c923777 100644
--- a/components/password_manager/core/browser/password_store_consumer.h
+++ b/components/password_manager/core/browser/password_store_consumer.h
@@ -13,6 +13,8 @@ namespace autofill {
struct PasswordForm;
}
+namespace password_manager {
+
// Reads from the PasswordStore are done asynchronously on a separate
// thread. PasswordStoreConsumer provides the virtual callback method, which is
// guaranteed to be executed on this (the UI) thread. It also provides the
@@ -46,4 +48,6 @@ class PasswordStoreConsumer {
base::WeakPtrFactory<PasswordStoreConsumer> weak_ptr_factory_;
};
+} // namespace password_manager
+
#endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_STORE_CONSUMER_H_
diff --git a/components/password_manager/core/browser/password_store_default.cc b/components/password_manager/core/browser/password_store_default.cc
index eb1581e..5ee4968 100644
--- a/components/password_manager/core/browser/password_store_default.cc
+++ b/components/password_manager/core/browser/password_store_default.cc
@@ -13,6 +13,8 @@
using autofill::PasswordForm;
+namespace password_manager {
+
PasswordStoreDefault::PasswordStoreDefault(
scoped_refptr<base::SingleThreadTaskRunner> main_thread_runner,
scoped_refptr<base::SingleThreadTaskRunner> db_thread_runner,
@@ -103,3 +105,5 @@ bool PasswordStoreDefault::FillBlacklistLogins(
DCHECK(GetBackgroundTaskRunner()->BelongsToCurrentThread());
return login_db_->GetBlacklistLogins(forms);
}
+
+} // namespace password_manager
diff --git a/components/password_manager/core/browser/password_store_default.h b/components/password_manager/core/browser/password_store_default.h
index 2bede91..766f38d 100644
--- a/components/password_manager/core/browser/password_store_default.h
+++ b/components/password_manager/core/browser/password_store_default.h
@@ -11,6 +11,8 @@
#include "components/password_manager/core/browser/login_database.h"
#include "components/password_manager/core/browser/password_store.h"
+namespace password_manager {
+
// Simple password store implementation that delegates everything to
// the LoginDatabase.
class PasswordStoreDefault : public PasswordStore {
@@ -56,4 +58,6 @@ class PasswordStoreDefault : public PasswordStore {
DISALLOW_COPY_AND_ASSIGN(PasswordStoreDefault);
};
+} // namespace password_manager
+
#endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_STORE_DEFAULT_H_
diff --git a/components/password_manager/core/browser/password_store_default_unittest.cc b/components/password_manager/core/browser/password_store_default_unittest.cc
index afd5337..6cf5198 100644
--- a/components/password_manager/core/browser/password_store_default_unittest.cc
+++ b/components/password_manager/core/browser/password_store_default_unittest.cc
@@ -28,6 +28,8 @@ using testing::Pointee;
using testing::Property;
using testing::WithArg;
+namespace password_manager {
+
namespace {
class MockPasswordStoreConsumer : public PasswordStoreConsumer {
@@ -178,3 +180,5 @@ TEST_F(PasswordStoreDefaultTest, Notifications) {
store->Shutdown();
base::MessageLoop::current()->RunUntilIdle();
}
+
+} // namespace password_manager
diff --git a/components/password_manager/core/browser/password_store_unittest.cc b/components/password_manager/core/browser/password_store_unittest.cc
index d35d950..045b328 100644
--- a/components/password_manager/core/browser/password_store_unittest.cc
+++ b/components/password_manager/core/browser/password_store_unittest.cc
@@ -21,6 +21,8 @@ using testing::_;
using testing::DoAll;
using testing::WithArg;
+namespace password_manager {
+
namespace {
class MockPasswordStoreConsumer : public PasswordStoreConsumer {
@@ -208,3 +210,5 @@ TEST_F(PasswordStoreTest, StartSyncFlare) {
store->Shutdown();
base::MessageLoop::current()->RunUntilIdle();
}
+
+} // namespace password_manager
diff --git a/components/password_manager/core/browser/password_syncable_service.cc b/components/password_manager/core/browser/password_syncable_service.cc
index 27eae58..5a50507 100644
--- a/components/password_manager/core/browser/password_syncable_service.cc
+++ b/components/password_manager/core/browser/password_syncable_service.cc
@@ -14,6 +14,8 @@
#include "net/base/escape.h"
#include "sync/api/sync_error_factory.h"
+namespace password_manager {
+
namespace {
// Describes the result of merging sync and local passwords.
@@ -473,3 +475,5 @@ std::string MakePasswordSyncTag(
password.password_element(),
password.signon_realm());
}
+
+} // namespace password_manager
diff --git a/components/password_manager/core/browser/password_syncable_service.h b/components/password_manager/core/browser/password_syncable_service.h
index c99ce92..a385c1c 100644
--- a/components/password_manager/core/browser/password_syncable_service.h
+++ b/components/password_manager/core/browser/password_syncable_service.h
@@ -30,6 +30,8 @@ namespace syncer {
class SyncErrorFactory;
}
+namespace password_manager {
+
class PasswordStore;
class PasswordSyncableService : public syncer::SyncableService,
@@ -127,4 +129,6 @@ void PasswordFromSpecifics(const sync_pb::PasswordSpecificsData& password,
// |password| entry.
std::string MakePasswordSyncTag(const sync_pb::PasswordSpecificsData& password);
+} // namespace password_manager
+
#endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_SYNCABLE_SERVICE_H__
diff --git a/components/password_manager/core/browser/password_syncable_service_unittest.cc b/components/password_manager/core/browser/password_syncable_service_unittest.cc
index 78a4391..b5ac4df 100644
--- a/components/password_manager/core/browser/password_syncable_service_unittest.cc
+++ b/components/password_manager/core/browser/password_syncable_service_unittest.cc
@@ -28,6 +28,8 @@ using testing::Return;
using testing::SetArgPointee;
using testing::_;
+namespace password_manager {
+
namespace {
typedef std::vector<SyncChange> SyncChangeList;
@@ -632,3 +634,5 @@ TEST_F(PasswordSyncableServiceTest, StartSyncFlare) {
}
} // namespace
+
+} // namespace password_manager
diff --git a/components/password_manager/core/browser/psl_matching_helper.cc b/components/password_manager/core/browser/psl_matching_helper.cc
index 1f7da83..ef8eff7 100644
--- a/components/password_manager/core/browser/psl_matching_helper.cc
+++ b/components/password_manager/core/browser/psl_matching_helper.cc
@@ -15,6 +15,8 @@
using autofill::PasswordForm;
+namespace password_manager {
+
#if !defined(OS_IOS)
namespace {
@@ -74,3 +76,5 @@ bool PSLMatchingHelper::DeterminePSLEnabled() {
#endif
return enabled;
}
+
+} // namespace password_manager
diff --git a/components/password_manager/core/browser/psl_matching_helper.h b/components/password_manager/core/browser/psl_matching_helper.h
index d502d0b..b1e0441 100644
--- a/components/password_manager/core/browser/psl_matching_helper.h
+++ b/components/password_manager/core/browser/psl_matching_helper.h
@@ -15,6 +15,8 @@ namespace autofill {
struct PasswordForm;
} // namespace autofill
+namespace password_manager {
+
class PSLMatchingHelper {
public:
// Enum used for histogram tracking PSL Domain triggering.
@@ -71,4 +73,6 @@ class PSLMatchingHelper {
DISALLOW_COPY_AND_ASSIGN(PSLMatchingHelper);
};
+} // namespace password_manager
+
#endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PSL_MATCHING_HELPER_H_
diff --git a/components/password_manager/core/browser/psl_matching_helper_unittest.cc b/components/password_manager/core/browser/psl_matching_helper_unittest.cc
index 4fa2bbd..2ac80fb 100644
--- a/components/password_manager/core/browser/psl_matching_helper_unittest.cc
+++ b/components/password_manager/core/browser/psl_matching_helper_unittest.cc
@@ -8,6 +8,10 @@
#include "components/autofill/core/common/password_form.h"
#include "testing/gtest/include/gtest/gtest.h"
+namespace password_manager {
+
+namespace {
+
TEST(PSLMatchingUtilsTest, IsPublicSuffixDomainMatch) {
struct TestPair {
const char* url1;
@@ -36,3 +40,7 @@ TEST(PSLMatchingUtilsTest, IsPublicSuffixDomainMatch) {
<< ", second URL = " << pairs[i].url2;
}
}
+
+} // namespace
+
+} // namespace password_manager
diff --git a/components/password_manager/core/browser/test_password_store.cc b/components/password_manager/core/browser/test_password_store.cc
index f2cc235..2ea0dc9 100644
--- a/components/password_manager/core/browser/test_password_store.cc
+++ b/components/password_manager/core/browser/test_password_store.cc
@@ -6,6 +6,8 @@
#include "components/autofill/core/common/password_form.h"
+namespace password_manager {
+
TestPasswordStore::TestPasswordStore()
: PasswordStore(base::MessageLoopProxy::current(),
base::MessageLoopProxy::current()) {
@@ -105,3 +107,5 @@ bool TestPasswordStore::FillBlacklistLogins(
std::vector<autofill::PasswordForm*>* forms) {
return true;
}
+
+} // namespace password_manager
diff --git a/components/password_manager/core/browser/test_password_store.h b/components/password_manager/core/browser/test_password_store.h
index 3a7a3a3..ba59040 100644
--- a/components/password_manager/core/browser/test_password_store.h
+++ b/components/password_manager/core/browser/test_password_store.h
@@ -16,6 +16,8 @@ namespace content {
class BrowserContext;
}
+namespace password_manager {
+
// A very simple PasswordStore implementation that keeps all of the passwords
// in memory and does all it's manipulations on the main thread. Since this
// is only used for testing, only the parts of the interface that are needed
@@ -69,4 +71,6 @@ class TestPasswordStore : public PasswordStore {
DISALLOW_COPY_AND_ASSIGN(TestPasswordStore);
};
+} // namespace password_manager
+
#endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_TEST_PASSWORD_STORE_H_
diff --git a/components/password_manager/core/common/password_manager_pref_names.cc b/components/password_manager/core/common/password_manager_pref_names.cc
index dc42c90..e4c9aab 100644
--- a/components/password_manager/core/common/password_manager_pref_names.cc
+++ b/components/password_manager/core/common/password_manager_pref_names.cc
@@ -4,6 +4,8 @@
#include "components/password_manager/core/common/password_manager_pref_names.h"
+namespace password_manager {
+
namespace prefs {
#if defined(OS_WIN)
@@ -38,3 +40,5 @@ const char kLocalProfileId[] = "profile.local_profile_id";
#endif
} // namespace prefs
+
+} // namespace password_manager
diff --git a/components/password_manager/core/common/password_manager_pref_names.h b/components/password_manager/core/common/password_manager_pref_names.h
index e21234b..5f474c5 100644
--- a/components/password_manager/core/common/password_manager_pref_names.h
+++ b/components/password_manager/core/common/password_manager_pref_names.h
@@ -7,6 +7,8 @@
#include "base/basictypes.h"
+namespace password_manager {
+
namespace prefs {
// Alphabetical list of preference names specific to the PasswordManager
@@ -25,4 +27,6 @@ extern const char kLocalProfileId[];
} // namespace prefs
+} // namespace password_manager
+
#endif // COMPONENTS_PASSWORD_MANAGER_CORE_COMMON_PASSWORD_MANAGER_PREF_NAMES_H_
diff --git a/components/password_manager/core/common/password_manager_switches.cc b/components/password_manager/core/common/password_manager_switches.cc
index d5c48de..8411df5 100644
--- a/components/password_manager/core/common/password_manager_switches.cc
+++ b/components/password_manager/core/common/password_manager_switches.cc
@@ -4,6 +4,8 @@
#include "components/password_manager/core/common/password_manager_switches.h"
+namespace password_manager {
+
namespace switches {
// Enables the chrome://memory-internals/ page.
@@ -11,3 +13,5 @@ const char kEnablePasswordManagerInternalsUI[] =
"enable-password-manager-internals-ui";
} // namespace switches
+
+} // namespace password_manager
diff --git a/components/password_manager/core/common/password_manager_switches.h b/components/password_manager/core/common/password_manager_switches.h
index 0b76bae..d88c07d 100644
--- a/components/password_manager/core/common/password_manager_switches.h
+++ b/components/password_manager/core/common/password_manager_switches.h
@@ -5,6 +5,8 @@
#ifndef COMPONENTS_PASSWORD_MANAGER_CORE_COMMON_PASSWORD_MANAGER_SWITCHES_H_
#define COMPONENTS_PASSWORD_MANAGER_CORE_COMMON_PASSWORD_MANAGER_SWITCHES_H_
+namespace password_manager {
+
namespace switches {
// All switches in alphabetical order. The switches should be documented
@@ -14,4 +16,6 @@ extern const char kEnablePasswordManagerInternalsUI[];
} // namespace switches
+} // namespace password_manager
+
#endif // COMPONENTS_PASSWORD_MANAGER_CORE_COMMON_PASSWORD_MANAGER_SWITCHES_H_