Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(221)

Side by Side Diff: chrome/browser/ui/views/autofill/autofill_dialog_views.h

Issue 13625002: Change the behavior of the [X] Save details to Wallet checkbox notification to: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 virtual void Show() OVERRIDE; 71 virtual void Show() OVERRIDE;
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) OVERRIDE; 76 virtual void UpdateSection(DialogSection section) OVERRIDE;
77 virtual void GetUserInput(DialogSection section, 77 virtual void GetUserInput(DialogSection section,
78 DetailOutputMap* output) OVERRIDE; 78 DetailOutputMap* output) OVERRIDE;
79 virtual string16 GetCvc() OVERRIDE; 79 virtual string16 GetCvc() OVERRIDE;
80 virtual bool UseBillingForShipping() OVERRIDE; 80 virtual bool UseBillingForShipping() OVERRIDE;
81 virtual bool SaveDetailsInWallet() OVERRIDE;
82 virtual bool SaveDetailsLocally() OVERRIDE; 81 virtual bool SaveDetailsLocally() OVERRIDE;
83 virtual const content::NavigationController* ShowSignIn() OVERRIDE; 82 virtual const content::NavigationController* ShowSignIn() OVERRIDE;
84 virtual void HideSignIn() OVERRIDE; 83 virtual void HideSignIn() OVERRIDE;
85 virtual void UpdateProgressBar(double value) OVERRIDE; 84 virtual void UpdateProgressBar(double value) OVERRIDE;
86 virtual void ModelChanged() OVERRIDE; 85 virtual void ModelChanged() OVERRIDE;
87 virtual void SubmitForTesting() OVERRIDE; 86 virtual void SubmitForTesting() OVERRIDE;
88 virtual void CancelForTesting() OVERRIDE; 87 virtual void CancelForTesting() OVERRIDE;
89 88
90 // views::DialogDelegate implementation: 89 // views::DialogDelegate implementation:
91 virtual string16 GetWindowTitle() const OVERRIDE; 90 virtual string16 GetWindowTitle() const OVERRIDE;
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 // The controller |this| queries for logic and state. 199 // The controller |this| queries for logic and state.
201 AutofillDialogController* controller_; 200 AutofillDialogController* controller_;
202 201
203 // Runs the suggestion menu (triggered by each section's |suggested_button|. 202 // Runs the suggestion menu (triggered by each section's |suggested_button|.
204 scoped_ptr<views::MenuRunner> menu_runner_; 203 scoped_ptr<views::MenuRunner> menu_runner_;
205 204
206 DISALLOW_COPY_AND_ASSIGN(AccountChooser); 205 DISALLOW_COPY_AND_ASSIGN(AccountChooser);
207 }; 206 };
208 207
209 // An area for notifications. Some notifications point at the account chooser. 208 // An area for notifications. Some notifications point at the account chooser.
210 class NotificationArea : public views::View { 209 class NotificationArea : public views::View,
210 public views::ButtonListener {
211 public: 211 public:
212 NotificationArea(); 212 explicit NotificationArea(AutofillDialogController* controller);
213 virtual ~NotificationArea(); 213 virtual ~NotificationArea();
214 214
215 // Displays the given notifications.
216 void SetNotifications(const std::vector<DialogNotification>& notifications);
217
218 // views::View implementation.
219 virtual std::string GetClassName() const OVERRIDE;
220 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
221
222 // views::ButtonListener implementation:
223 virtual void ButtonPressed(views::Button* sender,
224 const ui::Event& event) OVERRIDE;
225
215 void set_arrow_centering_anchor( 226 void set_arrow_centering_anchor(
216 const base::WeakPtr<views::View>& arrow_centering_anchor) { 227 const base::WeakPtr<views::View>& arrow_centering_anchor) {
217 arrow_centering_anchor_ = arrow_centering_anchor; 228 arrow_centering_anchor_ = arrow_centering_anchor;
218 } 229 }
219 230
220 // Displays the given notifications.
221 void SetNotifications(const std::vector<DialogNotification>& notifications);
222
223 // Returns true if the checkbox exists and is checked. Currently, the
224 // notification area only supports showing a checkbox on the topmost
225 // notification.
226 bool CheckboxIsChecked() const;
227
228 // views::View implementation.
229 virtual std::string GetClassName() const OVERRIDE;
230 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
231
232 private: 231 private:
233 // Utility function for determining whether an arrow should be drawn 232 // Utility function for determining whether an arrow should be drawn
234 // pointing at |arrow_centering_anchor_|. 233 // pointing at |arrow_centering_anchor_|.
235 bool HasArrow(); 234 bool HasArrow();
236 235
236 // A reference to the controller than owns this view. Used to report when
237 // checkboxes change their values.
238 AutofillDialogController* controller_; // weak
239
237 // The currently showing checkbox, or NULL if none exists. 240 // The currently showing checkbox, or NULL if none exists.
238 views::Checkbox* checkbox_; // weak 241 views::Checkbox* checkbox_; // weak
239 242
240 // If HasArrow() is true, the arrow should point at this. 243 // If HasArrow() is true, the arrow should point at this.
241 base::WeakPtr<views::View> arrow_centering_anchor_; 244 base::WeakPtr<views::View> arrow_centering_anchor_;
242 245
243 std::vector<DialogNotification> notifications_; 246 std::vector<DialogNotification> notifications_;
244 247
245 DISALLOW_COPY_AND_ASSIGN(NotificationArea); 248 DISALLOW_COPY_AND_ASSIGN(NotificationArea);
246 }; 249 };
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
490 493
491 // The focus manager for |window_|. 494 // The focus manager for |window_|.
492 views::FocusManager* focus_manager_; 495 views::FocusManager* focus_manager_;
493 496
494 DISALLOW_COPY_AND_ASSIGN(AutofillDialogViews); 497 DISALLOW_COPY_AND_ASSIGN(AutofillDialogViews);
495 }; 498 };
496 499
497 } // namespace autofill 500 } // namespace autofill
498 501
499 #endif // CHROME_BROWSER_UI_VIEWS_AUTOFILL_AUTOFILL_DIALOG_VIEWS_H_ 502 #endif // CHROME_BROWSER_UI_VIEWS_AUTOFILL_AUTOFILL_DIALOG_VIEWS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698