| 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 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 }; | 274 }; |
| 275 | 275 |
| 276 // A view that contains a suggestion (such as a known address) and a link to | 276 // A view that contains a suggestion (such as a known address) and a link to |
| 277 // edit the suggestion. | 277 // edit the suggestion. |
| 278 class SuggestionView : public views::View { | 278 class SuggestionView : public views::View { |
| 279 public: | 279 public: |
| 280 SuggestionView(const string16& edit_label, | 280 SuggestionView(const string16& edit_label, |
| 281 AutofillDialogViews* autofill_dialog); | 281 AutofillDialogViews* autofill_dialog); |
| 282 virtual ~SuggestionView(); | 282 virtual ~SuggestionView(); |
| 283 | 283 |
| 284 // Whether this section is editable or not. |
| 285 void SetEditable(bool editable); |
| 286 |
| 284 // Sets the display text of the suggestion. | 287 // Sets the display text of the suggestion. |
| 285 void SetSuggestionText(const string16& text); | 288 void SetSuggestionText(const string16& text); |
| 286 | 289 |
| 287 // Sets the icon which should be displayed ahead of the text. | 290 // Sets the icon which should be displayed ahead of the text. |
| 288 void SetSuggestionIcon(const gfx::Image& image); | 291 void SetSuggestionIcon(const gfx::Image& image); |
| 289 | 292 |
| 290 // Shows an auxiliary textfield to the right of the suggestion icon and | 293 // Shows an auxiliary textfield to the right of the suggestion icon and |
| 291 // text. This is currently only used to show a CVC field for the CC section. | 294 // text. This is currently only used to show a CVC field for the CC section. |
| 292 void ShowTextfield(const string16& placeholder_text, | 295 void ShowTextfield(const string16& placeholder_text, |
| 293 const gfx::ImageSkia& icon); | 296 const gfx::ImageSkia& icon); |
| 294 | 297 |
| 295 DecoratedTextfield* decorated_textfield() { return decorated_; } | 298 DecoratedTextfield* decorated_textfield() { return decorated_; } |
| 296 | 299 |
| 297 private: | 300 private: |
| 298 // The label that holds the suggestion description text. | 301 // The label that holds the suggestion description text. |
| 299 views::Label* label_; | 302 views::Label* label_; |
| 300 // The second (and greater) line of text that describes the suggestion. | 303 // The second (and greater) line of text that describes the suggestion. |
| 301 views::Label* label_line_2_; | 304 views::Label* label_line_2_; |
| 302 // The icon that comes just before |label_|. | 305 // The icon that comes just before |label_|. |
| 303 views::ImageView* icon_; | 306 views::ImageView* icon_; |
| 304 // A view to contain |label_| and |icon_|. | 307 // A view to contain |label_| and |icon_|. |
| 305 views::View* label_container_; | 308 views::View* label_container_; |
| 306 // The input set by ShowTextfield. | 309 // The input set by ShowTextfield. |
| 307 DecoratedTextfield* decorated_; | 310 DecoratedTextfield* decorated_; |
| 311 // An "Edit" link that flips to editable inputs rather than suggestion text. |
| 312 views::Link* edit_link_; |
| 308 | 313 |
| 309 DISALLOW_COPY_AND_ASSIGN(SuggestionView); | 314 DISALLOW_COPY_AND_ASSIGN(SuggestionView); |
| 310 }; | 315 }; |
| 311 | 316 |
| 312 // A convenience struct for holding pointers to views within each detail | 317 // A convenience struct for holding pointers to views within each detail |
| 313 // section. None of the member pointers are owned. | 318 // section. None of the member pointers are owned. |
| 314 struct DetailsGroup { | 319 struct DetailsGroup { |
| 315 explicit DetailsGroup(DialogSection section); | 320 explicit DetailsGroup(DialogSection section); |
| 316 ~DetailsGroup(); | 321 ~DetailsGroup(); |
| 317 | 322 |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 467 | 472 |
| 468 // The focus manager for |window_|. | 473 // The focus manager for |window_|. |
| 469 views::FocusManager* focus_manager_; | 474 views::FocusManager* focus_manager_; |
| 470 | 475 |
| 471 DISALLOW_COPY_AND_ASSIGN(AutofillDialogViews); | 476 DISALLOW_COPY_AND_ASSIGN(AutofillDialogViews); |
| 472 }; | 477 }; |
| 473 | 478 |
| 474 } // namespace autofill | 479 } // namespace autofill |
| 475 | 480 |
| 476 #endif // CHROME_BROWSER_UI_VIEWS_AUTOFILL_AUTOFILL_DIALOG_VIEWS_H_ | 481 #endif // CHROME_BROWSER_UI_VIEWS_AUTOFILL_AUTOFILL_DIALOG_VIEWS_H_ |
| OLD | NEW |