OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/autofill/autofill_manager.h" |
| 6 |
| 7 #include "base/command_line.h" |
| 8 #include "chrome/browser/autofill/autofill_infobar_delegate.h" |
| 9 #include "chrome/browser/tab_contents/tab_contents.h" |
| 10 #include "chrome/common/chrome_switches.h" |
| 11 #include "webkit/glue/form_field_values.h" |
| 12 |
| 13 AutoFillManager::AutoFillManager(TabContents* tab_contents) |
| 14 : tab_contents_(tab_contents), |
| 15 infobar_(NULL) { |
| 16 } |
| 17 |
| 18 AutoFillManager::~AutoFillManager() { |
| 19 } |
| 20 |
| 21 void AutoFillManager::FormFieldValuesSubmitted( |
| 22 const webkit_glue::FormFieldValues& form) { |
| 23 // TODO(jhawkins): Remove this switch when AutoFill++ is fully implemented. |
| 24 if (!CommandLine::ForCurrentProcess()->HasSwitch( |
| 25 switches::kEnableNewAutoFill)) |
| 26 return; |
| 27 |
| 28 // Grab a copy of the form data. |
| 29 form_data_.reset(new webkit_glue::FormFieldValues(form)); |
| 30 |
| 31 // Ask the user for permission to save form information. |
| 32 infobar_.reset(new AutoFillInfoBarDelegate(tab_contents_, this)); |
| 33 } |
| 34 |
| 35 void AutoFillManager::SaveFormData() { |
| 36 // TODO(jhawkins): Save the form data to the web database. |
| 37 } |
| 38 |
| 39 void AutoFillManager::Reset() { |
| 40 form_data_.reset(); |
| 41 } |
OLD | NEW |