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

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

Issue 371263003: Add tests for the permission context class (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Bernhard's comments Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/content_settings/permission_context_base_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 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/content_settings/permission_context_base.h" 5 #include "chrome/browser/content_settings/permission_context_base.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/prefs/pref_service.h" 9 #include "base/prefs/pref_service.h"
10 #include "chrome/browser/content_settings/host_content_settings_map.h" 10 #include "chrome/browser/content_settings/host_content_settings_map.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 NotifyPermissionSet(id, requesting_origin, embedder_origin, 84 NotifyPermissionSet(id, requesting_origin, embedder_origin,
85 callback, false /* persist */, false /* granted */); 85 callback, false /* persist */, false /* granted */);
86 return; 86 return;
87 case CONTENT_SETTING_ALLOW: 87 case CONTENT_SETTING_ALLOW:
88 NotifyPermissionSet(id, requesting_origin, embedder_origin, 88 NotifyPermissionSet(id, requesting_origin, embedder_origin,
89 callback, false /* persist */, true /* granted */); 89 callback, false /* persist */, true /* granted */);
90 return; 90 return;
91 default: 91 default:
92 break; 92 break;
93 } 93 }
94
Bernhard Bauer 2014/07/08 15:31:20 Can you revert this change now that this CL doesn'
95 UMA_HISTOGRAM_ENUMERATION("ContentSettings.PermissionRequested", 94 UMA_HISTOGRAM_ENUMERATION("ContentSettings.PermissionRequested",
96 SettingToPermission(permission_type_), 95 SettingToPermission(permission_type_),
97 PERMISSION_NUM); 96 PERMISSION_NUM);
98 97
99 if (PermissionBubbleManager::Enabled()) { 98 if (PermissionBubbleManager::Enabled()) {
100 PermissionBubbleManager* bubble_manager = 99 PermissionBubbleManager* bubble_manager =
101 PermissionBubbleManager::FromWebContents(web_contents); 100 PermissionBubbleManager::FromWebContents(web_contents);
102 DCHECK(bubble_manager); 101 DCHECK(bubble_manager);
103 scoped_ptr<PermissionBubbleRequest> request_ptr( 102 scoped_ptr<PermissionBubbleRequest> request_ptr(
104 new PermissionBubbleRequestImpl( 103 new PermissionBubbleRequestImpl(
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 DCHECK_EQ(embedder_origin, embedder_origin.GetOrigin()); 193 DCHECK_EQ(embedder_origin, embedder_origin.GetOrigin());
195 ContentSetting content_setting = 194 ContentSetting content_setting =
196 allowed ? CONTENT_SETTING_ALLOW : CONTENT_SETTING_BLOCK; 195 allowed ? CONTENT_SETTING_ALLOW : CONTENT_SETTING_BLOCK;
197 profile_->GetHostContentSettingsMap()->SetContentSetting( 196 profile_->GetHostContentSettingsMap()->SetContentSetting(
198 ContentSettingsPattern::FromURLNoWildcard(requesting_origin), 197 ContentSettingsPattern::FromURLNoWildcard(requesting_origin),
199 ContentSettingsPattern::FromURLNoWildcard(embedder_origin), 198 ContentSettingsPattern::FromURLNoWildcard(embedder_origin),
200 permission_type_, 199 permission_type_,
201 std::string(), 200 std::string(),
202 content_setting); 201 content_setting);
203 } 202 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/content_settings/permission_context_base_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698