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

Side by Side Diff: chrome/browser/ui/views/infobars/infobar_view.cc

Issue 2464063002: Revert of Some more pre-material cleanups (Closed)
Patch Set: Created 4 years, 1 month 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/infobars/infobar_view.h" 5 #include "chrome/browser/ui/views/infobars/infobar_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <memory> 8 #include <memory>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 close_button_->SetIcon(gfx::VectorIconId::BAR_CLOSE); 174 close_button_->SetIcon(gfx::VectorIconId::BAR_CLOSE);
175 close_button_->SetAccessibleName( 175 close_button_->SetAccessibleName(
176 l10n_util::GetStringUTF16(IDS_ACCNAME_CLOSE)); 176 l10n_util::GetStringUTF16(IDS_ACCNAME_CLOSE));
177 close_button_->SetFocusForPlatform(); 177 close_button_->SetFocusForPlatform();
178 // Subclasses should already be done adding child views by this point (see 178 // Subclasses should already be done adding child views by this point (see
179 // related DCHECK in Layout()). 179 // related DCHECK in Layout()).
180 child_container_->AddChildView(close_button_); 180 child_container_->AddChildView(close_button_);
181 } 181 }
182 182
183 // Ensure the infobar is tall enough to display its contents. 183 // Ensure the infobar is tall enough to display its contents.
184 int height = InfoBarContainerDelegate::kDefaultBarTargetHeight; 184 int height = InfoBarContainerDelegate::kDefaultBarTargetHeightMd;
185 const int kMinimumVerticalPadding = 6; 185 const int kMinimumVerticalPadding = 6;
186 for (int i = 0; i < child_container_->child_count(); ++i) { 186 for (int i = 0; i < child_container_->child_count(); ++i) {
187 const int child_height = child_container_->child_at(i)->height(); 187 const int child_height = child_container_->child_at(i)->height();
188 height = std::max(height, child_height + kMinimumVerticalPadding); 188 height = std::max(height, child_height + kMinimumVerticalPadding);
189 } 189 }
190 SetBarTargetHeight(height); 190 SetBarTargetHeight(height);
191 } 191 }
192 192
193 void InfoBarView::ButtonPressed(views::Button* sender, 193 void InfoBarView::ButtonPressed(views::Button* sender,
194 const ui::Event& event) { 194 const ui::Event& event) {
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 } 307 }
308 308
309 bool InfoBarView::DoesIntersectRect(const View* target, 309 bool InfoBarView::DoesIntersectRect(const View* target,
310 const gfx::Rect& rect) const { 310 const gfx::Rect& rect) const {
311 DCHECK_EQ(this, target); 311 DCHECK_EQ(this, target);
312 // Only events that intersect the portion below the arrow are interesting. 312 // Only events that intersect the portion below the arrow are interesting.
313 gfx::Rect non_arrow_bounds = GetLocalBounds(); 313 gfx::Rect non_arrow_bounds = GetLocalBounds();
314 non_arrow_bounds.Inset(0, arrow_height(), 0, 0); 314 non_arrow_bounds.Inset(0, arrow_height(), 0, 0);
315 return rect.Intersects(non_arrow_bounds); 315 return rect.Intersects(non_arrow_bounds);
316 } 316 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/toolbar/toolbar_actions_bar.cc ('k') | chrome/browser/ui/views/location_bar/location_bar_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698