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" |
11 #include "chrome/browser/ui/autofill/autofill_dialog_view.h" | 11 #include "chrome/browser/ui/autofill/autofill_dialog_view.h" |
12 #include "ui/views/controls/button/button.h" | 12 #include "ui/views/controls/button/button.h" |
13 #include "ui/views/controls/button/menu_button_listener.h" | 13 #include "ui/views/controls/button/menu_button_listener.h" |
| 14 #include "ui/views/controls/link.h" |
14 #include "ui/views/controls/link_listener.h" | 15 #include "ui/views/controls/link_listener.h" |
15 #include "ui/views/controls/progress_bar.h" | 16 #include "ui/views/controls/progress_bar.h" |
16 #include "ui/views/controls/textfield/textfield_controller.h" | 17 #include "ui/views/controls/textfield/textfield_controller.h" |
17 #include "ui/views/focus/focus_manager.h" | 18 #include "ui/views/focus/focus_manager.h" |
18 #include "ui/views/window/dialog_delegate.h" | 19 #include "ui/views/window/dialog_delegate.h" |
19 | 20 |
20 class ConstrainedWindowViews; | 21 class ConstrainedWindowViews; |
21 | 22 |
22 namespace content { | 23 namespace content { |
23 class KeyboardListener; | 24 class KeyboardListener; |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 virtual void PaintChildren(gfx::Canvas* canvas) OVERRIDE; | 132 virtual void PaintChildren(gfx::Canvas* canvas) OVERRIDE; |
132 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; | 133 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; |
133 | 134 |
134 private: | 135 private: |
135 views::Textfield* textfield_; | 136 views::Textfield* textfield_; |
136 bool invalid_; | 137 bool invalid_; |
137 | 138 |
138 DISALLOW_COPY_AND_ASSIGN(DecoratedTextfield); | 139 DISALLOW_COPY_AND_ASSIGN(DecoratedTextfield); |
139 }; | 140 }; |
140 | 141 |
141 // An area for notifications. Some types of notifications point at stuff. | 142 // An area to choose which account to use to make a transaction. If wallet is |
| 143 // available, choices include "Sign in to a different wallet account...", the |
| 144 // current Wallet account (if signed in), or a "Pay without Wallet" option. If |
| 145 // wallet is unavailable, only "Pay without Wallet" will be available. |
| 146 class AccountChooserLink : public views::Link { |
| 147 public: |
| 148 AccountChooserLink(); |
| 149 virtual ~AccountChooserLink(); |
| 150 |
| 151 // Get the width of only the text (not the whole view). This is required |
| 152 // as views::Link::GetTextSize() is protected. |
| 153 size_t GetTextWidth() const; |
| 154 |
| 155 private: |
| 156 DISALLOW_COPY_AND_ASSIGN(AccountChooserLink); |
| 157 }; |
| 158 |
| 159 // An area for notifications. Some notifications point at the account chooser. |
142 class NotificationArea : public views::View { | 160 class NotificationArea : public views::View { |
143 public: | 161 public: |
144 NotificationArea(); | 162 explicit NotificationArea(AccountChooserLink* point_at); |
145 virtual ~NotificationArea(); | 163 virtual ~NotificationArea(); |
146 | 164 |
147 void SetNotification(const DialogNotification& notification); | 165 void SetNotification(const DialogNotification& notification); |
148 | 166 |
149 // views::View implementation. | 167 // views::View implementation. |
150 virtual std::string GetClassName() const OVERRIDE; | 168 virtual std::string GetClassName() const OVERRIDE; |
151 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; | 169 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; |
152 | 170 |
153 private: | 171 private: |
154 views::Label* label_; | 172 views::Label* label_; |
| 173 AccountChooserLink* point_at_; |
155 DialogNotification notification_; | 174 DialogNotification notification_; |
156 | 175 |
157 DISALLOW_COPY_AND_ASSIGN(NotificationArea); | 176 DISALLOW_COPY_AND_ASSIGN(NotificationArea); |
158 }; | 177 }; |
159 | 178 |
160 typedef std::map<const DetailInput*, DecoratedTextfield*> TextfieldMap; | 179 typedef std::map<const DetailInput*, DecoratedTextfield*> TextfieldMap; |
161 typedef std::map<const DetailInput*, views::Combobox*> ComboboxMap; | 180 typedef std::map<const DetailInput*, views::Combobox*> ComboboxMap; |
162 | 181 |
163 // A view that packs a label on the left and some related controls | 182 // A view that packs a label on the left and some related controls |
164 // on the right. | 183 // on the right. |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 // Somewhere to show notification messages about errors, warnings, or promos. | 342 // Somewhere to show notification messages about errors, warnings, or promos. |
324 NotificationArea* notification_area_; | 343 NotificationArea* notification_area_; |
325 | 344 |
326 // The checkbox that controls whether to use the billing details for shipping | 345 // The checkbox that controls whether to use the billing details for shipping |
327 // as well. | 346 // as well. |
328 views::Checkbox* use_billing_for_shipping_; | 347 views::Checkbox* use_billing_for_shipping_; |
329 | 348 |
330 // Runs the suggestion menu (triggered by each section's |suggested_button|. | 349 // Runs the suggestion menu (triggered by each section's |suggested_button|. |
331 scoped_ptr<views::MenuRunner> menu_runner_; | 350 scoped_ptr<views::MenuRunner> menu_runner_; |
332 | 351 |
333 // The link that initiates the sign in flow. | 352 // A link to allow choosing different accounts to pay with. |
334 views::Link* sign_in_link_; | 353 AccountChooserLink* account_chooser_link_; |
335 | 354 |
336 // View to host the signin dialog and related controls. | 355 // View to host the signin dialog and related controls. |
337 views::View* sign_in_container_; | 356 views::View* sign_in_container_; |
338 | 357 |
339 // TextButton displayed during sign-in. Clicking cancels sign-in and returns | 358 // TextButton displayed during sign-in. Clicking cancels sign-in and returns |
340 // to the main flow. | 359 // to the main flow. |
341 views::TextButton* cancel_sign_in_; | 360 views::TextButton* cancel_sign_in_; |
342 | 361 |
343 // A WebView to that navigates to a Google sign-in page to allow the user to | 362 // A WebView to that navigates to a Google sign-in page to allow the user to |
344 // sign-in. | 363 // sign-in. |
(...skipping 17 matching lines...) Expand all Loading... |
362 | 381 |
363 // The focus manager for |window_|. | 382 // The focus manager for |window_|. |
364 views::FocusManager* focus_manager_; | 383 views::FocusManager* focus_manager_; |
365 | 384 |
366 DISALLOW_COPY_AND_ASSIGN(AutofillDialogViews); | 385 DISALLOW_COPY_AND_ASSIGN(AutofillDialogViews); |
367 }; | 386 }; |
368 | 387 |
369 } // namespace autofill | 388 } // namespace autofill |
370 | 389 |
371 #endif // CHROME_BROWSER_UI_VIEWS_AUTOFILL_AUTOFILL_DIALOG_VIEWS_H_ | 390 #endif // CHROME_BROWSER_UI_VIEWS_AUTOFILL_AUTOFILL_DIALOG_VIEWS_H_ |
OLD | NEW |