OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_UI_VIEWS_AUTOFILL_AUTOFILL_DIALOG_VIEWS_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_AUTOFILL_AUTOFILL_DIALOG_VIEWS_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_AUTOFILL_AUTOFILL_DIALOG_VIEWS_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_AUTOFILL_AUTOFILL_DIALOG_VIEWS_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "chrome/browser/ui/autofill/autofill_dialog_controller.h" | 10 #include "chrome/browser/ui/autofill/autofill_dialog_controller.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 explicit AutofillDialogViews(AutofillDialogController* controller); | 55 explicit AutofillDialogViews(AutofillDialogController* controller); |
56 virtual ~AutofillDialogViews(); | 56 virtual ~AutofillDialogViews(); |
57 | 57 |
58 // AutofillDialogView implementation: | 58 // AutofillDialogView implementation: |
59 virtual void Show() OVERRIDE; | 59 virtual void Show() OVERRIDE; |
60 virtual void UpdateNotificationArea() OVERRIDE; | 60 virtual void UpdateNotificationArea() OVERRIDE; |
61 virtual void UpdateSection(DialogSection section) OVERRIDE; | 61 virtual void UpdateSection(DialogSection section) OVERRIDE; |
62 virtual void GetUserInput(DialogSection section, | 62 virtual void GetUserInput(DialogSection section, |
63 DetailOutputMap* output) OVERRIDE; | 63 DetailOutputMap* output) OVERRIDE; |
64 virtual bool UseBillingForShipping() OVERRIDE; | 64 virtual bool UseBillingForShipping() OVERRIDE; |
| 65 virtual bool SaveDetailsLocally() OVERRIDE; |
65 virtual const content::NavigationController& ShowSignIn() OVERRIDE; | 66 virtual const content::NavigationController& ShowSignIn() OVERRIDE; |
66 virtual void HideSignIn() OVERRIDE; | 67 virtual void HideSignIn() OVERRIDE; |
67 | 68 |
68 // views::DialogDelegate implementation: | 69 // views::DialogDelegate implementation: |
69 virtual string16 GetWindowTitle() const OVERRIDE; | 70 virtual string16 GetWindowTitle() const OVERRIDE; |
70 virtual void WindowClosing() OVERRIDE; | 71 virtual void WindowClosing() OVERRIDE; |
71 virtual void DeleteDelegate() OVERRIDE; | 72 virtual void DeleteDelegate() OVERRIDE; |
72 virtual views::Widget* GetWidget() OVERRIDE; | 73 virtual views::Widget* GetWidget() OVERRIDE; |
73 virtual const views::Widget* GetWidget() const OVERRIDE; | 74 virtual const views::Widget* GetWidget() const OVERRIDE; |
74 virtual views::View* GetContentsView() OVERRIDE; | 75 virtual views::View* GetContentsView() OVERRIDE; |
75 virtual string16 GetDialogButtonLabel(ui::DialogButton button) const OVERRIDE; | 76 virtual string16 GetDialogButtonLabel(ui::DialogButton button) const OVERRIDE; |
76 virtual bool IsDialogButtonEnabled(ui::DialogButton button) const OVERRIDE; | 77 virtual bool IsDialogButtonEnabled(ui::DialogButton button) const OVERRIDE; |
| 78 virtual views::View* GetExtraView() OVERRIDE; |
77 virtual bool Cancel() OVERRIDE; | 79 virtual bool Cancel() OVERRIDE; |
78 virtual bool Accept() OVERRIDE; | 80 virtual bool Accept() OVERRIDE; |
79 | 81 |
80 // views::ButtonListener implementation: | 82 // views::ButtonListener implementation: |
81 virtual void ButtonPressed(views::Button* sender, | 83 virtual void ButtonPressed(views::Button* sender, |
82 const ui::Event& event) OVERRIDE; | 84 const ui::Event& event) OVERRIDE; |
83 | 85 |
84 // views::TextfieldController implementation: | 86 // views::TextfieldController implementation: |
85 virtual void ContentsChanged(views::Textfield* sender, | 87 virtual void ContentsChanged(views::Textfield* sender, |
86 const string16& new_contents) OVERRIDE; | 88 const string16& new_contents) OVERRIDE; |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 views::View* CreateInputsContainer(DialogSection section); | 234 views::View* CreateInputsContainer(DialogSection section); |
233 | 235 |
234 // Creates a grid of textfield views for the given section, and stores them | 236 // Creates a grid of textfield views for the given section, and stores them |
235 // in the appropriate DetailsGroup. The top level View in the hierarchy is | 237 // in the appropriate DetailsGroup. The top level View in the hierarchy is |
236 // returned. | 238 // returned. |
237 views::View* InitInputsView(DialogSection section); | 239 views::View* InitInputsView(DialogSection section); |
238 | 240 |
239 // Updates the visual state of the given group as per the model. | 241 // Updates the visual state of the given group as per the model. |
240 void UpdateDetailsGroupState(const DetailsGroup& group); | 242 void UpdateDetailsGroupState(const DetailsGroup& group); |
241 | 243 |
| 244 // Returns true if at least one of the details sections is in manual input |
| 245 // mode. |
| 246 bool AtLeastOneSectionIsEditing(); |
| 247 |
242 // Gets a pointer to the DetailsGroup that's associated with the given section | 248 // Gets a pointer to the DetailsGroup that's associated with the given section |
243 // of the dialog. | 249 // of the dialog. |
244 DetailsGroup* GroupForSection(DialogSection section); | 250 DetailsGroup* GroupForSection(DialogSection section); |
245 | 251 |
246 // Checks all manual inputs in the form for validity. Decorates the invalid | 252 // Checks all manual inputs in the form for validity. Decorates the invalid |
247 // ones and returns true if all were valid. | 253 // ones and returns true if all were valid. |
248 bool ValidateForm(); | 254 bool ValidateForm(); |
249 | 255 |
250 // When an input textfield is edited (its contents change) or activated | 256 // When an input textfield is edited (its contents change) or activated |
251 // (clicked while focused), this function will inform the controller that it's | 257 // (clicked while focused), this function will inform the controller that it's |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 // to the main flow. | 295 // to the main flow. |
290 views::TextButton* cancel_sign_in_; | 296 views::TextButton* cancel_sign_in_; |
291 | 297 |
292 // A WebView to that navigates to a Google sign-in page to allow the user to | 298 // A WebView to that navigates to a Google sign-in page to allow the user to |
293 // sign-in. | 299 // sign-in. |
294 views::WebView* sign_in_webview_; | 300 views::WebView* sign_in_webview_; |
295 | 301 |
296 // View to host everything that isn't related to sign-in. | 302 // View to host everything that isn't related to sign-in. |
297 views::View* main_container_; | 303 views::View* main_container_; |
298 | 304 |
| 305 // The "Extra view" is on the same row as the dialog buttons. |
| 306 views::View* button_strip_extra_view_; |
| 307 |
| 308 // This checkbox controls whether new details are saved to the Autofill |
| 309 // database. It lives in |extra_view_|. |
| 310 views::Checkbox* save_in_chrome_checkbox_; |
| 311 |
299 // The focus manager for |window_|. | 312 // The focus manager for |window_|. |
300 views::FocusManager* focus_manager_; | 313 views::FocusManager* focus_manager_; |
301 | 314 |
302 DISALLOW_COPY_AND_ASSIGN(AutofillDialogViews); | 315 DISALLOW_COPY_AND_ASSIGN(AutofillDialogViews); |
303 }; | 316 }; |
304 | 317 |
305 } // namespace autofill | 318 } // namespace autofill |
306 | 319 |
307 #endif // CHROME_BROWSER_UI_VIEWS_AUTOFILL_AUTOFILL_DIALOG_VIEWS_H_ | 320 #endif // CHROME_BROWSER_UI_VIEWS_AUTOFILL_AUTOFILL_DIALOG_VIEWS_H_ |
OLD | NEW |