| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef COMPONENTS_PASSWORD_MANAGER_CONTENT_BROWSER_CONTENT_CREDENTIAL_MANAGER_D
ISPATCHER_H_ | 5 #ifndef COMPONENTS_PASSWORD_MANAGER_CONTENT_BROWSER_CONTENT_CREDENTIAL_MANAGER_D
ISPATCHER_H_ |
| 6 #define COMPONENTS_PASSWORD_MANAGER_CONTENT_BROWSER_CONTENT_CREDENTIAL_MANAGER_D
ISPATCHER_H_ | 6 #define COMPONENTS_PASSWORD_MANAGER_CONTENT_BROWSER_CONTENT_CREDENTIAL_MANAGER_D
ISPATCHER_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 // content::WebContentsObserver implementation. | 65 // content::WebContentsObserver implementation. |
| 66 bool OnMessageReceived(const IPC::Message& message) override; | 66 bool OnMessageReceived(const IPC::Message& message) override; |
| 67 | 67 |
| 68 using CredentialCallback = | 68 using CredentialCallback = |
| 69 base::Callback<void(const autofill::PasswordForm&)>; | 69 base::Callback<void(const autofill::PasswordForm&)>; |
| 70 | 70 |
| 71 PasswordManagerClient* client() const { return client_; } | 71 PasswordManagerClient* client() const { return client_; } |
| 72 | 72 |
| 73 private: | 73 private: |
| 74 class PendingRequestTask; | 74 class PendingRequestTask; |
| 75 class PendingSignedOutTask; |
| 75 | 76 |
| 76 PasswordStore* GetPasswordStore(); | 77 PasswordStore* GetPasswordStore(); |
| 77 | 78 |
| 78 bool IsSavingEnabledForCurrentPage() const; | 79 bool IsSavingEnabledForCurrentPage() const; |
| 79 bool IsZeroClickAllowed() const; | 80 bool IsZeroClickAllowed() const; |
| 80 | 81 |
| 81 // Returns the driver for the current main frame. | 82 // Returns the driver for the current main frame. |
| 82 // Virtual for testing. | 83 // Virtual for testing. |
| 83 virtual base::WeakPtr<PasswordManagerDriver> GetDriver(); | 84 virtual base::WeakPtr<PasswordManagerDriver> GetDriver(); |
| 84 | 85 |
| 85 void SendCredential(int request_id, const CredentialInfo& info); | 86 void SendCredential(int request_id, const CredentialInfo& info); |
| 87 void DoneSigningOut(); |
| 86 | 88 |
| 87 PasswordManagerClient* client_; | 89 PasswordManagerClient* client_; |
| 88 scoped_ptr<CredentialManagerPasswordFormManager> form_manager_; | 90 scoped_ptr<CredentialManagerPasswordFormManager> form_manager_; |
| 89 | 91 |
| 90 // Set to false to disable automatic signing in. | 92 // Set to false to disable automatic signing in. |
| 91 BooleanPrefMember auto_signin_enabled_; | 93 BooleanPrefMember auto_signin_enabled_; |
| 92 | 94 |
| 93 // When 'OnRequestCredential' is called, it in turn calls out to the | 95 // When 'OnRequestCredential' is called, it in turn calls out to the |
| 94 // PasswordStore; we push enough data into Pending*Task objects so that | 96 // PasswordStore; we push enough data into Pending*Task objects so that |
| 95 // they can properly respond to the request once the PasswordStore gives | 97 // they can properly respond to the request once the PasswordStore gives |
| 96 // us data. | 98 // us data. |
| 97 scoped_ptr<PendingRequestTask> pending_request_; | 99 scoped_ptr<PendingRequestTask> pending_request_; |
| 100 scoped_ptr<PendingSignedOutTask> pending_sign_out_; |
| 98 | 101 |
| 99 DISALLOW_COPY_AND_ASSIGN(CredentialManagerDispatcher); | 102 DISALLOW_COPY_AND_ASSIGN(CredentialManagerDispatcher); |
| 100 }; | 103 }; |
| 101 | 104 |
| 102 } // namespace password_manager | 105 } // namespace password_manager |
| 103 | 106 |
| 104 #endif // COMPONENTS_PASSWORD_MANAGER_CONTENT_BROWSER_CONTENT_CREDENTIAL_MANAGE
R_DISPATCHER_H_ | 107 #endif // COMPONENTS_PASSWORD_MANAGER_CONTENT_BROWSER_CONTENT_CREDENTIAL_MANAGE
R_DISPATCHER_H_ |
| OLD | NEW |