| 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/media/media_stream_infobar_delegate.h" | 5 #include "chrome/browser/media/media_stream_infobar_delegate.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "chrome/browser/google/google_util.h" | 9 #include "chrome/browser/google/google_util.h" |
| 10 #include "chrome/browser/infobars/infobar_service.h" | 10 #include "chrome/browser/infobars/infobar_service.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 DCHECK(controller_.get()); | 55 DCHECK(controller_.get()); |
| 56 DCHECK(controller_->has_audio() || controller_->has_video()); | 56 DCHECK(controller_->has_audio() || controller_->has_video()); |
| 57 } | 57 } |
| 58 | 58 |
| 59 void MediaStreamInfoBarDelegate::InfoBarDismissed() { | 59 void MediaStreamInfoBarDelegate::InfoBarDismissed() { |
| 60 // Deny the request if the infobar was closed with the 'x' button, since | 60 // Deny the request if the infobar was closed with the 'x' button, since |
| 61 // we don't want WebRTC to be waiting for an answer that will never come. | 61 // we don't want WebRTC to be waiting for an answer that will never come. |
| 62 controller_->Deny(false); | 62 controller_->Deny(false); |
| 63 } | 63 } |
| 64 | 64 |
| 65 gfx::Image* MediaStreamInfoBarDelegate::GetIcon() const { | 65 int MediaStreamInfoBarDelegate::GetIconID() const { |
| 66 return &ResourceBundle::GetSharedInstance().GetNativeImageNamed( | 66 return controller_->has_video() ? |
| 67 controller_->has_video() ? | 67 IDR_INFOBAR_MEDIA_STREAM_CAMERA : IDR_INFOBAR_MEDIA_STREAM_MIC; |
| 68 IDR_INFOBAR_MEDIA_STREAM_CAMERA : IDR_INFOBAR_MEDIA_STREAM_MIC); | |
| 69 } | 68 } |
| 70 | 69 |
| 71 InfoBarDelegate::Type MediaStreamInfoBarDelegate::GetInfoBarType() const { | 70 InfoBarDelegate::Type MediaStreamInfoBarDelegate::GetInfoBarType() const { |
| 72 return PAGE_ACTION_TYPE; | 71 return PAGE_ACTION_TYPE; |
| 73 } | 72 } |
| 74 | 73 |
| 75 MediaStreamInfoBarDelegate* | 74 MediaStreamInfoBarDelegate* |
| 76 MediaStreamInfoBarDelegate::AsMediaStreamInfoBarDelegate() { | 75 MediaStreamInfoBarDelegate::AsMediaStreamInfoBarDelegate() { |
| 77 return this; | 76 return this; |
| 78 } | 77 } |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 google_util::AppendGoogleLocaleParam( | 112 google_util::AppendGoogleLocaleParam( |
| 114 GURL(chrome::kMediaAccessLearnMoreUrl)), | 113 GURL(chrome::kMediaAccessLearnMoreUrl)), |
| 115 content::Referrer(), | 114 content::Referrer(), |
| 116 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition, | 115 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition, |
| 117 content::PAGE_TRANSITION_LINK, | 116 content::PAGE_TRANSITION_LINK, |
| 118 false); | 117 false); |
| 119 web_contents()->OpenURL(params); | 118 web_contents()->OpenURL(params); |
| 120 | 119 |
| 121 return false; // Do not dismiss the info bar. | 120 return false; // Do not dismiss the info bar. |
| 122 } | 121 } |
| OLD | NEW |