| 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.h" | 5 #include "chrome/browser/media/protected_media_identifier_infobar_delegate.h" |
| 6 | 6 |
| 7 #include "chrome/browser/infobars/infobar_service.h" | 7 #include "chrome/browser/infobars/infobar_service.h" |
| 8 #include "chrome/common/url_constants.h" | 8 #include "chrome/common/url_constants.h" |
| 9 #include "chrome/grit/generated_resources.h" | 9 #include "chrome/grit/generated_resources.h" |
| 10 #include "components/infobars/core/infobar.h" | 10 #include "components/infobars/core/infobar.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 return l10n_util::GetStringFUTF16( | 50 return l10n_util::GetStringFUTF16( |
| 51 IDS_PROTECTED_MEDIA_IDENTIFIER_INFOBAR_QUESTION, | 51 IDS_PROTECTED_MEDIA_IDENTIFIER_INFOBAR_QUESTION, |
| 52 url_formatter::FormatUrlForSecurityDisplay(requesting_frame_, | 52 url_formatter::FormatUrlForSecurityDisplay(requesting_frame_, |
| 53 display_languages_)); | 53 display_languages_)); |
| 54 } | 54 } |
| 55 | 55 |
| 56 base::string16 ProtectedMediaIdentifierInfoBarDelegate::GetLinkText() const { | 56 base::string16 ProtectedMediaIdentifierInfoBarDelegate::GetLinkText() const { |
| 57 return l10n_util::GetStringUTF16(IDS_LEARN_MORE); | 57 return l10n_util::GetStringUTF16(IDS_LEARN_MORE); |
| 58 } | 58 } |
| 59 | 59 |
| 60 bool ProtectedMediaIdentifierInfoBarDelegate::LinkClicked( | 60 GURL ProtectedMediaIdentifierInfoBarDelegate::GetLinkURL() const { |
| 61 WindowOpenDisposition disposition) { | 61 return GURL(chrome::kEnhancedPlaybackNotificationLearnMoreURL); |
| 62 InfoBarService::WebContentsFromInfoBar(infobar()) | |
| 63 ->OpenURL(content::OpenURLParams( | |
| 64 GURL(chrome::kEnhancedPlaybackNotificationLearnMoreURL), | |
| 65 content::Referrer(), | |
| 66 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition, | |
| 67 ui::PAGE_TRANSITION_LINK, false)); | |
| 68 return false; // Do not dismiss the info bar. | |
| 69 } | 62 } |
| OLD | NEW |