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 |
11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
12 #include "chrome/browser/browser_window.h" | 12 #include "chrome/browser/browser_window.h" |
13 #include "chrome/browser/platform_util.h" | 13 #include "chrome/browser/platform_util.h" |
14 #include "chrome/browser/tab_contents/infobar_delegate.h" | |
15 #include "chrome/browser/tab_contents/tab_contents.h" | 14 #include "chrome/browser/tab_contents/tab_contents.h" |
16 #include "chrome/browser/ui/gtk/browser_window_gtk.h" | 15 #include "chrome/browser/ui/gtk/browser_window_gtk.h" |
17 #include "chrome/browser/ui/gtk/gtk_theme_provider.h" | 16 #include "chrome/browser/ui/gtk/gtk_theme_provider.h" |
18 #include "chrome/browser/ui/gtk/gtk_util.h" | 17 #include "chrome/browser/ui/gtk/gtk_util.h" |
19 #include "chrome/browser/ui/gtk/infobars/infobar_gtk.h" | 18 #include "chrome/browser/ui/gtk/infobars/infobar_gtk.h" |
20 #include "chrome/common/notification_details.h" | 19 #include "chrome/common/notification_details.h" |
21 #include "chrome/common/notification_source.h" | 20 #include "chrome/common/notification_source.h" |
| 21 #include "content/browser/tab_contents/infobar_delegate.h" |
22 #include "third_party/skia/include/core/SkPaint.h" | 22 #include "third_party/skia/include/core/SkPaint.h" |
23 | 23 |
24 namespace { | 24 namespace { |
25 | 25 |
26 static const char* kInfoBar = "info-bar"; | 26 static const char* kInfoBar = "info-bar"; |
27 | 27 |
28 // If |infobar_widget| matches |info_bar_delegate|, then close the infobar. | 28 // If |infobar_widget| matches |info_bar_delegate|, then close the infobar. |
29 void AnimateClosingForDelegate(GtkWidget* infobar_widget, | 29 void AnimateClosingForDelegate(GtkWidget* infobar_widget, |
30 gpointer info_bar_delegate) { | 30 gpointer info_bar_delegate) { |
31 InfoBarDelegate* delegate = | 31 InfoBarDelegate* delegate = |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 } | 212 } |
213 | 213 |
214 void InfoBarContainerGtk::UpdateToolbarInfoBarState(InfoBar* infobar, | 214 void InfoBarContainerGtk::UpdateToolbarInfoBarState(InfoBar* infobar, |
215 bool animate) { | 215 bool animate) { |
216 GtkWindow* parent = platform_util::GetTopLevel(widget()); | 216 GtkWindow* parent = platform_util::GetTopLevel(widget()); |
217 BrowserWindowGtk* browser_window = | 217 BrowserWindowGtk* browser_window = |
218 BrowserWindowGtk::GetBrowserWindowForNativeWindow(parent); | 218 BrowserWindowGtk::GetBrowserWindowForNativeWindow(parent); |
219 if (browser_window) | 219 if (browser_window) |
220 browser_window->SetInfoBarShowing(infobar, animate); | 220 browser_window->SetInfoBarShowing(infobar, animate); |
221 } | 221 } |
OLD | NEW |