Chromium Code Reviews| Index: chrome/browser/ui/passwords/password_manager_presenter.h |
| diff --git a/chrome/browser/ui/passwords/password_manager_presenter.h b/chrome/browser/ui/passwords/password_manager_presenter.h |
| index 66c68462967c25cc4689f18f2bad21fa34f7e568..58fe2a7c94902a71107a5f8d79177585093eef97 100644 |
| --- a/chrome/browser/ui/passwords/password_manager_presenter.h |
| +++ b/chrome/browser/ui/passwords/password_manager_presenter.h |
| @@ -8,19 +8,21 @@ |
| #include <string> |
| #include <vector> |
| +#include "base/basictypes.h" |
|
engedy
2014/09/15 14:38:59
nit: basictypes.h is deprecated. Please include <s
jaekyeom
2014/09/16 07:58:09
Done.
|
| #include "base/memory/scoped_vector.h" |
| #include "base/prefs/pref_member.h" |
| +#include "base/strings/string16.h" |
| #include "components/password_manager/core/browser/password_store.h" |
| #include "components/password_manager/core/browser/password_store_consumer.h" |
| +class GURL; |
| +class PasswordUIView; |
| +class Profile; |
| + |
| namespace autofill { |
| struct PasswordForm; |
| } |
| -class PasswordUIView; |
| - |
| -class Profile; |
| - |
| // Contains the common logic used by a PasswordUIView to |
| // interact with PasswordStore. It provides completion callbacks for |
| // PasswordStore operations and updates the view on PasswordStore changes. |
| @@ -31,6 +33,9 @@ class PasswordManagerPresenter |
| explicit PasswordManagerPresenter(PasswordUIView* password_view); |
| virtual ~PasswordManagerPresenter(); |
| + // Checks if |origin| is valid for adding a new password entry. |
| + static bool CheckOriginValidityForAdding(const GURL& origin); |
| + |
| // PasswordStore::Observer implementation. |
| virtual void OnLoginsChanged( |
| const password_manager::PasswordStoreChangeList& changes) OVERRIDE; |
| @@ -46,6 +51,17 @@ class PasswordManagerPresenter |
| // Gets the password exception entry at |index|. |
| const autofill::PasswordForm* GetPasswordException(size_t index); |
| + // Adds a new password entry with |origin|, |username_value|, and |
| + // |password_value|. |origin| should have been validated by |
| + // CheckOriginValidityForAdding, and |password_value| should be non-empty. |
| + void AddPassword(const GURL& origin, |
| + const base::string16& username_value, |
| + const base::string16& password_value); |
| + |
| + // Updates the entry at |index| with |password_value|. |password_value| should |
| + // be non-empty. |
| + void UpdatePassword(size_t index, const base::string16& password_value); |
| + |
| // Removes the saved password entry at |index|. |
| // |index| the entry index to be removed. |
| void RemoveSavedPassword(size_t index); |