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

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

Issue 2947413002: Restrict CM API interface request and message dispatch. (Closed)
Patch Set: Reworked tests, added error handler in renderer. 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..480cb8199e6837b0de843f16338bec89c02c25db 100644
--- a/chrome/browser/password_manager/chrome_password_manager_client.h
+++ b/chrome/browser/password_manager/chrome_password_manager_client.h
@@ -135,6 +135,12 @@ class ChromePasswordManagerClient
// on this |url|.
static bool CanShowBubbleOnURL(const GURL& url);
+ // Exposed for testing.
vasilii 2017/06/29 11:59:59 Missing #if defined(UNIT_TEST)
engedy 2017/06/30 19:41:54 Done.
+ bool was_store_ever_called() const { return was_store_ever_called_; }
+ bool has_binding_for_credential_manager() const {
+ return credential_manager_impl_.HasBinding();
+ }
+
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