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 0fcbb434a617f35cf43a36432cc0693c4b701cd9..654116e4063415451d18adee9da519c80266d02a 100644 |
| --- a/chrome/browser/ui/views/location_bar/location_bar_view.cc |
| +++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc |
| @@ -1043,7 +1043,7 @@ int LocationBarView::PageActionCount() { |
| } |
| int LocationBarView::PageActionVisibleCount() { |
| - int result = 0; |
| + size_t result = 0; |
|
tapted
2017/02/03 00:35:41
why this change? -- (style guide prefers int in ge
kylix_rd
2017/02/03 18:55:04
Done.
Peter Kasting
2017/02/03 22:20:41
See other comment on style guide not actually pref
|
| for (const auto& action_view : page_action_views_) { |
| if (action_view->visible()) |
| ++result; |
| @@ -1094,6 +1094,16 @@ bool LocationBarView::GetBookmarkStarVisibility() { |
| return star_view_->visible(); |
| } |
| +int LocationBarView::ContentSettingImageModelCount() { |
| + return content_setting_views_.size(); |
| +} |
| + |
| +ContentSettingImageModel* LocationBarView::GetContentSettingImageModel( |
| + size_t index) { |
| + DCHECK(index >= 0 && index < content_setting_views_.size()); |
| + return content_setting_views_.at(index)->content_setting_image_model(); |
| +} |
| + |
| //////////////////////////////////////////////////////////////////////////////// |
| // LocationBarView, private views::View implementation: |
| @@ -1220,3 +1230,20 @@ void LocationBarView::OnTemplateURLServiceChanged() { |
| if (omnibox_view_ && omnibox_view_->GetWidget()->IsActive()) |
| ShowFirstRunBubble(); |
| } |
| + |
| +//////////////////////////////////////////////////////////////////////////////// |
| +// LocationBarView, private function(s) for testing: |
| + |
| +ContentSettingImageView* |
| +LocationBarView::GetContentSettingImageViewFromImageModel( |
|
tapted
2017/02/03 00:35:40
(move to TestApi class)
|
| + ContentSettingImageModel* image_model) { |
| + for (auto i = content_setting_views_.begin(); |
|
tapted
2017/02/03 00:35:40
for (ContentSettingImageView* view : content_setti
|
| + i < content_setting_views_.end(); i++) { |
| + if ((*i)->content_setting_image_model() == image_model) |
| + return *i; |
| + } |
| + NOTREACHED(); |
| + return nullptr; |
| +} |
| + |
| + |