Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1952)

Unified Diff: chrome/browser/password_manager/chrome_password_manager_client.h

Issue 2947413002: Restrict CM API interface request and message dispatch. (Closed)
Patch Set: Address nit from clamy@. Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/password_manager/chrome_password_manager_client.h
diff --git a/chrome/browser/password_manager/chrome_password_manager_client.h b/chrome/browser/password_manager/chrome_password_manager_client.h
index 2af358074ec3309e250e81a1d7320544378cfa48..a589af691853a85f1e2822e6330fc4bb97c2f21a 100644
--- a/chrome/browser/password_manager/chrome_password_manager_client.h
+++ b/chrome/browser/password_manager/chrome_password_manager_client.h
@@ -11,6 +11,7 @@
#include "base/compiler_specific.h"
#include "base/macros.h"
#include "base/optional.h"
+#include "build/build_config.h"
#include "components/autofill/content/common/autofill_driver.mojom.h"
#include "components/password_manager/content/browser/content_password_manager_driver_factory.h"
#include "components/password_manager/content/browser/credential_manager_impl.h"
@@ -130,14 +131,20 @@ class ChromePasswordManagerClient
void SetTestObserver(autofill::PasswordGenerationPopupObserver* observer);
static void BindCredentialManager(
- const service_manager::BindSourceInfo& source_info,
- password_manager::mojom::CredentialManagerRequest request,
+ password_manager::mojom::CredentialManagerAssociatedRequest request,
content::RenderFrameHost* render_frame_host);
// A helper method to determine whether a save/update bubble can be shown
// on this |url|.
static bool CanShowBubbleOnURL(const GURL& url);
+#if defined(UNIT_TEST)
+ bool was_store_ever_called() const { return was_store_ever_called_; }
+ bool has_binding_for_credential_manager() const {
+ return credential_manager_impl_.HasBinding();
+ }
+#endif
+
protected:
// Callable for tests.
ChromePasswordManagerClient(content::WebContents* web_contents,
@@ -149,11 +156,11 @@ class ChromePasswordManagerClient
// content::WebContentsObserver overrides.
void DidStartNavigation(
content::NavigationHandle* navigation_handle) override;
-// TODO(crbug.com/706392): Fix password reuse detection for Android.
-#if !defined(OS_ANDROID)
void DidFinishNavigation(
content::NavigationHandle* navigation_handle) override;
+// TODO(crbug.com/706392): Fix password reuse detection for Android.
+#if !defined(OS_ANDROID)
// content::RenderWidgetHost::InputEventObserver overrides.
void OnInputEvent(const blink::WebInputEvent&) override;
#endif
@@ -232,6 +239,10 @@ class ChromePasswordManagerClient
base::Optional<password_manager::PasswordManagerMetricsRecorder>
metrics_recorder_;
+ // Whether navigator.credentials.store() was ever called from this
+ // WebContents. Used for testing.
+ bool was_store_ever_called_ = false;
+
DISALLOW_COPY_AND_ASSIGN(ChromePasswordManagerClient);
};
« no previous file with comments | « chrome/browser/chrome_content_browser_client.cc ('k') | chrome/browser/password_manager/chrome_password_manager_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698