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

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

Issue 1332293002: permissions: switch from explicitly passing queue controller to callbacks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review comments and rebase on ProtectedMedia cleanup Created 5 years, 3 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"
9 #include "chrome/browser/permissions/permission_request_id.h" 8 #include "chrome/browser/permissions/permission_request_id.h"
mlamouri (slow - plz ping) 2015/09/15 17:26:42 nit: remove this include.
10 #include "chrome/common/url_constants.h" 9 #include "chrome/common/url_constants.h"
11 #include "chrome/grit/generated_resources.h" 10 #include "chrome/grit/generated_resources.h"
12 #include "components/infobars/core/infobar.h" 11 #include "components/infobars/core/infobar.h"
13 #include "components/url_formatter/url_formatter.h" 12 #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"
16 #include "ui/base/l10n/l10n_util.h" 15 #include "ui/base/l10n/l10n_util.h"
17 16
18 // static 17 // static
19 infobars::InfoBar* ProtectedMediaIdentifierInfoBarDelegate::Create( 18 infobars::InfoBar* ProtectedMediaIdentifierInfoBarDelegate::Create(
20 InfoBarService* infobar_service, 19 InfoBarService* infobar_service,
21 PermissionQueueController* controller,
22 const PermissionRequestID& id,
23 const GURL& requesting_frame, 20 const GURL& requesting_frame,
24 const std::string& display_languages) { 21 const std::string& display_languages,
22 const PermissionSetCallback& callback) {
25 return infobar_service->AddInfoBar(infobar_service->CreateConfirmInfoBar( 23 return infobar_service->AddInfoBar(infobar_service->CreateConfirmInfoBar(
26 scoped_ptr<ConfirmInfoBarDelegate>( 24 scoped_ptr<ConfirmInfoBarDelegate>(
27 new ProtectedMediaIdentifierInfoBarDelegate( 25 new ProtectedMediaIdentifierInfoBarDelegate(
28 controller, id, requesting_frame, display_languages)))); 26 requesting_frame, display_languages, callback))));
29 } 27 }
30 28
31 ProtectedMediaIdentifierInfoBarDelegate:: 29 ProtectedMediaIdentifierInfoBarDelegate::
32 ProtectedMediaIdentifierInfoBarDelegate( 30 ProtectedMediaIdentifierInfoBarDelegate(
33 PermissionQueueController* controller,
34 const PermissionRequestID& id,
35 const GURL& requesting_frame, 31 const GURL& requesting_frame,
36 const std::string& display_languages) 32 const std::string& display_languages,
33 const PermissionSetCallback& callback)
37 : PermissionInfobarDelegate( 34 : PermissionInfobarDelegate(
38 controller, id, requesting_frame, 35 requesting_frame,
39 CONTENT_SETTINGS_TYPE_PROTECTED_MEDIA_IDENTIFIER), 36 CONTENT_SETTINGS_TYPE_PROTECTED_MEDIA_IDENTIFIER,
37 callback),
40 requesting_frame_(requesting_frame), 38 requesting_frame_(requesting_frame),
41 display_languages_(display_languages) { 39 display_languages_(display_languages) {
42 } 40 }
43 41
44 ProtectedMediaIdentifierInfoBarDelegate:: 42 ProtectedMediaIdentifierInfoBarDelegate::
45 ~ProtectedMediaIdentifierInfoBarDelegate() { 43 ~ProtectedMediaIdentifierInfoBarDelegate() {
46 } 44 }
47 45
48 int ProtectedMediaIdentifierInfoBarDelegate::GetIconId() const { 46 int ProtectedMediaIdentifierInfoBarDelegate::GetIconId() const {
49 return IDR_INFOBAR_PROTECTED_MEDIA_IDENTIFIER; 47 return IDR_INFOBAR_PROTECTED_MEDIA_IDENTIFIER;
(...skipping 13 matching lines...) Expand all
63 bool ProtectedMediaIdentifierInfoBarDelegate::LinkClicked( 61 bool ProtectedMediaIdentifierInfoBarDelegate::LinkClicked(
64 WindowOpenDisposition disposition) { 62 WindowOpenDisposition disposition) {
65 InfoBarService::WebContentsFromInfoBar(infobar()) 63 InfoBarService::WebContentsFromInfoBar(infobar())
66 ->OpenURL(content::OpenURLParams( 64 ->OpenURL(content::OpenURLParams(
67 GURL(chrome::kEnhancedPlaybackNotificationLearnMoreURL), 65 GURL(chrome::kEnhancedPlaybackNotificationLearnMoreURL),
68 content::Referrer(), 66 content::Referrer(),
69 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition, 67 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition,
70 ui::PAGE_TRANSITION_LINK, false)); 68 ui::PAGE_TRANSITION_LINK, false));
71 return false; // Do not dismiss the info bar. 69 return false; // Do not dismiss the info bar.
72 } 70 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698