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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" 5 #include "chrome/browser/ui/views/location_bar/location_bar_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <map> 8 #include <map>
9 9
10 #include "base/i18n/rtl.h" 10 #include "base/i18n/rtl.h"
(...skipping 1079 matching lines...) Expand 10 before | Expand all | Expand 10 after
1090 } 1090 }
1091 1091
1092 NOTREACHED(); 1092 NOTREACHED();
1093 } 1093 }
1094 1094
1095 bool LocationBarView::GetBookmarkStarVisibility() { 1095 bool LocationBarView::GetBookmarkStarVisibility() {
1096 DCHECK(star_view_); 1096 DCHECK(star_view_);
1097 return star_view_->visible(); 1097 return star_view_->visible();
1098 } 1098 }
1099 1099
1100 int LocationBarView::ContentSettingImageModelCount() {
1101 return content_setting_views_.size();
Peter Kasting 2017/02/06 21:14:25 This is a size_t, so the function should return a
1102 }
1103
1104 ContentSettingImageModel* LocationBarView::GetContentSettingImageModel(
1105 size_t index) {
1106 DCHECK_LT(index, content_setting_views_.size());
1107 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()
1108 }
1109
1100 //////////////////////////////////////////////////////////////////////////////// 1110 ////////////////////////////////////////////////////////////////////////////////
1101 // LocationBarView, private views::View implementation: 1111 // LocationBarView, private views::View implementation:
1102 1112
1103 const char* LocationBarView::GetClassName() const { 1113 const char* LocationBarView::GetClassName() const {
1104 return kViewClassName; 1114 return kViewClassName;
1105 } 1115 }
1106 1116
1107 void LocationBarView::OnBoundsChanged(const gfx::Rect& previous_bounds) { 1117 void LocationBarView::OnBoundsChanged(const gfx::Rect& previous_bounds) {
1108 OmniboxPopupView* popup = omnibox_view_->model()->popup_model()->view(); 1118 OmniboxPopupView* popup = omnibox_view_->model()->popup_model()->view();
1109 if (popup->IsOpen()) 1119 if (popup->IsOpen())
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
1211 // LocationBarView, private TemplateURLServiceObserver implementation: 1221 // LocationBarView, private TemplateURLServiceObserver implementation:
1212 1222
1213 void LocationBarView::OnTemplateURLServiceChanged() { 1223 void LocationBarView::OnTemplateURLServiceChanged() {
1214 template_url_service_->RemoveObserver(this); 1224 template_url_service_->RemoveObserver(this);
1215 template_url_service_ = nullptr; 1225 template_url_service_ = nullptr;
1216 // If the browser is no longer active, let's not show the info bubble, as this 1226 // If the browser is no longer active, let's not show the info bubble, as this
1217 // would make the browser the active window again. 1227 // would make the browser the active window again.
1218 if (omnibox_view_ && omnibox_view_->GetWidget()->IsActive()) 1228 if (omnibox_view_ && omnibox_view_->GetWidget()->IsActive())
1219 ShowFirstRunBubble(); 1229 ShowFirstRunBubble();
1220 } 1230 }
1231
1232 ////////////////////////////////////////////////////////////////////////////////
1233 // LocationBarView, private function(s) for testing:
1234
1235 ContentSettingImageView*
1236 LocationBarView::GetContentSettingImageViewFromImageModel(
1237 ContentSettingImageModel* image_model) {
1238 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
1239 if (view->content_setting_image_model() == image_model)
1240 return view;
1241 }
1242 NOTREACHED();
1243 return nullptr;
1244 }
1245
1246
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698