Skip to content

Commit e233a56

Browse files
committed
Allow offering to save google passwords.
Goes around upstream check for gaia credential page and empty primary account in the browser. Fixes brave/brave-browser#17595 Fixes brave/brave-browser#16926
1 parent 84ba8f3 commit e233a56

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/* Copyright (c) 2021 The Brave Authors. All rights reserved.
2+
* This Source Code Form is subject to the terms of the Mozilla Public
3+
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
4+
* You can obtain one at http://mozilla.org/MPL/2.0/. */
5+
6+
#include "components/password_manager/core/browser/sync_credentials_filter.h"
7+
8+
#define ShouldSave ShouldSave_ChromiumImpl
9+
#include "../../../../../../components/password_manager/core/browser/sync_credentials_filter.cc"
10+
#undef ShouldSave
11+
12+
namespace password_manager {
13+
14+
bool SyncCredentialsFilter::ShouldSave(const PasswordForm& form) const {
15+
bool should_save = ShouldSave_ChromiumImpl(form);
16+
if (!should_save && sync_util::IsGaiaCredentialPage(form.signon_realm)) {
17+
return true;
18+
}
19+
return should_save;
20+
}
21+
22+
} // namespace password_manager
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/* Copyright (c) 2021 The Brave Authors. All rights reserved.
2+
* This Source Code Form is subject to the terms of the Mozilla Public
3+
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
4+
* You can obtain one at http://mozilla.org/MPL/2.0/. */
5+
6+
#ifndef BRAVE_CHROMIUM_SRC_COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_SYNC_CREDENTIALS_FILTER_H_
7+
#define BRAVE_CHROMIUM_SRC_COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_SYNC_CREDENTIALS_FILTER_H_
8+
9+
#include "components/password_manager/core/browser/credentials_filter.h"
10+
11+
#define ShouldSave \
12+
ShouldSave_ChromiumImpl(const PasswordForm& form) const; \
13+
bool ShouldSave
14+
15+
#include "../../../../../../components/password_manager/core/browser/sync_credentials_filter.h"
16+
17+
#undef ShouldSave
18+
19+
#endif // BRAVE_CHROMIUM_SRC_COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_SYNC_CREDENTIALS_FILTER_H_

0 commit comments

Comments
 (0)