Commit e13de14a authored by jiangj's avatar jiangj Committed by Commit bot

Properly ifdef sync code in password_manager

Fix one misplaced header include and use PASSWORD_MANAGER_ENABLE_SYNC
macro to properly guard the other place of sync usage to fix a linking
issue when PASSWORD_MANAGER_ENABLE_SYNC is disabled.

Review URL: https://codereview.chromium.org/943533002

Cr-Commit-Position: refs/heads/master@{#317043}
parent aaf738a2
......@@ -132,6 +132,7 @@ void PasswordManagerPresenter::RequestShowPassword(size_t index) {
return;
}
#if defined(PASSWORD_MANAGER_ENABLE_SYNC)
if (password_manager_sync_metrics::IsSyncAccountCredential(
password_view_->GetProfile(),
base::UTF16ToUTF8(password_list_[index]->username_value),
......@@ -139,6 +140,7 @@ void PasswordManagerPresenter::RequestShowPassword(size_t index) {
content::RecordAction(
base::UserMetricsAction("PasswordManager_SyncCredentialShown"));
}
#endif
// Call back the front end to reveal the password.
password_view_->ShowPassword(index, password_list_[index]->password_value);
......
......@@ -12,7 +12,6 @@
#include "base/stl_util.h"
#include "components/autofill/core/common/password_form.h"
#include "components/password_manager/core/browser/password_store_consumer.h"
#include "components/password_manager/core/browser/password_syncable_service.h"
#if defined(PASSWORD_MANAGER_ENABLE_SYNC)
#include "components/password_manager/core/browser/password_syncable_service.h"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment