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

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: Temporarily added --disable-gpu when launching subprocess. Filled out all bubble dialog invocation … Created 3 years, 11 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 6fa564c80ed6cf52220c34dac82c0389ce3cc1ed..10c07424a0694b023f0efa7b46bfe79d27773706 100644
--- a/chrome/browser/ui/views/location_bar/location_bar_view.cc
+++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc
@@ -1065,7 +1065,7 @@ int LocationBarView::PageActionCount() {
}
int LocationBarView::PageActionVisibleCount() {
- int result = 0;
+ size_t result = 0;
for (const auto& action_view : page_action_views_) {
if (action_view->visible())
++result;
@@ -1116,6 +1116,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:
@@ -1242,3 +1252,20 @@ 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 i = content_setting_views_.begin();
+ i < content_setting_views_.end(); i++) {
+ if ((*i)->content_setting_image_model() == image_model)
+ return *i;
+ }
+ NOTREACHED();
+ return nullptr;
+}
+
+

Powered by Google App Engine
This is Rietveld 408576698