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

Side by Side Diff: chrome/browser/content_settings/host_content_settings_map.cc

Issue 356543003: Audit the last usage of Geolocation and Notification permissions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 6 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/content_settings/host_content_settings_map.h" 5 #include "chrome/browser/content_settings/host_content_settings_map.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 base::Value* value = NULL; 301 base::Value* value = NULL;
302 if (setting != CONTENT_SETTING_DEFAULT) 302 if (setting != CONTENT_SETTING_DEFAULT)
303 value = base::Value::CreateIntegerValue(setting); 303 value = base::Value::CreateIntegerValue(setting);
304 SetWebsiteSetting(primary_pattern, 304 SetWebsiteSetting(primary_pattern,
305 secondary_pattern, 305 secondary_pattern,
306 content_type, 306 content_type,
307 resource_identifier, 307 resource_identifier,
308 value); 308 value);
309 } 309 }
310 310
311 void HostContentSettingsMap::UpdateLastUsage(const GURL& primary_url,
312 const GURL& secondary_url,
313 ContentSettingsType content_type) {
314 static_cast<content_settings::PrefProvider*>(
315 content_settings_providers_[PREF_PROVIDER])
316 ->UpdateLastUsage(ContentSettingsPattern::FromURLNoWildcard(primary_url),
317 ContentSettingsPattern::Wildcard(),
318 content_type);
319 }
320
311 void HostContentSettingsMap::AddExceptionForURL( 321 void HostContentSettingsMap::AddExceptionForURL(
312 const GURL& primary_url, 322 const GURL& primary_url,
313 const GURL& secondary_url, 323 const GURL& secondary_url,
314 ContentSettingsType content_type, 324 ContentSettingsType content_type,
315 ContentSetting setting) { 325 ContentSetting setting) {
316 // TODO(markusheintz): Until the UI supports pattern pairs, both urls must 326 // TODO(markusheintz): Until the UI supports pattern pairs, both urls must
317 // match. 327 // match.
318 DCHECK(primary_url == secondary_url); 328 DCHECK(primary_url == secondary_url);
319 DCHECK(!ContentTypeHasCompoundValue(content_type)); 329 DCHECK(!ContentTypeHasCompoundValue(content_type));
320 330
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
631 HostContentSettingsMap::GetProviderTypeFromSource( 641 HostContentSettingsMap::GetProviderTypeFromSource(
632 const std::string& source) { 642 const std::string& source) {
633 for (size_t i = 0; i < arraysize(kProviderNames); ++i) { 643 for (size_t i = 0; i < arraysize(kProviderNames); ++i) {
634 if (source == kProviderNames[i]) 644 if (source == kProviderNames[i])
635 return static_cast<ProviderType>(i); 645 return static_cast<ProviderType>(i);
636 } 646 }
637 647
638 NOTREACHED(); 648 NOTREACHED();
639 return DEFAULT_PROVIDER; 649 return DEFAULT_PROVIDER;
640 } 650 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698