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

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

Issue 2493013002: Replace the use of WindowAndroid with Tab in permissions code. (Closed)
Patch Set: Comments Created 4 years, 1 month 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 <utility> 7 #include <utility>
8 8
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 #include "chrome/browser/geolocation/geolocation_infobar_delegate_android.h" 10 #include "chrome/browser/geolocation/geolocation_infobar_delegate_android.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 PermissionInfoBarDelegate::~PermissionInfoBarDelegate() { 76 PermissionInfoBarDelegate::~PermissionInfoBarDelegate() {
77 if (!action_taken_) { 77 if (!action_taken_) {
78 PermissionUmaUtil::PermissionIgnored( 78 PermissionUmaUtil::PermissionIgnored(
79 permission_type_, 79 permission_type_,
80 user_gesture_ ? PermissionRequestGestureType::GESTURE 80 user_gesture_ ? PermissionRequestGestureType::GESTURE
81 : PermissionRequestGestureType::NO_GESTURE, 81 : PermissionRequestGestureType::NO_GESTURE,
82 requesting_origin_, profile_); 82 requesting_origin_, profile_);
83 } 83 }
84 } 84 }
85 85
86 std::vector<int> PermissionInfoBarDelegate::content_settings() const { 86 std::vector<int> PermissionInfoBarDelegate::content_settings_types() const {
87 return std::vector<int>{content_settings_type_}; 87 return std::vector<int>{content_settings_type_};
88 } 88 }
89 89
90 bool PermissionInfoBarDelegate::ShouldShowPersistenceToggle() const { 90 bool PermissionInfoBarDelegate::ShouldShowPersistenceToggle() const {
91 return (permission_type_ == content::PermissionType::GEOLOCATION || 91 return (permission_type_ == content::PermissionType::GEOLOCATION ||
92 permission_type_ == content::PermissionType::AUDIO_CAPTURE || 92 permission_type_ == content::PermissionType::AUDIO_CAPTURE ||
93 permission_type_ == content::PermissionType::VIDEO_CAPTURE) && 93 permission_type_ == content::PermissionType::VIDEO_CAPTURE) &&
94 PermissionUtil::ShouldShowPersistenceToggle(); 94 PermissionUtil::ShouldShowPersistenceToggle();
95 } 95 }
96 96
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 PermissionInfoBarDelegate* 160 PermissionInfoBarDelegate*
161 PermissionInfoBarDelegate::AsPermissionInfoBarDelegate() { 161 PermissionInfoBarDelegate::AsPermissionInfoBarDelegate() {
162 return this; 162 return this;
163 } 163 }
164 164
165 void PermissionInfoBarDelegate::SetPermission(bool update_content_setting, 165 void PermissionInfoBarDelegate::SetPermission(bool update_content_setting,
166 PermissionAction decision) { 166 PermissionAction decision) {
167 action_taken_ = true; 167 action_taken_ = true;
168 callback_.Run(update_content_setting, decision); 168 callback_.Run(update_content_setting, decision);
169 } 169 }
OLDNEW
« no previous file with comments | « chrome/browser/permissions/permission_infobar_delegate.h ('k') | chrome/browser/ui/android/infobars/confirm_infobar.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698