Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2512)

Unified Diff: chrome/browser/ui/autofill/autofill_dialog_controller.h

Issue 11231063: [views] "Hello, world" autofill imperative API dialog. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: another round of review Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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_

Powered by Google App Engine
This is Rietveld 408576698