OLD | NEW |
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/message_loop.h" |
7 #include "chrome/browser/ui/view_ids.h" | 8 #include "chrome/browser/ui/view_ids.h" |
8 #include "chrome/browser/ui/views/infobars/infobar_view.h" | 9 #include "chrome/browser/ui/views/infobars/infobar_view.h" |
9 #include "grit/generated_resources.h" | 10 #include "grit/generated_resources.h" |
10 #include "ui/base/accessibility/accessible_view_state.h" | 11 #include "ui/base/accessibility/accessible_view_state.h" |
11 #include "ui/base/l10n/l10n_util.h" | 12 #include "ui/base/l10n/l10n_util.h" |
12 | 13 |
13 // static | 14 // static |
14 const char InfoBarContainerView::kViewClassName[] = "InfoBarContainerView"; | 15 const char InfoBarContainerView::kViewClassName[] = "InfoBarContainerView"; |
15 | 16 |
16 InfoBarContainerView::InfoBarContainerView(Delegate* delegate) | 17 InfoBarContainerView::InfoBarContainerView(Delegate* delegate) |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 } | 53 } |
53 | 54 |
54 void InfoBarContainerView::PlatformSpecificAddInfoBar(InfoBar* infobar, | 55 void InfoBarContainerView::PlatformSpecificAddInfoBar(InfoBar* infobar, |
55 size_t position) { | 56 size_t position) { |
56 AddChildViewAt(static_cast<InfoBarView*>(infobar), | 57 AddChildViewAt(static_cast<InfoBarView*>(infobar), |
57 static_cast<int>(position)); | 58 static_cast<int>(position)); |
58 } | 59 } |
59 | 60 |
60 void InfoBarContainerView::PlatformSpecificRemoveInfoBar(InfoBar* infobar) { | 61 void InfoBarContainerView::PlatformSpecificRemoveInfoBar(InfoBar* infobar) { |
61 RemoveChildView(static_cast<InfoBarView*>(infobar)); | 62 RemoveChildView(static_cast<InfoBarView*>(infobar)); |
| 63 base::MessageLoop::current()->DeleteSoon(FROM_HERE, infobar); |
62 } | 64 } |
OLD | NEW |