OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
54 | 54 |
55 const ContentSettingsTypeNameEntry kContentSettingsTypeGroupNames[] = { | 55 const ContentSettingsTypeNameEntry kContentSettingsTypeGroupNames[] = { |
56 {CONTENT_SETTINGS_TYPE_COOKIES, "cookies"}, | 56 {CONTENT_SETTINGS_TYPE_COOKIES, "cookies"}, |
57 {CONTENT_SETTINGS_TYPE_IMAGES, "images"}, | 57 {CONTENT_SETTINGS_TYPE_IMAGES, "images"}, |
58 {CONTENT_SETTINGS_TYPE_JAVASCRIPT, "javascript"}, | 58 {CONTENT_SETTINGS_TYPE_JAVASCRIPT, "javascript"}, |
59 {CONTENT_SETTINGS_TYPE_PLUGINS, "plugins"}, | 59 {CONTENT_SETTINGS_TYPE_PLUGINS, "plugins"}, |
60 {CONTENT_SETTINGS_TYPE_POPUPS, "popups"}, | 60 {CONTENT_SETTINGS_TYPE_POPUPS, "popups"}, |
61 {CONTENT_SETTINGS_TYPE_GEOLOCATION, "location"}, | 61 {CONTENT_SETTINGS_TYPE_GEOLOCATION, "location"}, |
62 {CONTENT_SETTINGS_TYPE_NOTIFICATIONS, "notifications"}, | 62 {CONTENT_SETTINGS_TYPE_NOTIFICATIONS, "notifications"}, |
63 {CONTENT_SETTINGS_TYPE_INTENTS, "intents"}, | 63 {CONTENT_SETTINGS_TYPE_INTENTS, "intents"}, |
64 {CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE, "auto-select-certificate"}, | |
battre
2011/08/25 08:15:49
This does not show up in content_settings_types.h
markusheintz_
2011/08/25 14:39:51
No. The content type is there if you check the cod
| |
64 }; | 65 }; |
battre
2011/08/25 08:15:49
Does it make sense to add COMPILE_ASSERT(arraysize
markusheintz_
2011/08/25 14:39:51
Absolutely!! Done
| |
65 | 66 |
66 ContentSettingsType ContentSettingsTypeFromGroupName(const std::string& name) { | 67 ContentSettingsType ContentSettingsTypeFromGroupName(const std::string& name) { |
67 for (size_t i = 0; i < arraysize(kContentSettingsTypeGroupNames); ++i) { | 68 for (size_t i = 0; i < arraysize(kContentSettingsTypeGroupNames); ++i) { |
68 if (name == kContentSettingsTypeGroupNames[i].name) | 69 if (name == kContentSettingsTypeGroupNames[i].name) |
69 return kContentSettingsTypeGroupNames[i].type; | 70 return kContentSettingsTypeGroupNames[i].type; |
70 } | 71 } |
71 | 72 |
72 NOTREACHED() << name << " is not a recognized content settings type."; | 73 NOTREACHED() << name << " is not a recognized content settings type."; |
73 return CONTENT_SETTINGS_TYPE_DEFAULT; | 74 return CONTENT_SETTINGS_TYPE_DEFAULT; |
74 } | 75 } |
(...skipping 683 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
758 return Profile::FromWebUI(web_ui_)->GetProtocolHandlerRegistry(); | 759 return Profile::FromWebUI(web_ui_)->GetProtocolHandlerRegistry(); |
759 } | 760 } |
760 | 761 |
761 HostContentSettingsMap* | 762 HostContentSettingsMap* |
762 ContentSettingsHandler::GetOTRContentSettingsMap() { | 763 ContentSettingsHandler::GetOTRContentSettingsMap() { |
763 Profile* profile = Profile::FromWebUI(web_ui_); | 764 Profile* profile = Profile::FromWebUI(web_ui_); |
764 if (profile->HasOffTheRecordProfile()) | 765 if (profile->HasOffTheRecordProfile()) |
765 return profile->GetOffTheRecordProfile()->GetHostContentSettingsMap(); | 766 return profile->GetOffTheRecordProfile()->GetHostContentSettingsMap(); |
766 return NULL; | 767 return NULL; |
767 } | 768 } |
OLD | NEW |