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/gtk/infobars/infobar_container_gtk.h" | 5 #include "chrome/browser/ui/gtk/infobars/infobar_container_gtk.h" |
6 | 6 |
7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 | 169 |
170 if (last_bar) | 170 if (last_bar) |
171 last_bar->ShowArrowFor(this_bar, animate); | 171 last_bar->ShowArrowFor(this_bar, animate); |
172 else | 172 else |
173 UpdateToolbarInfoBarState(this_bar, animate); | 173 UpdateToolbarInfoBarState(this_bar, animate); |
174 | 174 |
175 g_list_free(children); | 175 g_list_free(children); |
176 } | 176 } |
177 | 177 |
178 void InfoBarContainerGtk::AddInfoBar(InfoBarDelegate* delegate, bool animate) { | 178 void InfoBarContainerGtk::AddInfoBar(InfoBarDelegate* delegate, bool animate) { |
179 InfoBar* infobar = delegate->CreateInfoBar(); | 179 InfoBar* infobar = delegate->CreateInfoBar(tab_contents_); |
180 infobar->set_container(this); | 180 infobar->set_container(this); |
181 infobar->SetThemeProvider(GtkThemeService::GetFrom(profile_)); | 181 infobar->SetThemeProvider(GtkThemeService::GetFrom(profile_)); |
182 gtk_box_pack_start(GTK_BOX(widget()), infobar->widget(), | 182 gtk_box_pack_start(GTK_BOX(widget()), infobar->widget(), |
183 FALSE, FALSE, 0); | 183 FALSE, FALSE, 0); |
184 | 184 |
185 infobar->Show(animate); | 185 infobar->Show(animate); |
186 ShowArrowForDelegate(delegate, animate); | 186 ShowArrowForDelegate(delegate, animate); |
187 } | 187 } |
188 | 188 |
189 void InfoBarContainerGtk::RemoveInfoBar(InfoBarDelegate* delegate, | 189 void InfoBarContainerGtk::RemoveInfoBar(InfoBarDelegate* delegate, |
(...skipping 18 matching lines...) Expand all Loading... |
208 } | 208 } |
209 | 209 |
210 void InfoBarContainerGtk::UpdateToolbarInfoBarState(InfoBar* infobar, | 210 void InfoBarContainerGtk::UpdateToolbarInfoBarState(InfoBar* infobar, |
211 bool animate) { | 211 bool animate) { |
212 GtkWindow* parent = platform_util::GetTopLevel(widget()); | 212 GtkWindow* parent = platform_util::GetTopLevel(widget()); |
213 BrowserWindowGtk* browser_window = | 213 BrowserWindowGtk* browser_window = |
214 BrowserWindowGtk::GetBrowserWindowForNativeWindow(parent); | 214 BrowserWindowGtk::GetBrowserWindowForNativeWindow(parent); |
215 if (browser_window) | 215 if (browser_window) |
216 browser_window->SetInfoBarShowing(infobar, animate); | 216 browser_window->SetInfoBarShowing(infobar, animate); |
217 } | 217 } |
OLD | NEW |