Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1073)

Unified Diff: chrome/browser/ui/views/location_bar/location_bar_view.cc

Issue 2668833003: DialogBrowserTest implementation to invoke Content settings bubble dialogs. (Closed)
Patch Set: Merge fix from https://codereview.chromium.org/2663163004. This is temporary Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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;
+}
+
+

Powered by Google App Engine
This is Rietveld 408576698