| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_RENDERER_AUTOFILL_PASSWORD_GENERATION_MANAGER_H_ | 5 #ifndef CHROME_RENDERER_AUTOFILL_PASSWORD_GENERATION_MANAGER_H_ |
| 6 #define CHROME_RENDERER_AUTOFILL_PASSWORD_GENERATION_MANAGER_H_ | 6 #define CHROME_RENDERER_AUTOFILL_PASSWORD_GENERATION_MANAGER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "content/public/renderer/render_view_observer.h" | 12 #include "content/public/renderer/render_view_observer.h" |
| 13 #include "googleurl/src/gurl.h" | 13 #include "googleurl/src/gurl.h" |
| 14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputElement.h" | 14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputElement.h" |
| 15 #include "third_party/WebKit/Source/WebKit/chromium/public/WebTextFieldDecorator
Client.h" | 15 #include "third_party/WebKit/Source/WebKit/chromium/public/WebTextFieldDecorator
Client.h" |
| 16 | 16 |
| 17 namespace password_generation { |
| 18 class PasswordGenerationStatus; |
| 19 } |
| 20 |
| 17 namespace WebKit { | 21 namespace WebKit { |
| 18 class WebCString; | 22 class WebCString; |
| 19 class WebDocument; | 23 class WebDocument; |
| 20 } | 24 } |
| 21 | 25 |
| 22 namespace webkit { | 26 namespace webkit { |
| 23 namespace forms { | 27 namespace forms { |
| 24 struct PasswordForm; | 28 struct PasswordForm; |
| 25 } // namespace forms | 29 } // namespace forms |
| 26 } // namespace webkit | 30 } // namespace webkit |
| (...skipping 27 matching lines...) Expand all Loading... |
| 54 const WebKit::WebInputElement& element) OVERRIDE; | 58 const WebKit::WebInputElement& element) OVERRIDE; |
| 55 virtual bool visibleByDefault() OVERRIDE; | 59 virtual bool visibleByDefault() OVERRIDE; |
| 56 virtual WebKit::WebCString imageNameForNormalState() OVERRIDE; | 60 virtual WebKit::WebCString imageNameForNormalState() OVERRIDE; |
| 57 virtual WebKit::WebCString imageNameForDisabledState() OVERRIDE; | 61 virtual WebKit::WebCString imageNameForDisabledState() OVERRIDE; |
| 58 virtual WebKit::WebCString imageNameForReadOnlyState() OVERRIDE; | 62 virtual WebKit::WebCString imageNameForReadOnlyState() OVERRIDE; |
| 59 virtual void handleClick(WebKit::WebInputElement& element) OVERRIDE; | 63 virtual void handleClick(WebKit::WebInputElement& element) OVERRIDE; |
| 60 virtual void willDetach(const WebKit::WebInputElement& element) OVERRIDE; | 64 virtual void willDetach(const WebKit::WebInputElement& element) OVERRIDE; |
| 61 | 65 |
| 62 // Message handlers. | 66 // Message handlers. |
| 63 void OnFormNotBlacklisted(const webkit::forms::PasswordForm& form); | 67 void OnFormNotBlacklisted(const webkit::forms::PasswordForm& form); |
| 64 void OnPasswordAccepted(const string16& password); | 68 void OnPasswordGenerationBubbleClosed( |
| 69 const password_generation::PasswordGenerationStatus& status); |
| 65 void OnPasswordGenerationEnabled(bool enabled); | 70 void OnPasswordGenerationEnabled(bool enabled); |
| 66 | 71 |
| 67 // Helper function to decide whether we should show password generation icon. | 72 // Helper function to decide whether we should show password generation icon. |
| 68 void MaybeShowIcon(); | 73 void MaybeShowIcon(); |
| 69 | 74 |
| 70 content::RenderView* render_view_; | 75 content::RenderView* render_view_; |
| 71 | 76 |
| 72 // True if password generation is enabled for the profile associated | 77 // True if password generation is enabled for the profile associated |
| 73 // with this renderer. | 78 // with this renderer. |
| 74 bool enabled_; | 79 bool enabled_; |
| 75 | 80 |
| 76 // Stores the origin of the account creation form we detected. | 81 // Stores the origin of the account creation form we detected. |
| 77 GURL account_creation_form_origin_; | 82 GURL account_creation_form_origin_; |
| 78 | 83 |
| 79 // Stores the origins of the password forms confirmed not to be blacklisted | 84 // Stores the origins of the password forms confirmed not to be blacklisted |
| 80 // by the browser. A form can be blacklisted if a user chooses "never save | 85 // by the browser. A form can be blacklisted if a user chooses "never save |
| 81 // passwords for this site". | 86 // passwords for this site". |
| 82 std::vector<GURL> not_blacklisted_password_form_origins_; | 87 std::vector<GURL> not_blacklisted_password_form_origins_; |
| 83 | 88 |
| 84 std::vector<WebKit::WebInputElement> passwords_; | 89 std::vector<WebKit::WebInputElement> passwords_; |
| 85 | 90 |
| 86 DISALLOW_COPY_AND_ASSIGN(PasswordGenerationManager); | 91 DISALLOW_COPY_AND_ASSIGN(PasswordGenerationManager); |
| 87 }; | 92 }; |
| 88 | 93 |
| 89 } // namespace autofill | 94 } // namespace autofill |
| 90 | 95 |
| 91 #endif // CHROME_RENDERER_AUTOFILL_PASSWORD_GENERATION_MANAGER_H_ | 96 #endif // CHROME_RENDERER_AUTOFILL_PASSWORD_GENERATION_MANAGER_H_ |
| OLD | NEW |