| OLD | NEW |
| 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2014 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 #import "ios/chrome/browser/ui/omnibox/omnibox_popup_material_row.h" | 5 #import "ios/chrome/browser/ui/omnibox/omnibox_popup_material_row.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/mac/objc_property_releaser.h" | 8 #include "base/mac/objc_property_releaser.h" |
| 9 #import "ios/chrome/browser/ui/omnibox/truncating_attributed_label.h" | 9 #import "ios/chrome/browser/ui/omnibox/truncating_attributed_label.h" |
| 10 #include "ios/chrome/browser/ui/rtl_geometry.h" | 10 #include "ios/chrome/browser/ui/rtl_geometry.h" |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 CGRectGetWidth(self.bounds) - kAppendButtonSize - | 118 CGRectGetWidth(self.bounds) - kAppendButtonSize - |
| 119 kAppendButtonTrailingMargin, | 119 kAppendButtonTrailingMargin, |
| 120 CGRectGetWidth(self.bounds), floor((_rowHeight - kAppendButtonSize) / 2), | 120 CGRectGetWidth(self.bounds), floor((_rowHeight - kAppendButtonSize) / 2), |
| 121 kAppendButtonSize, kAppendButtonSize); | 121 kAppendButtonSize, kAppendButtonSize); |
| 122 _appendButton.frame = LayoutRectGetRect(trailingAccessoryLayout); | 122 _appendButton.frame = LayoutRectGetRect(trailingAccessoryLayout); |
| 123 } | 123 } |
| 124 | 124 |
| 125 - (void)updateLeadingImage:(int)imageID { | 125 - (void)updateLeadingImage:(int)imageID { |
| 126 _imageView.image = NativeImage(imageID); | 126 _imageView.image = NativeImage(imageID); |
| 127 | 127 |
| 128 _imageView.accessibilityIdentifier = |
| 129 [NSString stringWithFormat:@"leading image id %d", imageID]; |
| 130 |
| 128 // Adjust the vertical position based on the current size of the row. | 131 // Adjust the vertical position based on the current size of the row. |
| 129 CGRect frame = _imageView.frame; | 132 CGRect frame = _imageView.frame; |
| 130 frame.origin.y = floor((_rowHeight - kImageDimensionLength) / 2); | 133 frame.origin.y = floor((_rowHeight - kImageDimensionLength) / 2); |
| 131 _imageView.frame = frame; | 134 _imageView.frame = frame; |
| 132 } | 135 } |
| 133 | 136 |
| 134 - (void)updateHighlightBackground:(BOOL)highlighted { | 137 - (void)updateHighlightBackground:(BOOL)highlighted { |
| 135 // Set the background color to match the color of selected table view cells | 138 // Set the background color to match the color of selected table view cells |
| 136 // when their selection style is UITableViewCellSelectionStyleGray. | 139 // when their selection style is UITableViewCellSelectionStyleGray. |
| 137 if (highlighted) { | 140 if (highlighted) { |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 return _textTruncatingLabel.attributedText.string; | 175 return _textTruncatingLabel.attributedText.string; |
| 173 } | 176 } |
| 174 | 177 |
| 175 - (NSString*)accessibilityValue { | 178 - (NSString*)accessibilityValue { |
| 176 return _detailTruncatingLabel.hidden | 179 return _detailTruncatingLabel.hidden |
| 177 ? _detailAnswerLabel.attributedText.string | 180 ? _detailAnswerLabel.attributedText.string |
| 178 : _detailTruncatingLabel.attributedText.string; | 181 : _detailTruncatingLabel.attributedText.string; |
| 179 } | 182 } |
| 180 | 183 |
| 181 @end | 184 @end |
| OLD | NEW |