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

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

Issue 2697473002: Remove last usage functions from HostContentSettingsMap and clean up prefs (Closed)
Patch Set: adjust a comment 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
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_context_base.h" 5 #include "chrome/browser/permissions/permission_context_base.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 NotifyPermissionSet(id, requesting_origin, embedding_origin, callback, 102 NotifyPermissionSet(id, requesting_origin, embedding_origin, callback,
103 false /* persist */, CONTENT_SETTING_BLOCK); 103 false /* persist */, CONTENT_SETTING_BLOCK);
104 return; 104 return;
105 } 105 }
106 106
107 // Synchronously check the content setting to see if the user has already made 107 // Synchronously check the content setting to see if the user has already made
108 // a decision, or if the origin is under embargo. If so, respect that 108 // a decision, or if the origin is under embargo. If so, respect that
109 // decision. 109 // decision.
110 ContentSetting content_setting = 110 ContentSetting content_setting =
111 GetPermissionStatus(requesting_origin, embedding_origin); 111 GetPermissionStatus(requesting_origin, embedding_origin);
112 if (content_setting == CONTENT_SETTING_ALLOW) {
113 HostContentSettingsMapFactory::GetForProfile(profile_)->UpdateLastUsage(
114 requesting_origin, embedding_origin, content_settings_storage_type());
115 }
116 112
117 if (content_setting == CONTENT_SETTING_ALLOW || 113 if (content_setting == CONTENT_SETTING_ALLOW ||
118 content_setting == CONTENT_SETTING_BLOCK) { 114 content_setting == CONTENT_SETTING_BLOCK) {
119 NotifyPermissionSet(id, requesting_origin, embedding_origin, callback, 115 NotifyPermissionSet(id, requesting_origin, embedding_origin, callback,
120 false /* persist */, content_setting); 116 false /* persist */, content_setting);
121 return; 117 return;
122 } 118 }
123 119
124 // Asynchronously check whether the origin should be blocked from making this 120 // Asynchronously check whether the origin should be blocked from making this
125 // permission request. It may be on the Safe Browsing API blacklist, or it may 121 // permission request. It may be on the Safe Browsing API blacklist, or it may
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 content_settings_storage_type(), 368 content_settings_storage_type(),
373 std::string(), content_setting); 369 std::string(), content_setting);
374 } 370 }
375 371
376 ContentSettingsType PermissionContextBase::content_settings_storage_type() 372 ContentSettingsType PermissionContextBase::content_settings_storage_type()
377 const { 373 const {
378 if (content_settings_type_ == CONTENT_SETTINGS_TYPE_PUSH_MESSAGING) 374 if (content_settings_type_ == CONTENT_SETTINGS_TYPE_PUSH_MESSAGING)
379 return CONTENT_SETTINGS_TYPE_NOTIFICATIONS; 375 return CONTENT_SETTINGS_TYPE_NOTIFICATIONS;
380 return content_settings_type_; 376 return content_settings_type_;
381 } 377 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698