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

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

Issue 2947413002: Restrict CM API interface request and message dispatch. (Closed)
Patch Set: Addressed comments from rockot@. Created 3 years, 6 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 691fd949fb3665aac433ad26af60df0a25992047..230d9bc495421b2937a9091b6a04f0fe45d03773 100644
--- a/chrome/browser/password_manager/chrome_password_manager_client.h
+++ b/chrome/browser/password_manager/chrome_password_manager_client.h
@@ -127,14 +127,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,
@@ -146,11 +152,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
@@ -223,6 +229,10 @@ class ChromePasswordManagerClient
// navigation of the tab owning this ChromePasswordManagerClient.
base::Optional<ukm::SourceId> ukm_source_id_;
+ // Whether navigator.credentials.store() was ever called from this
+ // WebContents. Used for testing.
+ bool was_store_ever_called_ = false;
+
DISALLOW_COPY_AND_ASSIGN(ChromePasswordManagerClient);
};

Powered by Google App Engine
This is Rietveld 408576698