Chromium Code Reviews| Index: chrome/browser/ui/views/location_bar/location_bar_view.cc |
| diff --git a/chrome/browser/ui/views/location_bar/location_bar_view.cc b/chrome/browser/ui/views/location_bar/location_bar_view.cc |
| index 3f2dc43dd569f30773e1c7f8130dbb77af3509b2..7511abd5c133e37d6f377196a4dd1bffb75cfc13 100644 |
| --- a/chrome/browser/ui/views/location_bar/location_bar_view.cc |
| +++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc |
| @@ -1097,6 +1097,16 @@ bool LocationBarView::GetBookmarkStarVisibility() { |
| return star_view_->visible(); |
| } |
| +int LocationBarView::ContentSettingImageModelCount() { |
| + return content_setting_views_.size(); |
|
Peter Kasting
2017/02/06 21:14:25
This is a size_t, so the function should return a
|
| +} |
| + |
| +ContentSettingImageModel* LocationBarView::GetContentSettingImageModel( |
| + size_t index) { |
| + DCHECK_LT(index, content_setting_views_.size()); |
| + return content_setting_views_.at(index)->content_setting_image_model(); |
|
Peter Kasting
2017/02/06 21:14:25
Nit: At least in location_bar code, don't use at()
|
| +} |
| + |
| //////////////////////////////////////////////////////////////////////////////// |
| // LocationBarView, private views::View implementation: |
| @@ -1218,3 +1228,19 @@ void LocationBarView::OnTemplateURLServiceChanged() { |
| if (omnibox_view_ && omnibox_view_->GetWidget()->IsActive()) |
| ShowFirstRunBubble(); |
| } |
| + |
| +//////////////////////////////////////////////////////////////////////////////// |
| +// LocationBarView, private function(s) for testing: |
| + |
| +ContentSettingImageView* |
| +LocationBarView::GetContentSettingImageViewFromImageModel( |
| + ContentSettingImageModel* image_model) { |
| + for (auto view : content_setting_views_) { |
|
tapted
2017/02/03 23:07:03
The guide says we can use auto for "cases where th
Peter Kasting
2017/02/06 21:14:25
I would use [const] auto* here, personally. I agr
|
| + if (view->content_setting_image_model() == image_model) |
| + return view; |
| + } |
| + NOTREACHED(); |
| + return nullptr; |
| +} |
| + |
| + |