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