| 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 17 matching lines...) Expand all Loading... |
| 28 | 28 |
| 29 namespace { | 29 namespace { |
| 30 | 30 |
| 31 class TestAutofillPopupViewDelegate : public AutofillPopupViewDelegate { | 31 class TestAutofillPopupViewDelegate : public AutofillPopupViewDelegate { |
| 32 public: | 32 public: |
| 33 explicit TestAutofillPopupViewDelegate(content::WebContents* web_contents) | 33 explicit TestAutofillPopupViewDelegate(content::WebContents* web_contents) |
| 34 : element_bounds_(0.0, 0.0, 100.0, 100.0), | 34 : element_bounds_(0.0, 0.0, 100.0, 100.0), |
| 35 container_view_(web_contents->GetNativeView()) {} | 35 container_view_(web_contents->GetNativeView()) {} |
| 36 | 36 |
| 37 void Hide() override {} | 37 void Hide() override {} |
| 38 void ViewDestroyed() override{}; | 38 void ViewDestroyed() override {} |
| 39 void SetSelectionAtPoint(const gfx::Point& point) override {} | 39 void SetSelectionAtPoint(const gfx::Point& point) override {} |
| 40 bool AcceptSelectedLine() override { return true; } | 40 bool AcceptSelectedLine() override { return true; } |
| 41 void SelectionCleared() override {} | 41 void SelectionCleared() override {} |
| 42 gfx::Rect popup_bounds() const override { return gfx::Rect(0, 0, 100, 100); } | 42 gfx::Rect popup_bounds() const override { return gfx::Rect(0, 0, 100, 100); } |
| 43 gfx::NativeView container_view() override { return container_view_; } | 43 gfx::NativeView container_view() override { return container_view_; } |
| 44 const gfx::RectF& element_bounds() const override { return element_bounds_; } | 44 const gfx::RectF& element_bounds() const override { return element_bounds_; } |
| 45 bool IsRTL() const override { return false; } | 45 bool IsRTL() const override { return false; } |
| 46 | 46 |
| 47 const std::vector<autofill::Suggestion> GetSuggestions() override { | 47 const std::vector<autofill::Suggestion> GetSuggestions() override { |
| 48 // Give elements 1 and 3 subtexts and elements 2 and 3 icons, to ensure | 48 // Give elements 1 and 3 subtexts and elements 2 and 3 icons, to ensure |
| (...skipping 61 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 |