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

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

Issue 273223002: views: Make view::Views::GetPreferredSize() const. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More compile fix for ToT Created 6 years, 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_container_view.h" 5 #include "chrome/browser/ui/views/infobars/infobar_container_view.h"
6 6
7 #include "chrome/browser/ui/view_ids.h" 7 #include "chrome/browser/ui/view_ids.h"
8 #include "chrome/browser/ui/views/infobars/infobar_view.h" 8 #include "chrome/browser/ui/views/infobars/infobar_view.h"
9 #include "grit/generated_resources.h" 9 #include "grit/generated_resources.h"
10 #include "ui/accessibility/ax_view_state.h" 10 #include "ui/accessibility/ax_view_state.h"
11 #include "ui/base/l10n/l10n_util.h" 11 #include "ui/base/l10n/l10n_util.h"
12 12
13 // static 13 // static
14 const char InfoBarContainerView::kViewClassName[] = "InfoBarContainerView"; 14 const char InfoBarContainerView::kViewClassName[] = "InfoBarContainerView";
15 15
16 InfoBarContainerView::InfoBarContainerView(Delegate* delegate) 16 InfoBarContainerView::InfoBarContainerView(Delegate* delegate)
17 : infobars::InfoBarContainer(delegate) { 17 : infobars::InfoBarContainer(delegate) {
18 set_id(VIEW_ID_INFO_BAR_CONTAINER); 18 set_id(VIEW_ID_INFO_BAR_CONTAINER);
19 } 19 }
20 20
21 InfoBarContainerView::~InfoBarContainerView() { 21 InfoBarContainerView::~InfoBarContainerView() {
22 RemoveAllInfoBarsForDestruction(); 22 RemoveAllInfoBarsForDestruction();
23 } 23 }
24 24
25 gfx::Size InfoBarContainerView::GetPreferredSize() { 25 gfx::Size InfoBarContainerView::GetPreferredSize() const {
26 int total_height; 26 int total_height;
27 GetVerticalOverlap(&total_height); 27 GetVerticalOverlap(&total_height);
28 gfx::Size size(0, total_height); 28 gfx::Size size(0, total_height);
29 for (int i = 0; i < child_count(); ++i) 29 for (int i = 0; i < child_count(); ++i)
30 size.SetToMax(gfx::Size(child_at(i)->GetPreferredSize().width(), 0)); 30 size.SetToMax(gfx::Size(child_at(i)->GetPreferredSize().width(), 0));
31 return size; 31 return size;
32 } 32 }
33 33
34 const char* InfoBarContainerView::GetClassName() const { 34 const char* InfoBarContainerView::GetClassName() const {
35 return kViewClassName; 35 return kViewClassName;
(...skipping 20 matching lines...) Expand all
56 infobars::InfoBar* infobar, 56 infobars::InfoBar* infobar,
57 size_t position) { 57 size_t position) {
58 AddChildViewAt(static_cast<InfoBarView*>(infobar), 58 AddChildViewAt(static_cast<InfoBarView*>(infobar),
59 static_cast<int>(position)); 59 static_cast<int>(position));
60 } 60 }
61 61
62 void InfoBarContainerView::PlatformSpecificRemoveInfoBar( 62 void InfoBarContainerView::PlatformSpecificRemoveInfoBar(
63 infobars::InfoBar* infobar) { 63 infobars::InfoBar* infobar) {
64 RemoveChildView(static_cast<InfoBarView*>(infobar)); 64 RemoveChildView(static_cast<InfoBarView*>(infobar));
65 } 65 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/infobars/infobar_container_view.h ('k') | chrome/browser/ui/views/infobars/infobar_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698