OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_BUBBLE_MODEL_H_ | 5 #ifndef CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_BUBBLE_MODEL_H_ |
6 #define CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_BUBBLE_MODEL_H_ | 6 #define CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_BUBBLE_MODEL_H_ |
7 | 7 |
8 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 8 #include "components/autofill/core/common/password_form.h" |
| 9 #include "content/public/browser/web_contents_observer.h" |
| 10 |
| 11 class ManagePasswordsIconController; |
| 12 |
| 13 namespace autofill { |
| 14 class PasswordForm; |
| 15 } |
9 | 16 |
10 namespace content { | 17 namespace content { |
11 class WebContents; | 18 class WebContents; |
12 } | 19 } |
13 | 20 |
14 // This model provides data for the ManagePasswordsBubble and controls the | 21 // This model provides data for the ManagePasswordsBubble and controls the |
15 // password management actions. | 22 // password management actions. |
16 class ManagePasswordsBubbleModel : public content::WebContentsObserver { | 23 class ManagePasswordsBubbleModel : public content::WebContentsObserver { |
17 public: | 24 public: |
18 explicit ManagePasswordsBubbleModel(content::WebContents* web_contents); | 25 explicit ManagePasswordsBubbleModel(content::WebContents* web_contents); |
19 virtual ~ManagePasswordsBubbleModel(); | 26 virtual ~ManagePasswordsBubbleModel(); |
20 | 27 |
21 enum ManagePasswordsBubbleState { | 28 enum ManagePasswordsBubbleState { |
22 PASSWORD_TO_BE_SAVED, | 29 PASSWORD_TO_BE_SAVED, |
23 MANAGE_PASSWORDS_AFTER_SAVING, | 30 MANAGE_PASSWORDS_AFTER_SAVING, |
24 MANAGE_PASSWORDS | 31 MANAGE_PASSWORDS |
25 }; | 32 }; |
26 | 33 |
27 // Called by the view code when the cancel button in clicked by the user. | 34 // Called by the view code when the cancel button in clicked by the user. |
28 void OnCancelClicked(); | 35 void OnCancelClicked(); |
29 | 36 |
30 // Called by the view code when the save button in clicked by the user. | 37 // Called by the view code when the save button in clicked by the user. |
31 void OnSaveClicked(); | 38 void OnSaveClicked(); |
32 | 39 |
33 // Called by the view code when the manage link is clicked by the user. | 40 // Called by the view code when the manage link is clicked by the user. |
34 void OnManageLinkClicked(); | 41 void OnManageLinkClicked(); |
35 | 42 |
36 // Called by the view code to delete or add a password form to the | 43 // Called by the view code to delete or add a password form to the |
37 // PasswordStore. | 44 // PasswordStore. |
38 void PasswordAction(autofill::PasswordForm password_form, bool remove); | 45 void OnPasswordAction(autofill::PasswordForm password_form, bool remove); |
39 | 46 |
40 // Called by the view code when the ManagePasswordItemView is destroyed and | 47 // Called by the view code when the ManagePasswordItemView is destroyed and |
41 // the user chose to delete the password. | 48 // the user chose to delete the password. |
42 // TODO(npentrel): Remove this once best_matches_ are newly made on bubble | 49 // TODO(npentrel): Remove this once best_matches_ are newly made on bubble |
43 // opening. | 50 // opening. |
44 void DeleteFromBestMatches(autofill::PasswordForm password_form); | 51 void DeleteFromBestMatches(autofill::PasswordForm password_form); |
45 | 52 |
46 ManagePasswordsBubbleState manage_passwords_bubble_state() { | 53 ManagePasswordsBubbleState manage_passwords_bubble_state() { |
47 return manage_passwords_bubble_state_; | 54 return manage_passwords_bubble_state_; |
48 } | 55 } |
(...skipping 16 matching lines...) Expand all Loading... |
65 bool password_submitted_; | 72 bool password_submitted_; |
66 string16 title_; | 73 string16 title_; |
67 autofill::PasswordForm pending_credentials_; | 74 autofill::PasswordForm pending_credentials_; |
68 autofill::PasswordFormMap best_matches_; | 75 autofill::PasswordFormMap best_matches_; |
69 string16 manage_link_; | 76 string16 manage_link_; |
70 | 77 |
71 DISALLOW_COPY_AND_ASSIGN(ManagePasswordsBubbleModel); | 78 DISALLOW_COPY_AND_ASSIGN(ManagePasswordsBubbleModel); |
72 }; | 79 }; |
73 | 80 |
74 #endif // CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_BUBBLE_MODEL_H_ | 81 #endif // CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_BUBBLE_MODEL_H_ |
OLD | NEW |