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

Side by Side Diff: chrome/browser/ui/webui/site_settings_helper.cc

Issue 2457843002: MD Settings: Misc. Site Settings cleanups. (Closed)
Patch Set: fix Created 4 years, 1 month 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/site_settings_helper.h" 5 #include "chrome/browser/ui/webui/site_settings_helper.h"
6 6
7 #include <functional> 7 #include <functional>
8 #include <string> 8 #include <string>
9 9
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 typedef std::multimap<std::string, const base::DictionaryValue*> SortedObjects; 43 typedef std::multimap<std::string, const base::DictionaryValue*> SortedObjects;
44 44
45 // Maps from a secondary URL to the set of objects it has permission to access. 45 // Maps from a secondary URL to the set of objects it has permission to access.
46 typedef std::map<GURL, SortedObjects> OneOriginObjects; 46 typedef std::map<GURL, SortedObjects> OneOriginObjects;
47 47
48 // Maps from a primary URL/source pair to a OneOriginObjects. All the mappings 48 // Maps from a primary URL/source pair to a OneOriginObjects. All the mappings
49 // in OneOriginObjects share the given primary URL and source. 49 // in OneOriginObjects share the given primary URL and source.
50 typedef std::map<std::pair<GURL, std::string>, OneOriginObjects> 50 typedef std::map<std::pair<GURL, std::string>, OneOriginObjects>
51 AllOriginObjects; 51 AllOriginObjects;
52 52
53 const ContentSettingsTypeNameEntry kContentSettingsTypeGroupNames[] = {
54 {CONTENT_SETTINGS_TYPE_COOKIES, "cookies"},
55 {CONTENT_SETTINGS_TYPE_IMAGES, "images"},
56 {CONTENT_SETTINGS_TYPE_JAVASCRIPT, "javascript"},
57 {CONTENT_SETTINGS_TYPE_PLUGINS, "plugins"},
58 {CONTENT_SETTINGS_TYPE_POPUPS, "popups"},
59 {CONTENT_SETTINGS_TYPE_GEOLOCATION, "location"},
60 {CONTENT_SETTINGS_TYPE_NOTIFICATIONS, "notifications"},
61 {CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE, "auto-select-certificate"},
62 {CONTENT_SETTINGS_TYPE_FULLSCREEN, "fullscreen"},
63 {CONTENT_SETTINGS_TYPE_MOUSELOCK, "mouselock"},
64 {CONTENT_SETTINGS_TYPE_PROTOCOL_HANDLERS, "register-protocol-handler"},
65 {CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC, "media-stream-mic"},
66 {CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA, "media-stream-camera"},
67 {CONTENT_SETTINGS_TYPE_PPAPI_BROKER, "ppapi-broker"},
68 {CONTENT_SETTINGS_TYPE_AUTOMATIC_DOWNLOADS, "multiple-automatic-downloads"},
69 {CONTENT_SETTINGS_TYPE_MIDI_SYSEX, "midi-sysex"},
70 {CONTENT_SETTINGS_TYPE_SSL_CERT_DECISIONS, "ssl-cert-decisions"},
71 #if defined(OS_CHROMEOS)
72 {CONTENT_SETTINGS_TYPE_PROTECTED_MEDIA_IDENTIFIER, "protectedContent"},
73 #endif
74 {CONTENT_SETTINGS_TYPE_KEYGEN, "keygen"},
75 {CONTENT_SETTINGS_TYPE_BACKGROUND_SYNC, "background-sync"},
76 };
77
53 } // namespace 78 } // namespace
54 79
55 bool HasRegisteredGroupName(ContentSettingsType type) { 80 bool HasRegisteredGroupName(ContentSettingsType type) {
56 for (size_t i = 0; i < arraysize(kContentSettingsTypeGroupNames); ++i) { 81 for (size_t i = 0; i < arraysize(kContentSettingsTypeGroupNames); ++i) {
57 if (type == kContentSettingsTypeGroupNames[i].type) 82 if (type == kContentSettingsTypeGroupNames[i].type)
58 return true; 83 return true;
59 } 84 }
60 return false; 85 return false;
61 } 86 }
62 87
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 } 409 }
385 } 410 }
386 411
387 for (auto& one_provider_exceptions : all_provider_exceptions) { 412 for (auto& one_provider_exceptions : all_provider_exceptions) {
388 for (auto& exception : one_provider_exceptions) 413 for (auto& exception : one_provider_exceptions)
389 exceptions->Append(std::move(exception)); 414 exceptions->Append(std::move(exception));
390 } 415 }
391 } 416 }
392 417
393 } // namespace site_settings 418 } // namespace site_settings
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/site_settings_helper.h ('k') | chrome/test/data/webui/settings/site_settings_category_tests.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698