OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2012 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 #ifndef CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_H_ |
| 7 |
| 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/string16.h" |
| 10 |
| 11 namespace content { |
| 12 class WebContents; |
| 13 } |
| 14 |
| 15 class AutofillDialogView; |
| 16 |
| 17 // This class drives the dialog that appears when a site uses the imperative |
| 18 // autocomplete API to fill out a form. |
| 19 class AutofillDialogController { |
| 20 public: |
| 21 enum Action { |
| 22 AUTOFILL_ACTION_ABORT, |
| 23 AUTOFILL_ACTION_SUBMIT, |
| 24 }; |
| 25 |
| 26 explicit AutofillDialogController(content::WebContents* contents); |
| 27 ~AutofillDialogController(); |
| 28 |
| 29 void Show(); |
| 30 |
| 31 // Called by the view. |
| 32 string16 DialogTitle() const; |
| 33 string16 CancelButtonText() const; |
| 34 string16 ConfirmButtonText() const; |
| 35 bool ConfirmButtonEnabled() const; |
| 36 |
| 37 // Called when the view has been closed. The value for |action| indicates |
| 38 // whether the Autofill operation should be aborted. |
| 39 void ViewClosed(Action action); |
| 40 |
| 41 content::WebContents* web_contents() { return contents_; } |
| 42 |
| 43 private: |
| 44 // The WebContents where the Autofill action originated. |
| 45 content::WebContents* const contents_; |
| 46 |
| 47 scoped_ptr<AutofillDialogView> view_; |
| 48 |
| 49 DISALLOW_COPY_AND_ASSIGN(AutofillDialogController); |
| 50 }; |
| 51 |
| 52 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_H_ |
OLD | NEW |