OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/media_stream_infobar_gtk.h" | 5 #include "chrome/browser/ui/gtk/infobars/media_stream_infobar_gtk.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/browser/infobars/infobar_tab_helper.h" |
10 #include "chrome/browser/media/media_stream_devices_menu_model.h" | 11 #include "chrome/browser/media/media_stream_devices_menu_model.h" |
11 #include "chrome/browser/ui/gtk/gtk_util.h" | 12 #include "chrome/browser/ui/gtk/gtk_util.h" |
12 #include "chrome/browser/ui/media_stream_infobar_delegate.h" | 13 #include "chrome/browser/ui/media_stream_infobar_delegate.h" |
13 #include "grit/generated_resources.h" | 14 #include "grit/generated_resources.h" |
14 #include "ui/base/gtk/gtk_hig_constants.h" | 15 #include "ui/base/gtk/gtk_hig_constants.h" |
15 #include "ui/base/gtk/gtk_signal_registrar.h" | 16 #include "ui/base/gtk/gtk_signal_registrar.h" |
16 #include "ui/base/l10n/l10n_util.h" | 17 #include "ui/base/l10n/l10n_util.h" |
17 | 18 |
18 InfoBar* MediaStreamInfoBarDelegate::CreateInfoBar(InfoBarTabHelper* owner) { | 19 InfoBar* MediaStreamInfoBarDelegate::CreateInfoBar(InfoBarTabService* owner) { |
19 DCHECK(owner); | 20 DCHECK(owner); |
20 return new MediaStreamInfoBarGtk(owner, this); | 21 return new MediaStreamInfoBarGtk(static_cast<InfoBarTabHelper*>(owner), this); |
21 } | 22 } |
22 | 23 |
23 MediaStreamInfoBarGtk::MediaStreamInfoBarGtk( | 24 MediaStreamInfoBarGtk::MediaStreamInfoBarGtk( |
24 InfoBarTabHelper* owner, | 25 InfoBarTabHelper* owner, |
25 MediaStreamInfoBarDelegate* delegate) | 26 MediaStreamInfoBarDelegate* delegate) |
26 : InfoBarGtk(owner, delegate) { | 27 : InfoBarGtk(owner, delegate) { |
27 devices_menu_model_ = new MediaStreamDevicesMenuModel(delegate); | 28 devices_menu_model_ = new MediaStreamDevicesMenuModel(delegate); |
28 Init(); | 29 Init(); |
29 } | 30 } |
30 | 31 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 } | 89 } |
89 | 90 |
90 void MediaStreamInfoBarGtk::OnDenyButton(GtkWidget* widget) { | 91 void MediaStreamInfoBarGtk::OnDenyButton(GtkWidget* widget) { |
91 GetDelegate()->Deny(); | 92 GetDelegate()->Deny(); |
92 RemoveSelf(); | 93 RemoveSelf(); |
93 } | 94 } |
94 | 95 |
95 MediaStreamInfoBarDelegate* MediaStreamInfoBarGtk::GetDelegate() { | 96 MediaStreamInfoBarDelegate* MediaStreamInfoBarGtk::GetDelegate() { |
96 return delegate()->AsMediaStreamInfoBarDelegate(); | 97 return delegate()->AsMediaStreamInfoBarDelegate(); |
97 } | 98 } |
OLD | NEW |