| 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" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 views::View* child) { | 63 views::View* child) { |
| 64 if (is_add && child == this && (label_ == NULL)) { | 64 if (is_add && child == this && (label_ == NULL)) { |
| 65 int message_id = IDS_MEDIA_CAPTURE_AUDIO_AND_VIDEO; | 65 int message_id = IDS_MEDIA_CAPTURE_AUDIO_AND_VIDEO; |
| 66 DCHECK(GetDelegate()->HasAudio() || GetDelegate()->HasVideo()); | 66 DCHECK(GetDelegate()->HasAudio() || GetDelegate()->HasVideo()); |
| 67 if (!GetDelegate()->HasAudio()) | 67 if (!GetDelegate()->HasAudio()) |
| 68 message_id = IDS_MEDIA_CAPTURE_VIDEO_ONLY; | 68 message_id = IDS_MEDIA_CAPTURE_VIDEO_ONLY; |
| 69 else if (!GetDelegate()->HasVideo()) | 69 else if (!GetDelegate()->HasVideo()) |
| 70 message_id = IDS_MEDIA_CAPTURE_AUDIO_ONLY; | 70 message_id = IDS_MEDIA_CAPTURE_AUDIO_ONLY; |
| 71 | 71 |
| 72 label_ = CreateLabel(l10n_util::GetStringFUTF16(message_id, | 72 label_ = CreateLabel(l10n_util::GetStringFUTF16(message_id, |
| 73 UTF8ToUTF16(GetDelegate()->GetSecurityOrigin().spec()))); | 73 UTF8ToUTF16(GetDelegate()->GetSecurityOriginSpec()))); |
| 74 AddChildView(label_); | 74 AddChildView(label_); |
| 75 | 75 |
| 76 allow_button_ = CreateTextButton(this, | 76 allow_button_ = CreateTextButton(this, |
| 77 l10n_util::GetStringUTF16(IDS_MEDIA_CAPTURE_ALLOW), false); | 77 l10n_util::GetStringUTF16(IDS_MEDIA_CAPTURE_ALLOW), false); |
| 78 AddChildView(allow_button_); | 78 AddChildView(allow_button_); |
| 79 | 79 |
| 80 deny_button_ = CreateTextButton(this, | 80 deny_button_ = CreateTextButton(this, |
| 81 l10n_util::GetStringUTF16(IDS_MEDIA_CAPTURE_DENY), false); | 81 l10n_util::GetStringUTF16(IDS_MEDIA_CAPTURE_DENY), false); |
| 82 AddChildView(deny_button_); | 82 AddChildView(deny_button_); |
| 83 | 83 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 if (!owned()) | 119 if (!owned()) |
| 120 return; // We're closing; don't call anything, it might access the owner. | 120 return; // We're closing; don't call anything, it might access the owner. |
| 121 DCHECK_EQ(devices_menu_button_, source); | 121 DCHECK_EQ(devices_menu_button_, source); |
| 122 RunMenuAt(&devices_menu_model_, devices_menu_button_, | 122 RunMenuAt(&devices_menu_model_, devices_menu_button_, |
| 123 views::MenuItemView::TOPRIGHT); | 123 views::MenuItemView::TOPRIGHT); |
| 124 } | 124 } |
| 125 | 125 |
| 126 MediaStreamInfoBarDelegate* MediaStreamInfoBar::GetDelegate() { | 126 MediaStreamInfoBarDelegate* MediaStreamInfoBar::GetDelegate() { |
| 127 return delegate()->AsMediaStreamInfoBarDelegate(); | 127 return delegate()->AsMediaStreamInfoBarDelegate(); |
| 128 } | 128 } |
| OLD | NEW |