Chromium Code Reviews| 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 COMPONENTS_AUTOFILL_CONTENT_RENDERER_PASSWORD_AUTOFILL_AGENT_H_ | 5 #ifndef COMPONENTS_AUTOFILL_CONTENT_RENDERER_PASSWORD_AUTOFILL_AGENT_H_ |
| 6 #define COMPONENTS_AUTOFILL_CONTENT_RENDERER_PASSWORD_AUTOFILL_AGENT_H_ | 6 #define COMPONENTS_AUTOFILL_CONTENT_RENDERER_PASSWORD_AUTOFILL_AGENT_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 65 | 65 |
| 66 // Called when the user first interacts with the page after a load. This is a | 66 // Called when the user first interacts with the page after a load. This is a |
| 67 // signal to make autofilled values of password input elements accessible to | 67 // signal to make autofilled values of password input elements accessible to |
| 68 // JavaScript. | 68 // JavaScript. |
| 69 void FirstUserGestureObserved(); | 69 void FirstUserGestureObserved(); |
| 70 | 70 |
| 71 protected: | 71 protected: |
| 72 virtual bool OriginCanAccessPasswordManager( | 72 virtual bool OriginCanAccessPasswordManager( |
| 73 const blink::WebSecurityOrigin& origin); | 73 const blink::WebSecurityOrigin& origin); |
| 74 | 74 |
| 75 // Scans the given frame for password forms and sends them up to the browser. | |
| 76 // If |only_visible| is true, only forms visible in the layout are sent. | |
| 77 virtual void SendPasswordForms(blink::WebFrame* frame, bool only_visible); | |
| 78 | |
| 79 // RenderViewObserver: | |
| 80 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | |
|
vabr (Chromium)
2014/09/15 14:26:59
Why do you need to expose these two? They are alre
Pritam Nikam
2014/09/16 07:54:20
Ditto. (From previous comment)
| |
| 81 virtual void WillSubmitForm(blink::WebLocalFrame* frame, | |
| 82 const blink::WebFormElement& form) OVERRIDE; | |
| 83 | |
| 75 private: | 84 private: |
| 76 friend class PasswordAutofillAgentTest; | |
| 77 | |
| 78 enum OtherPossibleUsernamesUsage { | 85 enum OtherPossibleUsernamesUsage { |
| 79 NOTHING_TO_AUTOFILL, | 86 NOTHING_TO_AUTOFILL, |
| 80 OTHER_POSSIBLE_USERNAMES_ABSENT, | 87 OTHER_POSSIBLE_USERNAMES_ABSENT, |
| 81 OTHER_POSSIBLE_USERNAMES_PRESENT, | 88 OTHER_POSSIBLE_USERNAMES_PRESENT, |
| 82 OTHER_POSSIBLE_USERNAME_SHOWN, | 89 OTHER_POSSIBLE_USERNAME_SHOWN, |
| 83 OTHER_POSSIBLE_USERNAME_SELECTED, | 90 OTHER_POSSIBLE_USERNAME_SELECTED, |
| 84 OTHER_POSSIBLE_USERNAMES_MAX | 91 OTHER_POSSIBLE_USERNAMES_MAX |
| 85 }; | 92 }; |
| 86 | 93 |
| 87 // Ways to restrict which passwords are saved in ProvisionallySavePassword. | 94 // Ways to restrict which passwords are saved in ProvisionallySavePassword. |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 127 // Make the value of |element| accessible to JavaScript code. | 134 // Make the value of |element| accessible to JavaScript code. |
| 128 void ShowValue(blink::WebInputElement* element); | 135 void ShowValue(blink::WebInputElement* element); |
| 129 | 136 |
| 130 bool was_user_gesture_seen_; | 137 bool was_user_gesture_seen_; |
| 131 std::vector<blink::WebInputElement> elements_; | 138 std::vector<blink::WebInputElement> elements_; |
| 132 | 139 |
| 133 DISALLOW_COPY_AND_ASSIGN(PasswordValueGatekeeper); | 140 DISALLOW_COPY_AND_ASSIGN(PasswordValueGatekeeper); |
| 134 }; | 141 }; |
| 135 | 142 |
| 136 // RenderViewObserver: | 143 // RenderViewObserver: |
| 137 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | |
| 138 virtual void DidStartProvisionalLoad(blink::WebLocalFrame* frame) OVERRIDE; | 144 virtual void DidStartProvisionalLoad(blink::WebLocalFrame* frame) OVERRIDE; |
| 139 virtual void DidStartLoading() OVERRIDE; | 145 virtual void DidStartLoading() OVERRIDE; |
| 140 virtual void DidFinishDocumentLoad(blink::WebLocalFrame* frame) OVERRIDE; | 146 virtual void DidFinishDocumentLoad(blink::WebLocalFrame* frame) OVERRIDE; |
| 141 virtual void DidFinishLoad(blink::WebLocalFrame* frame) OVERRIDE; | 147 virtual void DidFinishLoad(blink::WebLocalFrame* frame) OVERRIDE; |
| 142 virtual void DidStopLoading() OVERRIDE; | 148 virtual void DidStopLoading() OVERRIDE; |
| 143 virtual void FrameDetached(blink::WebFrame* frame) OVERRIDE; | 149 virtual void FrameDetached(blink::WebFrame* frame) OVERRIDE; |
| 144 virtual void FrameWillClose(blink::WebFrame* frame) OVERRIDE; | 150 virtual void FrameWillClose(blink::WebFrame* frame) OVERRIDE; |
| 145 virtual void WillSendSubmitEvent(blink::WebLocalFrame* frame, | 151 virtual void WillSendSubmitEvent(blink::WebLocalFrame* frame, |
| 146 const blink::WebFormElement& form) OVERRIDE; | 152 const blink::WebFormElement& form) OVERRIDE; |
| 147 virtual void WillSubmitForm(blink::WebLocalFrame* frame, | |
| 148 const blink::WebFormElement& form) OVERRIDE; | |
| 149 | 153 |
| 150 // RenderView IPC handlers: | 154 // RenderView IPC handlers: |
| 151 void OnFillPasswordForm(const PasswordFormFillData& form_data); | 155 void OnFillPasswordForm(const PasswordFormFillData& form_data); |
| 152 void OnSetLoggingState(bool active); | 156 void OnSetLoggingState(bool active); |
| 153 | 157 |
| 154 // Scans the given frame for password forms and sends them up to the browser. | |
| 155 // If |only_visible| is true, only forms visible in the layout are sent. | |
| 156 void SendPasswordForms(blink::WebFrame* frame, bool only_visible); | |
| 157 | |
| 158 void GetSuggestions(const PasswordFormFillData& fill_data, | 158 void GetSuggestions(const PasswordFormFillData& fill_data, |
| 159 const base::string16& input, | 159 const base::string16& input, |
| 160 std::vector<base::string16>* suggestions, | 160 std::vector<base::string16>* suggestions, |
| 161 std::vector<base::string16>* realms, | 161 std::vector<base::string16>* realms, |
| 162 bool show_all); | 162 bool show_all); |
| 163 | 163 |
| 164 bool ShowSuggestionPopup(const PasswordFormFillData& fill_data, | 164 bool ShowSuggestionPopup(const PasswordFormFillData& fill_data, |
| 165 const blink::WebInputElement& user_input, | 165 const blink::WebInputElement& user_input, |
| 166 bool show_all); | 166 bool show_all); |
| 167 | 167 |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 245 bool did_stop_loading_; | 245 bool did_stop_loading_; |
| 246 | 246 |
| 247 base::WeakPtrFactory<PasswordAutofillAgent> weak_ptr_factory_; | 247 base::WeakPtrFactory<PasswordAutofillAgent> weak_ptr_factory_; |
| 248 | 248 |
| 249 DISALLOW_COPY_AND_ASSIGN(PasswordAutofillAgent); | 249 DISALLOW_COPY_AND_ASSIGN(PasswordAutofillAgent); |
| 250 }; | 250 }; |
| 251 | 251 |
| 252 } // namespace autofill | 252 } // namespace autofill |
| 253 | 253 |
| 254 #endif // COMPONENTS_AUTOFILL_CONTENT_RENDERER_PASSWORD_AUTOFILL_AGENT_H_ | 254 #endif // COMPONENTS_AUTOFILL_CONTENT_RENDERER_PASSWORD_AUTOFILL_AGENT_H_ |
| OLD | NEW |