| 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 COMPONENTS_AUTOFILL_RENDERER_PASSWORD_AUTOFILL_AGENT_H_ | 5 #ifndef COMPONENTS_AUTOFILL_RENDERER_PASSWORD_AUTOFILL_AGENT_H_ |
| 6 #define COMPONENTS_AUTOFILL_RENDERER_PASSWORD_AUTOFILL_AGENT_H_ | 6 #define COMPONENTS_AUTOFILL_RENDERER_PASSWORD_AUTOFILL_AGENT_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
| 12 #include "components/autofill/common/autofill_export.h" |
| 12 #include "components/autofill/common/password_form_fill_data.h" | 13 #include "components/autofill/common/password_form_fill_data.h" |
| 13 #include "content/public/renderer/render_view_observer.h" | 14 #include "content/public/renderer/render_view_observer.h" |
| 14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputElement.h" | 15 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputElement.h" |
| 15 | 16 |
| 16 namespace WebKit { | 17 namespace WebKit { |
| 17 class WebInputElement; | 18 class WebInputElement; |
| 18 class WebKeyboardEvent; | 19 class WebKeyboardEvent; |
| 19 class WebView; | 20 class WebView; |
| 20 } | 21 } |
| 21 | 22 |
| 22 namespace autofill { | 23 namespace autofill { |
| 23 | 24 |
| 24 // This class is responsible for filling password forms. | 25 // This class is responsible for filling password forms. |
| 25 // There is one PasswordAutofillAgent per RenderView. | 26 // There is one PasswordAutofillAgent per RenderView. |
| 26 class PasswordAutofillAgent : public content::RenderViewObserver { | 27 class AUTOFILL_EXPORT PasswordAutofillAgent |
| 28 : public content::RenderViewObserver { |
| 27 public: | 29 public: |
| 28 explicit PasswordAutofillAgent(content::RenderView* render_view); | 30 explicit PasswordAutofillAgent(content::RenderView* render_view); |
| 29 virtual ~PasswordAutofillAgent(); | 31 virtual ~PasswordAutofillAgent(); |
| 30 | 32 |
| 31 // WebViewClient editor related calls forwarded by the RenderView. | 33 // WebViewClient editor related calls forwarded by the RenderView. |
| 32 // If they return true, it indicates the event was consumed and should not | 34 // If they return true, it indicates the event was consumed and should not |
| 33 // be used for any other autofill activity. | 35 // be used for any other autofill activity. |
| 34 bool TextFieldDidEndEditing(const WebKit::WebInputElement& element); | 36 bool TextFieldDidEndEditing(const WebKit::WebInputElement& element); |
| 35 bool TextDidChangeInTextField(const WebKit::WebInputElement& element); | 37 bool TextDidChangeInTextField(const WebKit::WebInputElement& element); |
| 36 bool TextFieldHandlingKeyDown(const WebKit::WebInputElement& element, | 38 bool TextFieldHandlingKeyDown(const WebKit::WebInputElement& element, |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 WebKit::WebView* web_view_; | 119 WebKit::WebView* web_view_; |
| 118 | 120 |
| 119 base::WeakPtrFactory<PasswordAutofillAgent> weak_ptr_factory_; | 121 base::WeakPtrFactory<PasswordAutofillAgent> weak_ptr_factory_; |
| 120 | 122 |
| 121 DISALLOW_COPY_AND_ASSIGN(PasswordAutofillAgent); | 123 DISALLOW_COPY_AND_ASSIGN(PasswordAutofillAgent); |
| 122 }; | 124 }; |
| 123 | 125 |
| 124 } // namespace autofill | 126 } // namespace autofill |
| 125 | 127 |
| 126 #endif // COMPONENTS_AUTOFILL_RENDERER_PASSWORD_AUTOFILL_AGENT_H_ | 128 #endif // COMPONENTS_AUTOFILL_RENDERER_PASSWORD_AUTOFILL_AGENT_H_ |
| OLD | NEW |