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

Side by Side Diff: chrome/browser/geolocation/geolocation_permission_context_android.cc

Issue 2686463002: Add a source to the result of PermissionContextBase::GetPermissionStatus (Closed)
Patch Set: Add a source to the result of PermissionContextBase::GetPermissionStatus Created 3 years, 10 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
« no previous file with comments | « no previous file | chrome/browser/media/midi_permission_context_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/geolocation/geolocation_permission_context_android.h" 5 #include "chrome/browser/geolocation/geolocation_permission_context_android.h"
6 6
7 #include <utility> 7 #include <utility>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 PermissionDecided(id, requesting_frame_origin, 67 PermissionDecided(id, requesting_frame_origin,
68 web_contents->GetLastCommittedURL().GetOrigin(), 68 web_contents->GetLastCommittedURL().GetOrigin(),
69 user_gesture, callback, false /* persist */, 69 user_gesture, callback, false /* persist */,
70 CONTENT_SETTING_BLOCK); 70 CONTENT_SETTING_BLOCK);
71 return; 71 return;
72 } 72 }
73 73
74 GURL embedding_origin = web_contents->GetLastCommittedURL().GetOrigin(); 74 GURL embedding_origin = web_contents->GetLastCommittedURL().GetOrigin();
75 ContentSetting content_setting = 75 ContentSetting content_setting =
76 GeolocationPermissionContext::GetPermissionStatus(requesting_frame_origin, 76 GeolocationPermissionContext::GetPermissionStatus(requesting_frame_origin,
77 embedding_origin); 77 embedding_origin)
78 .content_setting;
78 std::vector<ContentSettingsType> content_settings_types; 79 std::vector<ContentSettingsType> content_settings_types;
79 content_settings_types.push_back(CONTENT_SETTINGS_TYPE_GEOLOCATION); 80 content_settings_types.push_back(CONTENT_SETTINGS_TYPE_GEOLOCATION);
80 if (content_setting == CONTENT_SETTING_ALLOW && 81 if (content_setting == CONTENT_SETTING_ALLOW &&
81 PermissionUpdateInfoBarDelegate::ShouldShowPermissionInfobar( 82 PermissionUpdateInfoBarDelegate::ShouldShowPermissionInfobar(
82 web_contents, content_settings_types)) { 83 web_contents, content_settings_types)) {
83 permission_update_infobar_ = PermissionUpdateInfoBarDelegate::Create( 84 permission_update_infobar_ = PermissionUpdateInfoBarDelegate::Create(
84 web_contents, content_settings_types, 85 web_contents, content_settings_types,
85 base::Bind( 86 base::Bind(
86 &GeolocationPermissionContextAndroid 87 &GeolocationPermissionContextAndroid
87 ::HandleUpdateAndroidPermissions, 88 ::HandleUpdateAndroidPermissions,
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 ? CONTENT_SETTING_ALLOW : CONTENT_SETTING_BLOCK; 147 ? CONTENT_SETTING_ALLOW : CONTENT_SETTING_BLOCK;
147 148
148 NotifyPermissionSet(id, requesting_frame_origin, embedding_origin, callback, 149 NotifyPermissionSet(id, requesting_frame_origin, embedding_origin, callback,
149 false /* persist */, new_setting); 150 false /* persist */, new_setting);
150 } 151 }
151 152
152 void GeolocationPermissionContextAndroid::SetLocationSettingsForTesting( 153 void GeolocationPermissionContextAndroid::SetLocationSettingsForTesting(
153 std::unique_ptr<LocationSettings> settings) { 154 std::unique_ptr<LocationSettings> settings) {
154 location_settings_ = std::move(settings); 155 location_settings_ = std::move(settings);
155 } 156 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/media/midi_permission_context_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698