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

Side by Side Diff: chrome/browser/permissions/permission_infobar_delegate.cc

Issue 2341953004: Decouple MediaStreamInfoBarDelegate from GroupedPermissionInfoBarDelegate (Closed)
Patch Set: Created 4 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/permissions/permission_infobar_delegate.h" 5 #include "chrome/browser/permissions/permission_infobar_delegate.h"
6 6
7 #include "chrome/browser/permissions/permission_decision_auto_blocker.h" 7 #include "chrome/browser/permissions/permission_decision_auto_blocker.h"
8 #include "chrome/browser/permissions/permission_request.h" 8 #include "chrome/browser/permissions/permission_request.h"
9 #include "chrome/browser/permissions/permission_uma_util.h" 9 #include "chrome/browser/permissions/permission_uma_util.h"
10 #include "chrome/grit/generated_resources.h" 10 #include "chrome/grit/generated_resources.h"
(...skipping 19 matching lines...) Expand all
30 const PermissionSetCallback& callback) 30 const PermissionSetCallback& callback)
31 : requesting_origin_(requesting_origin), 31 : requesting_origin_(requesting_origin),
32 permission_type_(permission_type), 32 permission_type_(permission_type),
33 content_settings_type_(content_settings_type), 33 content_settings_type_(content_settings_type),
34 profile_(profile), 34 profile_(profile),
35 callback_(callback), 35 callback_(callback),
36 action_taken_(false), 36 action_taken_(false),
37 user_gesture_(user_gesture), 37 user_gesture_(user_gesture),
38 persist_(true) {} 38 persist_(true) {}
39 39
40 std::vector<int> PermissionInfoBarDelegate::content_setting() const {
dominickn 2016/09/20 08:01:36 Nit: it's strange to have a singular content_setti
lshang 2016/09/21 03:47:39 Done.
41 return std::vector<int>(1, content_settings_type_);
42 }
43
40 bool PermissionInfoBarDelegate::ShouldShowPersistenceToggle() const { 44 bool PermissionInfoBarDelegate::ShouldShowPersistenceToggle() const {
41 return (permission_type_ == content::PermissionType::GEOLOCATION) && 45 return (permission_type_ == content::PermissionType::GEOLOCATION) &&
42 PermissionUtil::ShouldShowPersistenceToggle(); 46 PermissionUtil::ShouldShowPersistenceToggle();
43 } 47 }
44 48
45 base::string16 PermissionInfoBarDelegate::GetMessageText() const { 49 base::string16 PermissionInfoBarDelegate::GetMessageText() const {
46 return l10n_util::GetStringFUTF16( 50 return l10n_util::GetStringFUTF16(
47 GetMessageResourceId(), 51 GetMessageResourceId(),
48 url_formatter::FormatUrlForSecurityDisplay( 52 url_formatter::FormatUrlForSecurityDisplay(
49 requesting_origin_, 53 requesting_origin_,
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 96
93 SetPermission(update_content_setting, DENIED); 97 SetPermission(update_content_setting, DENIED);
94 return true; 98 return true;
95 } 99 }
96 100
97 void PermissionInfoBarDelegate::SetPermission(bool update_content_setting, 101 void PermissionInfoBarDelegate::SetPermission(bool update_content_setting,
98 PermissionAction decision) { 102 PermissionAction decision) {
99 action_taken_ = true; 103 action_taken_ = true;
100 callback_.Run(update_content_setting, decision); 104 callback_.Run(update_content_setting, decision);
101 } 105 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698