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

Side by Side Diff: chrome/browser/ui/webui/options/content_settings_handler.cc

Issue 10977073: Delete some unused code found by -Wunused-function (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: leiz Created 8 years, 2 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
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/ui/webui/options/content_settings_handler.h" 5 #include "chrome/browser/ui/webui/options/content_settings_handler.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 const ContentSettingsPattern& pattern, 152 const ContentSettingsPattern& pattern,
153 ContentSetting setting, 153 ContentSetting setting,
154 const std::string& provider_name) { 154 const std::string& provider_name) {
155 DictionaryValue* exception = new DictionaryValue(); 155 DictionaryValue* exception = new DictionaryValue();
156 exception->SetString(kSetting, ContentSettingToString(setting)); 156 exception->SetString(kSetting, ContentSettingToString(setting));
157 exception->SetString(kOrigin, pattern.ToString()); 157 exception->SetString(kOrigin, pattern.ToString());
158 exception->SetString(kSource, provider_name); 158 exception->SetString(kSource, provider_name);
159 return exception; 159 return exception;
160 } 160 }
161 161
162 // Returns true whenever the hosted |app|'s extent enjoys protected storage
163 // under the current |profile|.
164 // Must have the AppFilter signature.
165 bool HasProtectedStorage(const extensions::Extension& app, Profile* profile) {
166 ExtensionSpecialStoragePolicy* policy =
167 profile->GetExtensionSpecialStoragePolicy();
168 return policy->NeedsProtection(&app);
169 }
170
171 // Returns true whenever the |extension| is hosted and has |permission|. 162 // Returns true whenever the |extension| is hosted and has |permission|.
172 // Must have the AppFilter signature. 163 // Must have the AppFilter signature.
173 template <APIPermission::ID permission> 164 template <APIPermission::ID permission>
174 bool HostedAppHasPermission( 165 bool HostedAppHasPermission(
175 const extensions::Extension& extension, Profile* /*profile*/) { 166 const extensions::Extension& extension, Profile* /*profile*/) {
176 return extension.is_hosted_app() && extension.HasAPIPermission(permission); 167 return extension.is_hosted_app() && extension.HasAPIPermission(permission);
177 } 168 }
178 169
179 // Add an "Allow"-entry to the list of |exceptions| for a |url_pattern| from 170 // Add an "Allow"-entry to the list of |exceptions| for a |url_pattern| from
180 // the web extent of a hosted |app|. 171 // the web extent of a hosted |app|.
(...skipping 1143 matching lines...) Expand 10 before | Expand all | Expand 10 after
1324 for (size_t i = 0; i < arraysize(kExContentSettingsTypeGroupNames); ++i) { 1315 for (size_t i = 0; i < arraysize(kExContentSettingsTypeGroupNames); ++i) {
1325 if (type == kExContentSettingsTypeGroupNames[i].type) 1316 if (type == kExContentSettingsTypeGroupNames[i].type)
1326 return kExContentSettingsTypeGroupNames[i].name; 1317 return kExContentSettingsTypeGroupNames[i].name;
1327 } 1318 }
1328 1319
1329 NOTREACHED(); 1320 NOTREACHED();
1330 return std::string(); 1321 return std::string();
1331 } 1322 }
1332 1323
1333 } // namespace options 1324 } // namespace options
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/ntp/ntp_resource_cache.cc ('k') | chrome/browser/ui/webui/sync_setup_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698