| 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 #ifndef CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_POPUP_LAYOUT_MODEL_H_ | 5 #ifndef CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_POPUP_LAYOUT_MODEL_H_ |
| 6 #define CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_POPUP_LAYOUT_MODEL_H_ | 6 #define CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_POPUP_LAYOUT_MODEL_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| 11 #include "chrome/browser/ui/autofill/autofill_popup_view_delegate.h" | 11 #include "chrome/browser/ui/autofill/autofill_popup_view_delegate.h" |
| 12 #include "chrome/browser/ui/autofill/popup_view_common.h" | 12 #include "chrome/browser/ui/autofill/popup_view_common.h" |
| 13 #include "third_party/skia/include/core/SkColor.h" | 13 #include "third_party/skia/include/core/SkColor.h" |
| 14 #include "ui/gfx/font_list.h" | 14 #include "ui/gfx/font_list.h" |
| 15 #include "ui/gfx/geometry/rect.h" | 15 #include "ui/gfx/geometry/rect.h" |
| 16 #include "ui/gfx/native_widget_types.h" | 16 #include "ui/gfx/native_widget_types.h" |
| 17 | 17 |
| 18 namespace gfx { | 18 namespace gfx { |
| 19 class Display; | 19 class Display; |
| 20 class ImageSkia; |
| 20 class Point; | 21 class Point; |
| 21 } | 22 } |
| 22 | 23 |
| 23 namespace ui { | 24 namespace ui { |
| 24 class KeyEvent; | 25 class KeyEvent; |
| 25 } | 26 } |
| 26 | 27 |
| 27 namespace autofill { | 28 namespace autofill { |
| 28 | 29 |
| 29 // Helper class which keeps tracks of popup bounds and related view information. | 30 // Helper class which keeps tracks of popup bounds and related view information. |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 // to prevent it from going off the screen. | 65 // to prevent it from going off the screen. |
| 65 void UpdatePopupBounds(); | 66 void UpdatePopupBounds(); |
| 66 | 67 |
| 67 // The same font can vary based on the type of data it is showing at the row | 68 // The same font can vary based on the type of data it is showing at the row |
| 68 // |index|. | 69 // |index|. |
| 69 const gfx::FontList& GetValueFontListForRow(size_t index) const; | 70 const gfx::FontList& GetValueFontListForRow(size_t index) const; |
| 70 const gfx::FontList& GetLabelFontList() const; | 71 const gfx::FontList& GetLabelFontList() const; |
| 71 | 72 |
| 72 // Returns the value font color of the row item according to its |index|. | 73 // Returns the value font color of the row item according to its |index|. |
| 73 SkColor GetValueFontColorForRow(size_t index) const; | 74 SkColor GetValueFontColorForRow(size_t index) const; |
| 75 |
| 76 // Returns the icon image of the item at |index| in the popup. |
| 77 gfx::ImageSkia GetIconImage(size_t index) const; |
| 74 #endif | 78 #endif |
| 75 | 79 |
| 76 // Convert a y-coordinate to the closest line. | 80 // Convert a y-coordinate to the closest line. |
| 77 int LineFromY(int y) const; | 81 int LineFromY(int y) const; |
| 78 | 82 |
| 79 const gfx::Rect popup_bounds() const { return popup_bounds_; } | 83 const gfx::Rect popup_bounds() const { return popup_bounds_; } |
| 80 | 84 |
| 81 // Returns the bounds of the item at |index| in the popup, relative to | 85 // Returns the bounds of the item at |index| in the popup, relative to |
| 82 // the top left of the popup. | 86 // the top left of the popup. |
| 83 gfx::Rect GetRowBounds(size_t index) const; | 87 gfx::Rect GetRowBounds(size_t index) const; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 109 PopupViewCommon view_common_; | 113 PopupViewCommon view_common_; |
| 110 | 114 |
| 111 AutofillPopupViewDelegate* delegate_; // Weak reference. | 115 AutofillPopupViewDelegate* delegate_; // Weak reference. |
| 112 | 116 |
| 113 DISALLOW_COPY_AND_ASSIGN(AutofillPopupLayoutModel); | 117 DISALLOW_COPY_AND_ASSIGN(AutofillPopupLayoutModel); |
| 114 }; | 118 }; |
| 115 | 119 |
| 116 } // namespace autofill | 120 } // namespace autofill |
| 117 | 121 |
| 118 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_POPUP_LAYOUT_MODEL_H_ | 122 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_POPUP_LAYOUT_MODEL_H_ |
| OLD | NEW |