summaryrefslogtreecommitdiffstats
path: root/chrome/browser/autofill/autofill_infobar_delegate.h
diff options
context:
space:
mode:
authorjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-28 19:51:21 +0000
committerjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-28 19:51:21 +0000
commit21674df8085ee01ca91bbd4fe41ee1ea240a0cda (patch)
tree39462aa48bef10131eb36c22b38e9566336438f2 /chrome/browser/autofill/autofill_infobar_delegate.h
parent8b160034c47761a7cefd93019d0c45b9f7911be7 (diff)
downloadchromium_src-21674df8085ee01ca91bbd4fe41ee1ea240a0cda.zip
chromium_src-21674df8085ee01ca91bbd4fe41ee1ea240a0cda.tar.gz
chromium_src-21674df8085ee01ca91bbd4fe41ee1ea240a0cda.tar.bz2
Add initial implementation of AutoFill++. This implementation is hidden behind a switch, --enable-new-autofill. So far, we only pop up an infobar asking the user if he'd like to save the form information. I've added a rudimentary icon for the infobar, pulled from the mocks, so we'll probably want a blessed version of this icon at some point.
BUG=18201 TEST=none Review URL: http://codereview.chromium.org/339030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30378 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autofill/autofill_infobar_delegate.h')
-rw-r--r--chrome/browser/autofill/autofill_infobar_delegate.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/chrome/browser/autofill/autofill_infobar_delegate.h b/chrome/browser/autofill/autofill_infobar_delegate.h
new file mode 100644
index 0000000..1a6e267
--- /dev/null
+++ b/chrome/browser/autofill/autofill_infobar_delegate.h
@@ -0,0 +1,42 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_AUTOFILL_AUTOFILL_INFOBAR_DELEGATE_H_
+#define CHROME_BROWSER_AUTOFILL_AUTOFILL_INFOBAR_DELEGATE_H_
+
+#include <string>
+
+#include "chrome/browser/tab_contents/infobar_delegate.h"
+
+class AutoFillManager;
+class SkBitmap;
+class TabContents;
+
+// An InfoBar delegate that enables the user to allow or deny storing personal
+// information gathered from a form submission.
+class AutoFillInfoBarDelegate : public ConfirmInfoBarDelegate {
+ public:
+ AutoFillInfoBarDelegate(TabContents* tab_contents, AutoFillManager* host);
+ virtual ~AutoFillInfoBarDelegate();
+
+ // ConfirmInfoBarDelegate implementation.
+ virtual bool ShouldExpire(
+ const NavigationController::LoadCommittedDetails& details) const;
+ virtual void InfoBarClosed();
+ virtual std::wstring GetMessageText() const;
+ virtual SkBitmap* GetIcon() const;
+ virtual int GetButtons() const;
+ virtual std::wstring GetButtonLabel(
+ ConfirmInfoBarDelegate::InfoBarButton button) const;
+ virtual bool Accept();
+ virtual bool Cancel();
+
+ private:
+ // The autofill manager that initiated this infobar.
+ AutoFillManager* host_;
+
+ DISALLOW_COPY_AND_ASSIGN(AutoFillInfoBarDelegate);
+};
+
+#endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_INFOBAR_DELEGATE_H_