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

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

Issue 7349021: Convert some more view methods to the ui/views style. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 5 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 "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "chrome/browser/ui/view_ids.h" 8 #include "chrome/browser/ui/view_ids.h"
9 #include "chrome/browser/ui/views/infobars/infobar_view.h" 9 #include "chrome/browser/ui/views/infobars/infobar_view.h"
10 #include "grit/generated_resources.h" 10 #include "grit/generated_resources.h"
(...skipping 14 matching lines...) Expand all
25 // of the delegate). 25 // of the delegate).
26 int total_height; 26 int total_height;
27 GetVerticalOverlap(&total_height); 27 GetVerticalOverlap(&total_height);
28 return gfx::Size(0, total_height); 28 return gfx::Size(0, total_height);
29 } 29 }
30 30
31 void InfoBarContainerView::Layout() { 31 void InfoBarContainerView::Layout() {
32 int top = GetVerticalOverlap(NULL); 32 int top = GetVerticalOverlap(NULL);
33 33
34 for (int i = 0; i < child_count(); ++i) { 34 for (int i = 0; i < child_count(); ++i) {
35 InfoBarView* child = static_cast<InfoBarView*>(GetChildViewAt(i)); 35 InfoBarView* child = static_cast<InfoBarView*>(child_at(i));
36 top -= child->arrow_height(); 36 top -= child->arrow_height();
37 int child_height = child->total_height(); 37 int child_height = child->total_height();
38 child->SetBounds(0, top, width(), child_height); 38 child->SetBounds(0, top, width(), child_height);
39 top += child_height; 39 top += child_height;
40 } 40 }
41 } 41 }
42 42
43 void InfoBarContainerView::GetAccessibleState(ui::AccessibleViewState* state) { 43 void InfoBarContainerView::GetAccessibleState(ui::AccessibleViewState* state) {
44 state->role = ui::AccessibilityTypes::ROLE_GROUPING; 44 state->role = ui::AccessibilityTypes::ROLE_GROUPING;
45 state->name = l10n_util::GetStringUTF16(IDS_ACCNAME_INFOBAR_CONTAINER); 45 state->name = l10n_util::GetStringUTF16(IDS_ACCNAME_INFOBAR_CONTAINER);
46 } 46 }
47 47
48 void InfoBarContainerView::PlatformSpecificAddInfoBar(InfoBar* infobar, 48 void InfoBarContainerView::PlatformSpecificAddInfoBar(InfoBar* infobar,
49 size_t position) { 49 size_t position) {
50 AddChildViewAt(static_cast<InfoBarView*>(infobar), 50 AddChildViewAt(static_cast<InfoBarView*>(infobar),
51 static_cast<int>(position)); 51 static_cast<int>(position));
52 } 52 }
53 53
54 void InfoBarContainerView::PlatformSpecificRemoveInfoBar(InfoBar* infobar) { 54 void InfoBarContainerView::PlatformSpecificRemoveInfoBar(InfoBar* infobar) {
55 RemoveChildView(static_cast<InfoBarView*>(infobar)); 55 RemoveChildView(static_cast<InfoBarView*>(infobar));
56 MessageLoop::current()->DeleteSoon(FROM_HERE, infobar); 56 MessageLoop::current()->DeleteSoon(FROM_HERE, infobar);
57 } 57 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/frame/browser_view_layout.cc ('k') | chrome/browser/ui/views/infobars/infobar_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698