| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/protected_media_identifier_infobar_delegate_andro
id.h" | 5 #include "chrome/browser/media/protected_media_identifier_infobar_delegate_andro
id.h" |
| 6 | 6 |
| 7 #include "chrome/browser/android/android_theme_resources.h" | 7 #include "chrome/browser/android/android_theme_resources.h" |
| 8 #include "chrome/browser/infobars/infobar_service.h" | 8 #include "chrome/browser/infobars/infobar_service.h" |
| 9 #include "chrome/common/url_constants.h" | 9 #include "chrome/common/url_constants.h" |
| 10 #include "chrome/grit/generated_resources.h" | 10 #include "chrome/grit/generated_resources.h" |
| 11 #include "components/infobars/core/infobar.h" | 11 #include "components/infobars/core/infobar.h" |
| 12 #include "components/url_formatter/elide_url.h" | |
| 13 #include "grit/components_strings.h" | 12 #include "grit/components_strings.h" |
| 14 #include "ui/base/l10n/l10n_util.h" | 13 #include "ui/base/l10n/l10n_util.h" |
| 15 | 14 |
| 16 // static | 15 // static |
| 17 infobars::InfoBar* ProtectedMediaIdentifierInfoBarDelegateAndroid::Create( | 16 infobars::InfoBar* ProtectedMediaIdentifierInfoBarDelegateAndroid::Create( |
| 18 InfoBarService* infobar_service, | 17 InfoBarService* infobar_service, |
| 19 const GURL& requesting_frame, | 18 const GURL& requesting_frame, |
| 20 const PermissionSetCallback& callback) { | 19 const PermissionSetCallback& callback) { |
| 21 return infobar_service->AddInfoBar(infobar_service->CreateConfirmInfoBar( | 20 return infobar_service->AddInfoBar(infobar_service->CreateConfirmInfoBar( |
| 22 std::unique_ptr<ConfirmInfoBarDelegate>( | 21 std::unique_ptr<ConfirmInfoBarDelegate>( |
| (...skipping 17 matching lines...) Expand all Loading... |
| 40 | 39 |
| 41 infobars::InfoBarDelegate::InfoBarIdentifier | 40 infobars::InfoBarDelegate::InfoBarIdentifier |
| 42 ProtectedMediaIdentifierInfoBarDelegateAndroid::GetIdentifier() const { | 41 ProtectedMediaIdentifierInfoBarDelegateAndroid::GetIdentifier() const { |
| 43 return PROTECTED_MEDIA_IDENTIFIER_INFOBAR_DELEGATE_ANDROID; | 42 return PROTECTED_MEDIA_IDENTIFIER_INFOBAR_DELEGATE_ANDROID; |
| 44 } | 43 } |
| 45 | 44 |
| 46 int ProtectedMediaIdentifierInfoBarDelegateAndroid::GetIconId() const { | 45 int ProtectedMediaIdentifierInfoBarDelegateAndroid::GetIconId() const { |
| 47 return IDR_ANDROID_INFOBAR_PROTECTED_MEDIA_IDENTIFIER; | 46 return IDR_ANDROID_INFOBAR_PROTECTED_MEDIA_IDENTIFIER; |
| 48 } | 47 } |
| 49 | 48 |
| 50 base::string16 ProtectedMediaIdentifierInfoBarDelegateAndroid::GetMessageText() | 49 int ProtectedMediaIdentifierInfoBarDelegateAndroid::GetMessageResourceId() |
| 51 const { | 50 const { |
| 52 return l10n_util::GetStringFUTF16( | 51 return IDS_PROTECTED_MEDIA_IDENTIFIER_INFOBAR_QUESTION; |
| 53 IDS_PROTECTED_MEDIA_IDENTIFIER_INFOBAR_QUESTION, | |
| 54 url_formatter::FormatUrlForSecurityDisplay(requesting_frame_)); | |
| 55 } | 52 } |
| 56 | 53 |
| 57 base::string16 ProtectedMediaIdentifierInfoBarDelegateAndroid::GetLinkText() | 54 base::string16 ProtectedMediaIdentifierInfoBarDelegateAndroid::GetLinkText() |
| 58 const { | 55 const { |
| 59 return l10n_util::GetStringUTF16(IDS_LEARN_MORE); | 56 return l10n_util::GetStringUTF16(IDS_LEARN_MORE); |
| 60 } | 57 } |
| 61 | 58 |
| 62 GURL ProtectedMediaIdentifierInfoBarDelegateAndroid::GetLinkURL() const { | 59 GURL ProtectedMediaIdentifierInfoBarDelegateAndroid::GetLinkURL() const { |
| 63 return GURL(chrome::kEnhancedPlaybackNotificationLearnMoreURL); | 60 return GURL(chrome::kEnhancedPlaybackNotificationLearnMoreURL); |
| 64 } | 61 } |
| OLD | NEW |