| 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 <algorithm> | 5 #include <algorithm> |
| 6 #include <string> | 6 #include <string> |
| 7 | 7 |
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "chrome/browser/infobars/infobar_tab_helper.h" | 9 #include "chrome/browser/infobars/infobar_tab_helper.h" |
| 10 #include "chrome/browser/ui/media_stream_infobar_delegate.h" | 10 #include "chrome/browser/ui/media_stream_infobar_delegate.h" |
| 11 #include "chrome/browser/ui/views/infobars/media_stream_infobar.h" | 11 #include "chrome/browser/ui/views/infobars/media_stream_infobar.h" |
| 12 #include "grit/generated_resources.h" | 12 #include "grit/generated_resources.h" |
| 13 #include "ui/base/l10n/l10n_util.h" | 13 #include "ui/base/l10n/l10n_util.h" |
| 14 #include "ui/views/controls/button/menu_button.h" | 14 #include "ui/views/controls/button/menu_button.h" |
| 15 #include "ui/views/controls/label.h" | 15 #include "ui/views/controls/label.h" |
| 16 | 16 |
| 17 InfoBar* MediaStreamInfoBarDelegate::CreateInfoBar(InfoBarTabHelper* owner) { | 17 InfoBar* MediaStreamInfoBarDelegate::CreateInfoBar(InfoBarTabService* owner) { |
| 18 DCHECK(owner); | 18 DCHECK(owner); |
| 19 return new MediaStreamInfoBar(owner, this); | 19 return new MediaStreamInfoBar(static_cast<InfoBarTabHelper*>(owner), this); |
| 20 } | 20 } |
| 21 | 21 |
| 22 MediaStreamInfoBar::MediaStreamInfoBar( | 22 MediaStreamInfoBar::MediaStreamInfoBar( |
| 23 InfoBarTabHelper* owner, | 23 InfoBarTabHelper* owner, |
| 24 MediaStreamInfoBarDelegate* delegate) | 24 MediaStreamInfoBarDelegate* delegate) |
| 25 : InfoBarView(owner, delegate), | 25 : InfoBarView(owner, delegate), |
| 26 label_(NULL), | 26 label_(NULL), |
| 27 allow_button_(NULL), | 27 allow_button_(NULL), |
| 28 deny_button_(NULL), | 28 deny_button_(NULL), |
| 29 devices_menu_button_(NULL), | 29 devices_menu_button_(NULL), |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 if (!owned()) | 125 if (!owned()) |
| 126 return; // We're closing; don't call anything, it might access the owner. | 126 return; // We're closing; don't call anything, it might access the owner. |
| 127 DCHECK_EQ(devices_menu_button_, source); | 127 DCHECK_EQ(devices_menu_button_, source); |
| 128 RunMenuAt(&devices_menu_model_, devices_menu_button_, | 128 RunMenuAt(&devices_menu_model_, devices_menu_button_, |
| 129 views::MenuItemView::TOPRIGHT); | 129 views::MenuItemView::TOPRIGHT); |
| 130 } | 130 } |
| 131 | 131 |
| 132 MediaStreamInfoBarDelegate* MediaStreamInfoBar::GetDelegate() { | 132 MediaStreamInfoBarDelegate* MediaStreamInfoBar::GetDelegate() { |
| 133 return delegate()->AsMediaStreamInfoBarDelegate(); | 133 return delegate()->AsMediaStreamInfoBarDelegate(); |
| 134 } | 134 } |
| OLD | NEW |