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 "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 virtual void Hide() OVERRIDE; | 72 virtual void Hide() OVERRIDE; |
73 virtual void UpdateAccountChooser() OVERRIDE; | 73 virtual void UpdateAccountChooser() OVERRIDE; |
74 virtual void UpdateButtonStrip() OVERRIDE; | 74 virtual void UpdateButtonStrip() OVERRIDE; |
75 virtual void UpdateNotificationArea() OVERRIDE; | 75 virtual void UpdateNotificationArea() OVERRIDE; |
76 virtual void UpdateSection(DialogSection section, | 76 virtual void UpdateSection(DialogSection section, |
77 UserInputAction action) OVERRIDE; | 77 UserInputAction action) OVERRIDE; |
78 virtual void GetUserInput(DialogSection section, | 78 virtual void GetUserInput(DialogSection section, |
79 DetailOutputMap* output) OVERRIDE; | 79 DetailOutputMap* output) OVERRIDE; |
80 virtual string16 GetCvc() OVERRIDE; | 80 virtual string16 GetCvc() OVERRIDE; |
81 virtual bool UseBillingForShipping() OVERRIDE; | 81 virtual bool UseBillingForShipping() OVERRIDE; |
82 virtual bool SaveDetailsInWallet() OVERRIDE; | |
83 virtual bool SaveDetailsLocally() OVERRIDE; | 82 virtual bool SaveDetailsLocally() OVERRIDE; |
84 virtual const content::NavigationController* ShowSignIn() OVERRIDE; | 83 virtual const content::NavigationController* ShowSignIn() OVERRIDE; |
85 virtual void HideSignIn() OVERRIDE; | 84 virtual void HideSignIn() OVERRIDE; |
86 virtual void UpdateProgressBar(double value) OVERRIDE; | 85 virtual void UpdateProgressBar(double value) OVERRIDE; |
87 virtual void ModelChanged() OVERRIDE; | 86 virtual void ModelChanged() OVERRIDE; |
88 virtual void SubmitForTesting() OVERRIDE; | 87 virtual void SubmitForTesting() OVERRIDE; |
89 virtual void CancelForTesting() OVERRIDE; | 88 virtual void CancelForTesting() OVERRIDE; |
90 | 89 |
91 // views::DialogDelegate implementation: | 90 // views::DialogDelegate implementation: |
92 virtual string16 GetWindowTitle() const OVERRIDE; | 91 virtual string16 GetWindowTitle() const OVERRIDE; |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 // The controller |this| queries for logic and state. | 200 // The controller |this| queries for logic and state. |
202 AutofillDialogController* controller_; | 201 AutofillDialogController* controller_; |
203 | 202 |
204 // Runs the suggestion menu (triggered by each section's |suggested_button|. | 203 // Runs the suggestion menu (triggered by each section's |suggested_button|. |
205 scoped_ptr<views::MenuRunner> menu_runner_; | 204 scoped_ptr<views::MenuRunner> menu_runner_; |
206 | 205 |
207 DISALLOW_COPY_AND_ASSIGN(AccountChooser); | 206 DISALLOW_COPY_AND_ASSIGN(AccountChooser); |
208 }; | 207 }; |
209 | 208 |
210 // An area for notifications. Some notifications point at the account chooser. | 209 // An area for notifications. Some notifications point at the account chooser. |
211 class NotificationArea : public views::View { | 210 class NotificationArea : public views::View, |
| 211 public views::ButtonListener { |
212 public: | 212 public: |
213 NotificationArea(); | 213 explicit NotificationArea(AutofillDialogController* controller); |
214 virtual ~NotificationArea(); | 214 virtual ~NotificationArea(); |
215 | 215 |
| 216 // Displays the given notifications. |
| 217 void SetNotifications(const std::vector<DialogNotification>& notifications); |
| 218 |
| 219 // views::View implementation. |
| 220 virtual std::string GetClassName() const OVERRIDE; |
| 221 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; |
| 222 |
| 223 // views::ButtonListener implementation: |
| 224 virtual void ButtonPressed(views::Button* sender, |
| 225 const ui::Event& event) OVERRIDE; |
| 226 |
216 void set_arrow_centering_anchor( | 227 void set_arrow_centering_anchor( |
217 const base::WeakPtr<views::View>& arrow_centering_anchor) { | 228 const base::WeakPtr<views::View>& arrow_centering_anchor) { |
218 arrow_centering_anchor_ = arrow_centering_anchor; | 229 arrow_centering_anchor_ = arrow_centering_anchor; |
219 } | 230 } |
220 | 231 |
221 // Displays the given notifications. | |
222 void SetNotifications(const std::vector<DialogNotification>& notifications); | |
223 | |
224 // Returns true if the checkbox exists and is checked. Currently, the | |
225 // notification area only supports showing a checkbox on the topmost | |
226 // notification. | |
227 bool CheckboxIsChecked() const; | |
228 | |
229 // views::View implementation. | |
230 virtual std::string GetClassName() const OVERRIDE; | |
231 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; | |
232 | |
233 private: | 232 private: |
234 // Utility function for determining whether an arrow should be drawn | 233 // Utility function for determining whether an arrow should be drawn |
235 // pointing at |arrow_centering_anchor_|. | 234 // pointing at |arrow_centering_anchor_|. |
236 bool HasArrow(); | 235 bool HasArrow(); |
237 | 236 |
| 237 // A reference to the controller than owns this view. Used to report when |
| 238 // checkboxes change their values. |
| 239 AutofillDialogController* controller_; // weak |
| 240 |
238 // The currently showing checkbox, or NULL if none exists. | 241 // The currently showing checkbox, or NULL if none exists. |
239 views::Checkbox* checkbox_; // weak | 242 views::Checkbox* checkbox_; // weak |
240 | 243 |
241 // If HasArrow() is true, the arrow should point at this. | 244 // If HasArrow() is true, the arrow should point at this. |
242 base::WeakPtr<views::View> arrow_centering_anchor_; | 245 base::WeakPtr<views::View> arrow_centering_anchor_; |
243 | 246 |
244 std::vector<DialogNotification> notifications_; | 247 std::vector<DialogNotification> notifications_; |
245 | 248 |
246 DISALLOW_COPY_AND_ASSIGN(NotificationArea); | 249 DISALLOW_COPY_AND_ASSIGN(NotificationArea); |
247 }; | 250 }; |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
491 | 494 |
492 // The focus manager for |window_|. | 495 // The focus manager for |window_|. |
493 views::FocusManager* focus_manager_; | 496 views::FocusManager* focus_manager_; |
494 | 497 |
495 DISALLOW_COPY_AND_ASSIGN(AutofillDialogViews); | 498 DISALLOW_COPY_AND_ASSIGN(AutofillDialogViews); |
496 }; | 499 }; |
497 | 500 |
498 } // namespace autofill | 501 } // namespace autofill |
499 | 502 |
500 #endif // CHROME_BROWSER_UI_VIEWS_AUTOFILL_AUTOFILL_DIALOG_VIEWS_H_ | 503 #endif // CHROME_BROWSER_UI_VIEWS_AUTOFILL_AUTOFILL_DIALOG_VIEWS_H_ |
OLD | NEW |