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/content_settings/permission_queue_controller.h" | 7 #include "chrome/browser/content_settings/permission_queue_controller.h" |
8 #include "chrome/browser/infobars/infobar_service.h" | 8 #include "chrome/browser/infobars/infobar_service.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" |
11 #include "content/public/browser/navigation_entry.h" | 11 #include "content/public/browser/navigation_entry.h" |
| 12 #include "grit/components_strings.h" |
12 #include "grit/theme_resources.h" | 13 #include "grit/theme_resources.h" |
13 #include "net/base/net_util.h" | 14 #include "net/base/net_util.h" |
14 #include "ui/base/l10n/l10n_util.h" | 15 #include "ui/base/l10n/l10n_util.h" |
15 | 16 |
16 #if defined(OS_ANDROID) | 17 #if defined(OS_ANDROID) |
17 #include "chrome/browser/android/chromium_application.h" | 18 #include "chrome/browser/android/chromium_application.h" |
18 #endif | 19 #endif |
19 | 20 |
| 21 #if defined(OS_CHROMEOS) |
| 22 #include "chrome/common/url_constants.h" |
| 23 #endif |
| 24 |
20 // static | 25 // static |
21 infobars::InfoBar* ProtectedMediaIdentifierInfoBarDelegate::Create( | 26 infobars::InfoBar* ProtectedMediaIdentifierInfoBarDelegate::Create( |
22 InfoBarService* infobar_service, | 27 InfoBarService* infobar_service, |
23 PermissionQueueController* controller, | 28 PermissionQueueController* controller, |
24 const PermissionRequestID& id, | 29 const PermissionRequestID& id, |
25 const GURL& requesting_frame, | 30 const GURL& requesting_frame, |
26 const std::string& display_languages) { | 31 const std::string& display_languages) { |
27 const content::NavigationEntry* committed_entry = | 32 const content::NavigationEntry* committed_entry = |
28 infobar_service->web_contents()->GetController().GetLastCommittedEntry(); | 33 infobar_service->web_contents()->GetController().GetLastCommittedEntry(); |
29 return infobar_service->AddInfoBar( | 34 return infobar_service->AddInfoBar( |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 bool ProtectedMediaIdentifierInfoBarDelegate::Cancel() { | 111 bool ProtectedMediaIdentifierInfoBarDelegate::Cancel() { |
107 SetPermission(true, false); | 112 SetPermission(true, false); |
108 return true; | 113 return true; |
109 } | 114 } |
110 | 115 |
111 base::string16 ProtectedMediaIdentifierInfoBarDelegate::GetLinkText() const { | 116 base::string16 ProtectedMediaIdentifierInfoBarDelegate::GetLinkText() const { |
112 #if defined(OS_ANDROID) | 117 #if defined(OS_ANDROID) |
113 return l10n_util::GetStringUTF16( | 118 return l10n_util::GetStringUTF16( |
114 IDS_PROTECTED_MEDIA_IDENTIFIER_SETTINGS_LINK); | 119 IDS_PROTECTED_MEDIA_IDENTIFIER_SETTINGS_LINK); |
115 #else | 120 #else |
116 NOTIMPLEMENTED(); | 121 return l10n_util::GetStringUTF16(IDS_LEARN_MORE); |
117 return base::string16(); | |
118 #endif | 122 #endif |
119 } | 123 } |
120 | 124 |
121 bool ProtectedMediaIdentifierInfoBarDelegate::LinkClicked( | 125 bool ProtectedMediaIdentifierInfoBarDelegate::LinkClicked( |
122 WindowOpenDisposition disposition) { | 126 WindowOpenDisposition disposition) { |
123 #if defined(OS_ANDROID) | 127 #if defined(OS_ANDROID) |
124 chrome::android::ChromiumApplication::OpenProtectedContentSettings(); | 128 chrome::android::ChromiumApplication::OpenProtectedContentSettings(); |
| 129 #elif defined(OS_CHROMEOS) |
| 130 const GURL learn_more_url(chrome::kEnhancedPlaybackNotificationLearnMoreURL); |
| 131 InfoBarService::WebContentsFromInfoBar(infobar()) |
| 132 ->OpenURL(content::OpenURLParams( |
| 133 learn_more_url, content::Referrer(), |
| 134 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition, |
| 135 ui::PAGE_TRANSITION_LINK, false)); |
125 #else | 136 #else |
126 NOTIMPLEMENTED(); | 137 NOTIMPLEMENTED(); |
127 #endif | 138 #endif |
128 return false; // Do not dismiss the info bar. | 139 return false; // Do not dismiss the info bar. |
129 } | 140 } |
OLD | NEW |