| OLD | NEW |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 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/autofill/autofill_popup_layout_model.h" | 5 #include "chrome/browser/ui/autofill/autofill_popup_layout_model.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 suggestions.push_back(Suggestion("", "x", "", 0)); | 52 suggestions.push_back(Suggestion("", "x", "", 0)); |
| 53 suggestions.push_back(Suggestion("", "", "americanExpressCC", 0)); | 53 suggestions.push_back(Suggestion("", "", "americanExpressCC", 0)); |
| 54 suggestions.push_back(Suggestion("", "x", "genericCC", 0)); | 54 suggestions.push_back(Suggestion("", "x", "genericCC", 0)); |
| 55 // Http warning message. | 55 // Http warning message. |
| 56 suggestions.push_back( | 56 suggestions.push_back( |
| 57 Suggestion("x", "x", "httpWarning", | 57 Suggestion("x", "x", "httpWarning", |
| 58 POPUP_ITEM_ID_HTTP_NOT_SECURE_WARNING_MESSAGE)); | 58 POPUP_ITEM_ID_HTTP_NOT_SECURE_WARNING_MESSAGE)); |
| 59 return suggestions; | 59 return suggestions; |
| 60 } | 60 } |
| 61 #if !defined(OS_ANDROID) | 61 #if !defined(OS_ANDROID) |
| 62 int GetElidedValueWidthForRow(size_t row) override { return 0; } | 62 int GetElidedValueWidthForRow(int row) override { return 0; } |
| 63 int GetElidedLabelWidthForRow(size_t row) override { return 0; } | 63 int GetElidedLabelWidthForRow(int row) override { return 0; } |
| 64 #endif | 64 #endif |
| 65 | 65 |
| 66 private: | 66 private: |
| 67 gfx::RectF element_bounds_; | 67 gfx::RectF element_bounds_; |
| 68 gfx::NativeView container_view_; | 68 gfx::NativeView container_view_; |
| 69 }; | 69 }; |
| 70 | 70 |
| 71 class AutofillPopupLayoutModelTest : public ChromeRenderViewHostTestHarness { | 71 class AutofillPopupLayoutModelTest : public ChromeRenderViewHostTestHarness { |
| 72 public: | 72 public: |
| 73 void SetUp() override { | 73 void SetUp() override { |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 .Width(), | 110 .Width(), |
| 111 layout_model()->RowWidthWithoutText(3, /* with_label= */ true)); | 111 layout_model()->RowWidthWithoutText(3, /* with_label= */ true)); |
| 112 EXPECT_EQ(base_size + AutofillPopupLayoutModel::kHttpWarningNamePadding + | 112 EXPECT_EQ(base_size + AutofillPopupLayoutModel::kHttpWarningNamePadding + |
| 113 AutofillPopupLayoutModel::kHttpWarningIconPadding + | 113 AutofillPopupLayoutModel::kHttpWarningIconPadding + |
| 114 layout_model()->GetIconImage(4).width(), | 114 layout_model()->GetIconImage(4).width(), |
| 115 layout_model()->RowWidthWithoutText(4, /* with_label= */ true)); | 115 layout_model()->RowWidthWithoutText(4, /* with_label= */ true)); |
| 116 } | 116 } |
| 117 #endif | 117 #endif |
| 118 | 118 |
| 119 } // namespace autofill | 119 } // namespace autofill |
| OLD | NEW |