Index: chrome/browser/ui/autofill/autofill_dialog_controller.h |
diff --git a/chrome/browser/ui/autofill/autofill_dialog_controller.h b/chrome/browser/ui/autofill/autofill_dialog_controller.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..7c59d5d17bd687f558c0c60323c3766ec29b3f67 |
--- /dev/null |
+++ b/chrome/browser/ui/autofill/autofill_dialog_controller.h |
@@ -0,0 +1,50 @@ |
+// Copyright (c) 2012 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_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_H_ |
+#define CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_H_ |
+ |
+#include "base/memory/scoped_ptr.h" |
+#include "base/string16.h" |
+ |
+namespace content { |
+class WebContents; |
+} |
+ |
+class AutofillDialogView; |
+ |
+// This class drives the dialog that appears when a site uses the imperative |
+// autocomplete API to fill out a form. |
+class AutofillDialogController { |
+ public: |
+ enum Action { |
+ AUTOFILL_ACTION_ABORT, |
+ AUTOFILL_ACTION_SUBMIT, |
+ }; |
+ |
+ explicit AutofillDialogController(content::WebContents* contents); |
+ ~AutofillDialogController(); |
+ |
+ void Show(); |
+ |
+ // Called by the view. |
+ string16 DialogTitle() const; |
+ string16 CancelButtonText() const; |
+ string16 ConfirmButtonText() const; |
+ bool ConfirmButtonEnabled() const; |
+ |
+ // Called when the view has been closed. The value for |action| indicates |
+ // whether the Autofill operation should be aborted. |
+ void ViewClosed(Action action); |
+ |
+ content::WebContents* web_contents() const { return contents_; } |
sky
2012/10/23 19:53:54
const content::WebContents* web_contents() const o
Evan Stade
2012/10/23 20:58:58
Done.
|
+ |
+ private: |
+ // The WebContents where the Autofill action originated. |
+ content::WebContents* const contents_; |
+ |
+ scoped_ptr<AutofillDialogView> view_; |
+}; |
+ |
+#endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_H_ |