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