Chromium Code Reviews| 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..d8fb6aea9c6fd128c31dde03ea46ddd68dee74aa |
| --- /dev/null |
| +++ b/chrome/browser/ui/autofill/autofill_dialog_controller.h |
| @@ -0,0 +1,53 @@ |
| +// 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 AutofillDialogController; |
| + |
| +class AutofillDialogView { |
|
Ilya Sherman
2012/10/23 00:39:00
nit: Please include a comment describing this clas
Ilya Sherman
2012/10/23 00:39:00
nit: Please move this class into its own file.
Evan Stade
2012/10/23 01:52:04
oh yea, forgot class level comments. I'll add all
Evan Stade
2012/10/23 01:52:04
I don't believe it warrants its own file, but done
|
| + public: |
| + virtual ~AutofillDialogView; |
| + |
| + // Shows the dialog. |
| + virtual void Show() = 0; |
| + |
| + static AutofillDialogView* CreateDialog(AutofillDialogController* controller); |
|
Ilya Sherman
2012/10/23 00:39:00
nit: Please include a comment describing this func
Evan Stade
2012/10/23 01:52:04
Done.
|
| +}; |
| + |
| +class AutofillDialogController { |
|
Ilya Sherman
2012/10/23 00:39:00
nit: Please include a brief comment describing thi
Evan Stade
2012/10/23 01:52:04
Done.
|
| + public: |
| + explicit AutofillDialogController(content::WebContents* contents); |
| + ~AutofillDialogController() {} |
| + |
| + void Show(); |
| + |
| + // Called by the view. |
| + string16 DialogTitle(); |
| + string16 CancelButtonText(); |
| + string16 ConfirmButtonText(); |
| + bool ConfirmButtonEnabled(); |
|
Ilya Sherman
2012/10/23 00:39:00
nit: If these are only called by the view, why not
Ilya Sherman
2012/10/23 00:39:00
nit: These should all be const methods, and the st
Evan Stade
2012/10/23 01:52:04
changed to const methods, but the return values ca
Evan Stade
2012/10/23 01:52:04
the controller contains the logic and state for th
Ilya Sherman
2012/10/23 04:52:29
Sadly, const without a ref does have a meaning. W
Evan Stade
2012/10/23 18:48:04
Sorry, I'm not trying to be difficult, but...
if
|
| + |
| + // Called when the view has been closed. A false value for |accepted| |
| + // indicates that the autofill operation should be aborted. |
|
Ilya Sherman
2012/10/23 00:39:00
nit: "autofill" -> "Autofill", since this is refer
Evan Stade
2012/10/23 01:52:04
Done.
|
| + void ViewClosed(bool accepted); |
|
Ilya Sherman
2012/10/23 00:39:00
nit: This boolean's meaning will not be clear at t
Evan Stade
2012/10/23 01:52:04
Done.
|
| + |
| + content::WebContents* web_contents() { return contents_; } |
|
Ilya Sherman
2012/10/23 00:39:00
nit: Can this be constified?
Evan Stade
2012/10/23 01:52:04
Done.
|
| + |
| + private: |
| + // The WebContents that initiated the autofill action. |
|
Ilya Sherman
2012/10/23 00:39:00
nit: The user initiates an Autofill action, not th
Evan Stade
2012/10/23 01:52:04
well, it's initiated by a javascript call which is
Ilya Sherman
2012/10/23 04:52:29
Fair enough, but I still think that describing thi
Evan Stade
2012/10/23 18:48:04
I tried to improve the wording.
|
| + content::WebContents* contents_; |
|
Ilya Sherman
2012/10/23 00:39:00
nit: content::WebContents* const contents_;
Evan Stade
2012/10/23 01:52:04
Done.
|
| + |
| + scoped_ptr<AutofillDialogView> view_; |
| +}; |
| + |
| +#endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_H_ |