| 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 #include "chrome/browser/ui/views/autofill/autofill_dialog_views.h" | 5 #include "chrome/browser/ui/views/autofill/autofill_dialog_views.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 #include "ui/views/controls/separator.h" | 37 #include "ui/views/controls/separator.h" |
| 38 #include "ui/views/controls/textfield/textfield.h" | 38 #include "ui/views/controls/textfield/textfield.h" |
| 39 #include "ui/views/controls/webview/webview.h" | 39 #include "ui/views/controls/webview/webview.h" |
| 40 #include "ui/views/layout/box_layout.h" | 40 #include "ui/views/layout/box_layout.h" |
| 41 #include "ui/views/layout/fill_layout.h" | 41 #include "ui/views/layout/fill_layout.h" |
| 42 #include "ui/views/layout/grid_layout.h" | 42 #include "ui/views/layout/grid_layout.h" |
| 43 #include "ui/views/layout/layout_constants.h" | 43 #include "ui/views/layout/layout_constants.h" |
| 44 #include "ui/views/widget/widget.h" | 44 #include "ui/views/widget/widget.h" |
| 45 #include "ui/views/window/dialog_client_view.h" | 45 #include "ui/views/window/dialog_client_view.h" |
| 46 | 46 |
| 47 #include "ui/views/controls/rich_label.h" |
| 48 |
| 47 namespace autofill { | 49 namespace autofill { |
| 48 | 50 |
| 49 namespace { | 51 namespace { |
| 50 | 52 |
| 51 // Horizontal padding between text and other elements (in pixels). | 53 // Horizontal padding between text and other elements (in pixels). |
| 52 const int kAroundTextPadding = 4; | 54 const int kAroundTextPadding = 4; |
| 53 | 55 |
| 54 // Size of the triangular mark that indicates an invalid textfield. | 56 // Size of the triangular mark that indicates an invalid textfield. |
| 55 const size_t kDogEarSize = 10; | 57 const size_t kDogEarSize = 10; |
| 56 | 58 |
| (...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 718 | 720 |
| 719 views::View* AutofillDialogViews::CreateExtraView() { | 721 views::View* AutofillDialogViews::CreateExtraView() { |
| 720 return button_strip_extra_view_; | 722 return button_strip_extra_view_; |
| 721 } | 723 } |
| 722 | 724 |
| 723 views::View* AutofillDialogViews::CreateTitlebarExtraView() { | 725 views::View* AutofillDialogViews::CreateTitlebarExtraView() { |
| 724 return account_chooser_; | 726 return account_chooser_; |
| 725 } | 727 } |
| 726 | 728 |
| 727 views::View* AutofillDialogViews::CreateFootnoteView() { | 729 views::View* AutofillDialogViews::CreateFootnoteView() { |
| 730 std::vector<string16> strings; |
| 731 std::vector<GURL> urls; |
| 732 strings.push_back(ASCIIToUTF16("This is text blob 1. ")); |
| 733 urls.push_back(GURL()); |
| 734 strings.push_back(ASCIIToUTF16("This is text blob 2. ")); |
| 735 urls.push_back(GURL()); |
| 736 strings.push_back(ASCIIToUTF16("This is text blob 3 (linky). ")); |
| 737 urls.push_back(GURL("http://www.google.com")); |
| 738 strings.push_back(ASCIIToUTF16("This is text blob 4. ")); |
| 739 urls.push_back(GURL()); |
| 740 strings.push_back(ASCIIToUTF16("This is text blob 5. (linky) ")); |
| 741 urls.push_back(GURL("http://www.google.com")); |
| 742 strings.push_back(ASCIIToUTF16("This is text blob 6. (linky) ")); |
| 743 urls.push_back(GURL("http://www.google.com")); |
| 744 |
| 745 views::RichLabel* label = new views::RichLabel(strings, urls); |
| 746 |
| 728 // TODO(estade): add a view to contain the terms of service. | 747 // TODO(estade): add a view to contain the terms of service. |
| 729 return NULL; | 748 return label; |
| 730 } | 749 } |
| 731 | 750 |
| 732 bool AutofillDialogViews::Cancel() { | 751 bool AutofillDialogViews::Cancel() { |
| 733 controller_->OnCancel(); | 752 controller_->OnCancel(); |
| 734 return true; | 753 return true; |
| 735 } | 754 } |
| 736 | 755 |
| 737 bool AutofillDialogViews::Accept() { | 756 bool AutofillDialogViews::Accept() { |
| 738 if (!ValidateForm()) | 757 if (!ValidateForm()) |
| 739 return false; | 758 return false; |
| (...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1223 AutofillDialogViews::DetailsGroup::DetailsGroup(DialogSection section) | 1242 AutofillDialogViews::DetailsGroup::DetailsGroup(DialogSection section) |
| 1224 : section(section), | 1243 : section(section), |
| 1225 container(NULL), | 1244 container(NULL), |
| 1226 manual_input(NULL), | 1245 manual_input(NULL), |
| 1227 suggested_info(NULL), | 1246 suggested_info(NULL), |
| 1228 suggested_button(NULL) {} | 1247 suggested_button(NULL) {} |
| 1229 | 1248 |
| 1230 AutofillDialogViews::DetailsGroup::~DetailsGroup() {} | 1249 AutofillDialogViews::DetailsGroup::~DetailsGroup() {} |
| 1231 | 1250 |
| 1232 } // namespace autofill | 1251 } // namespace autofill |
| OLD | NEW |