Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(229)

Side by Side Diff: chrome/browser/media/protected_media_identifier_infobar_delegate.cc

Issue 1260033005: Revert of Move net::FormatUrl and friends outside of //net and into //components (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/browser/permissions/permission_queue_controller.h" 8 #include "chrome/browser/permissions/permission_queue_controller.h"
9 #include "chrome/browser/permissions/permission_request_id.h" 9 #include "chrome/browser/permissions/permission_request_id.h"
10 #include "chrome/common/url_constants.h" 10 #include "chrome/common/url_constants.h"
11 #include "chrome/grit/generated_resources.h" 11 #include "chrome/grit/generated_resources.h"
12 #include "components/infobars/core/infobar.h" 12 #include "components/infobars/core/infobar.h"
13 #include "components/url_formatter/url_formatter.h"
14 #include "grit/components_strings.h" 13 #include "grit/components_strings.h"
15 #include "grit/theme_resources.h" 14 #include "grit/theme_resources.h"
15 #include "net/base/net_util.h"
16 #include "ui/base/l10n/l10n_util.h" 16 #include "ui/base/l10n/l10n_util.h"
17 17
18 // static 18 // static
19 infobars::InfoBar* ProtectedMediaIdentifierInfoBarDelegate::Create( 19 infobars::InfoBar* ProtectedMediaIdentifierInfoBarDelegate::Create(
20 InfoBarService* infobar_service, 20 InfoBarService* infobar_service,
21 PermissionQueueController* controller, 21 PermissionQueueController* controller,
22 const PermissionRequestID& id, 22 const PermissionRequestID& id,
23 const GURL& requesting_frame, 23 const GURL& requesting_frame,
24 const std::string& display_languages) { 24 const std::string& display_languages) {
25 return infobar_service->AddInfoBar( 25 return infobar_service->AddInfoBar(
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 return IDR_INFOBAR_PROTECTED_MEDIA_IDENTIFIER; 70 return IDR_INFOBAR_PROTECTED_MEDIA_IDENTIFIER;
71 } 71 }
72 72
73 void ProtectedMediaIdentifierInfoBarDelegate::InfoBarDismissed() { 73 void ProtectedMediaIdentifierInfoBarDelegate::InfoBarDismissed() {
74 SetPermission(false, false); 74 SetPermission(false, false);
75 } 75 }
76 76
77 base::string16 ProtectedMediaIdentifierInfoBarDelegate::GetMessageText() const { 77 base::string16 ProtectedMediaIdentifierInfoBarDelegate::GetMessageText() const {
78 return l10n_util::GetStringFUTF16( 78 return l10n_util::GetStringFUTF16(
79 IDS_PROTECTED_MEDIA_IDENTIFIER_INFOBAR_QUESTION, 79 IDS_PROTECTED_MEDIA_IDENTIFIER_INFOBAR_QUESTION,
80 url_formatter::FormatUrl(requesting_frame_.GetOrigin(), 80 net::FormatUrl(requesting_frame_.GetOrigin(), display_languages_));
81 display_languages_));
82 } 81 }
83 82
84 base::string16 ProtectedMediaIdentifierInfoBarDelegate::GetButtonLabel( 83 base::string16 ProtectedMediaIdentifierInfoBarDelegate::GetButtonLabel(
85 InfoBarButton button) const { 84 InfoBarButton button) const {
86 return l10n_util::GetStringUTF16((button == BUTTON_OK) ? 85 return l10n_util::GetStringUTF16((button == BUTTON_OK) ?
87 IDS_PROTECTED_MEDIA_IDENTIFIER_ALLOW_BUTTON : 86 IDS_PROTECTED_MEDIA_IDENTIFIER_ALLOW_BUTTON :
88 IDS_PROTECTED_MEDIA_IDENTIFIER_DENY_BUTTON); 87 IDS_PROTECTED_MEDIA_IDENTIFIER_DENY_BUTTON);
89 } 88 }
90 89
91 bool ProtectedMediaIdentifierInfoBarDelegate::Cancel() { 90 bool ProtectedMediaIdentifierInfoBarDelegate::Cancel() {
92 SetPermission(true, false); 91 SetPermission(true, false);
93 return true; 92 return true;
94 } 93 }
95 94
96 base::string16 ProtectedMediaIdentifierInfoBarDelegate::GetLinkText() const { 95 base::string16 ProtectedMediaIdentifierInfoBarDelegate::GetLinkText() const {
97 return l10n_util::GetStringUTF16(IDS_LEARN_MORE); 96 return l10n_util::GetStringUTF16(IDS_LEARN_MORE);
98 } 97 }
99 98
100 bool ProtectedMediaIdentifierInfoBarDelegate::LinkClicked( 99 bool ProtectedMediaIdentifierInfoBarDelegate::LinkClicked(
101 WindowOpenDisposition disposition) { 100 WindowOpenDisposition disposition) {
102 InfoBarService::WebContentsFromInfoBar(infobar()) 101 InfoBarService::WebContentsFromInfoBar(infobar())
103 ->OpenURL(content::OpenURLParams( 102 ->OpenURL(content::OpenURLParams(
104 GURL(chrome::kEnhancedPlaybackNotificationLearnMoreURL), 103 GURL(chrome::kEnhancedPlaybackNotificationLearnMoreURL),
105 content::Referrer(), 104 content::Referrer(),
106 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition, 105 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition,
107 ui::PAGE_TRANSITION_LINK, false)); 106 ui::PAGE_TRANSITION_LINK, false));
108 return false; // Do not dismiss the info bar. 107 return false; // Do not dismiss the info bar.
109 } 108 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698