OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "chrome/renderer/password_autocomplete_manager.h" | 5 #include "chrome/renderer/password_autocomplete_manager.h" |
6 | 6 |
7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
8 #include "base/scoped_ptr.h" | 8 #include "base/scoped_ptr.h" |
9 #include "chrome/common/render_messages.h" | 9 #include "chrome/common/autofill_messages.h" |
10 #include "chrome/renderer/render_view.h" | 10 #include "chrome/renderer/render_view.h" |
11 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" | 11 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" |
12 #include "third_party/WebKit/Source/WebKit/chromium/public/WebElement.h" | 12 #include "third_party/WebKit/Source/WebKit/chromium/public/WebElement.h" |
13 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFormElement.h" | 13 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFormElement.h" |
14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
15 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" | 15 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" |
16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h" | 16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h" |
17 #include "third_party/WebKit/Source/WebKit/chromium/public/WebVector.h" | 17 #include "third_party/WebKit/Source/WebKit/chromium/public/WebVector.h" |
18 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | 18 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
19 #include "ui/base/keycodes/keyboard_codes.h" | 19 #include "ui/base/keycodes/keyboard_codes.h" |
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 scoped_ptr<webkit_glue::PasswordForm> password_form( | 334 scoped_ptr<webkit_glue::PasswordForm> password_form( |
335 webkit_glue::PasswordFormDomManager::CreatePasswordForm(form)); | 335 webkit_glue::PasswordFormDomManager::CreatePasswordForm(form)); |
336 if (password_form.get()) | 336 if (password_form.get()) |
337 password_forms.push_back(*password_form); | 337 password_forms.push_back(*password_form); |
338 } | 338 } |
339 | 339 |
340 if (password_forms.empty()) | 340 if (password_forms.empty()) |
341 return; | 341 return; |
342 | 342 |
343 if (only_visible) { | 343 if (only_visible) { |
344 Send(new ViewHostMsg_PasswordFormsVisible(routing_id(), password_forms)); | 344 Send(new AutoFillHostMsg_PasswordFormsVisible( |
| 345 routing_id(), password_forms)); |
345 } else { | 346 } else { |
346 Send(new ViewHostMsg_PasswordFormsFound(routing_id(), password_forms)); | 347 Send(new AutoFillHostMsg_PasswordFormsFound(routing_id(), password_forms)); |
347 } | 348 } |
348 } | 349 } |
349 | 350 |
350 bool PasswordAutocompleteManager::OnMessageReceived( | 351 bool PasswordAutocompleteManager::OnMessageReceived( |
351 const IPC::Message& message) { | 352 const IPC::Message& message) { |
352 bool handled = true; | 353 bool handled = true; |
353 IPC_BEGIN_MESSAGE_MAP(PasswordAutocompleteManager, message) | 354 IPC_BEGIN_MESSAGE_MAP(PasswordAutocompleteManager, message) |
354 IPC_MESSAGE_HANDLER(ViewMsg_FillPasswordForm, OnFillPasswordForm) | 355 IPC_MESSAGE_HANDLER(AutoFillMsg_FillPasswordForm, OnFillPasswordForm) |
355 IPC_MESSAGE_UNHANDLED(handled = false) | 356 IPC_MESSAGE_UNHANDLED(handled = false) |
356 IPC_END_MESSAGE_MAP() | 357 IPC_END_MESSAGE_MAP() |
357 return handled; | 358 return handled; |
358 } | 359 } |
359 | 360 |
360 void PasswordAutocompleteManager::DidFinishDocumentLoad( | 361 void PasswordAutocompleteManager::DidFinishDocumentLoad( |
361 WebKit::WebFrame* frame) { | 362 WebKit::WebFrame* frame) { |
362 SendPasswordForms(frame, false); | 363 SendPasswordForms(frame, false); |
363 } | 364 } |
364 | 365 |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
532 | 533 |
533 void PasswordAutocompleteManager::FrameClosing(const WebKit::WebFrame* frame) { | 534 void PasswordAutocompleteManager::FrameClosing(const WebKit::WebFrame* frame) { |
534 for (LoginToPasswordInfoMap::iterator iter = login_to_password_info_.begin(); | 535 for (LoginToPasswordInfoMap::iterator iter = login_to_password_info_.begin(); |
535 iter != login_to_password_info_.end();) { | 536 iter != login_to_password_info_.end();) { |
536 if (iter->first.document().frame() == frame) | 537 if (iter->first.document().frame() == frame) |
537 login_to_password_info_.erase(iter++); | 538 login_to_password_info_.erase(iter++); |
538 else | 539 else |
539 ++iter; | 540 ++iter; |
540 } | 541 } |
541 } | 542 } |
OLD | NEW |