OLD | NEW |
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/content_settings/content_setting_image_model.h" | 5 #include "chrome/browser/ui/content_settings/content_setting_image_model.h" |
6 | 6 |
7 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" | 7 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" |
8 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 8 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
9 #include "chrome/browser/prerender/prerender_manager.h" | 9 #include "chrome/browser/prerender/prerender_manager.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 0, | 129 0, |
130 0, | 130 0, |
131 0}, | 131 0}, |
132 {CONTENT_SETTINGS_TYPE_JAVASCRIPT, | 132 {CONTENT_SETTINGS_TYPE_JAVASCRIPT, |
133 IDR_BLOCKED_JAVASCRIPT, | 133 IDR_BLOCKED_JAVASCRIPT, |
134 gfx::VectorIconId::CODE, | 134 gfx::VectorIconId::CODE, |
135 IDS_BLOCKED_JAVASCRIPT_TITLE, | 135 IDS_BLOCKED_JAVASCRIPT_TITLE, |
136 0, | 136 0, |
137 0, | 137 0, |
138 0}, | 138 0}, |
| 139 {CONTENT_SETTINGS_TYPE_KEYGEN, |
| 140 IDR_BLOCKED_KEYGEN, |
| 141 gfx::VectorIconId::CODE, |
| 142 IDS_BLOCKED_KEYGEN_TITLE, |
| 143 0, |
| 144 0, |
| 145 0}, |
139 {CONTENT_SETTINGS_TYPE_PLUGINS, | 146 {CONTENT_SETTINGS_TYPE_PLUGINS, |
140 IDR_BLOCKED_PLUGINS, | 147 IDR_BLOCKED_PLUGINS, |
141 gfx::VectorIconId::EXTENSION, | 148 gfx::VectorIconId::EXTENSION, |
142 IDS_BLOCKED_PLUGINS_MESSAGE, | 149 IDS_BLOCKED_PLUGINS_MESSAGE, |
143 IDS_BLOCKED_PLUGIN_EXPLANATORY_TEXT, | 150 IDS_BLOCKED_PLUGIN_EXPLANATORY_TEXT, |
144 0, | 151 0, |
145 0}, | 152 0}, |
146 {CONTENT_SETTINGS_TYPE_POPUPS, | 153 {CONTENT_SETTINGS_TYPE_POPUPS, |
147 IDR_BLOCKED_POPUPS, | 154 IDR_BLOCKED_POPUPS, |
148 gfx::VectorIconId::WEB, | 155 gfx::VectorIconId::WEB, |
(...skipping 15 matching lines...) Expand all Loading... |
164 0, | 171 0, |
165 IDR_BLOCKED_PPAPI_BROKER, | 172 IDR_BLOCKED_PPAPI_BROKER, |
166 IDS_ALLOWED_PPAPI_BROKER_TITLE}, | 173 IDS_ALLOWED_PPAPI_BROKER_TITLE}, |
167 {CONTENT_SETTINGS_TYPE_AUTOMATIC_DOWNLOADS, | 174 {CONTENT_SETTINGS_TYPE_AUTOMATIC_DOWNLOADS, |
168 IDR_BLOCKED_DOWNLOADS, | 175 IDR_BLOCKED_DOWNLOADS, |
169 gfx::VectorIconId::FILE_DOWNLOAD, | 176 gfx::VectorIconId::FILE_DOWNLOAD, |
170 IDS_BLOCKED_DOWNLOAD_TITLE, | 177 IDS_BLOCKED_DOWNLOAD_TITLE, |
171 IDS_BLOCKED_DOWNLOADS_EXPLANATION, | 178 IDS_BLOCKED_DOWNLOADS_EXPLANATION, |
172 IDR_ALLOWED_DOWNLOADS, | 179 IDR_ALLOWED_DOWNLOADS, |
173 IDS_ALLOWED_DOWNLOAD_TITLE}, | 180 IDS_ALLOWED_DOWNLOAD_TITLE}, |
| 181 {CONTENT_SETTINGS_TYPE_KEYGEN, |
| 182 IDR_BLOCKED_KEYGEN, |
| 183 gfx::VectorIconId::CODE, |
| 184 IDS_BLOCKED_KEYGEN_TITLE, |
| 185 0, |
| 186 0, |
| 187 0}, |
174 }; | 188 }; |
175 | 189 |
176 const ContentSettingsImageDetails* GetImageDetails(ContentSettingsType type) { | 190 const ContentSettingsImageDetails* GetImageDetails(ContentSettingsType type) { |
177 for (const ContentSettingsImageDetails& image_details : kImageDetails) { | 191 for (const ContentSettingsImageDetails& image_details : kImageDetails) { |
178 if (image_details.type == type) | 192 if (image_details.type == type) |
179 return &image_details; | 193 return &image_details; |
180 } | 194 } |
181 return nullptr; | 195 return nullptr; |
182 } | 196 } |
183 | 197 |
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
556 result.push_back( | 570 result.push_back( |
557 new ContentSettingBlockedImageModel(CONTENT_SETTINGS_TYPE_IMAGES)); | 571 new ContentSettingBlockedImageModel(CONTENT_SETTINGS_TYPE_IMAGES)); |
558 result.push_back( | 572 result.push_back( |
559 new ContentSettingBlockedImageModel(CONTENT_SETTINGS_TYPE_JAVASCRIPT)); | 573 new ContentSettingBlockedImageModel(CONTENT_SETTINGS_TYPE_JAVASCRIPT)); |
560 result.push_back( | 574 result.push_back( |
561 new ContentSettingBlockedImageModel(CONTENT_SETTINGS_TYPE_PPAPI_BROKER)); | 575 new ContentSettingBlockedImageModel(CONTENT_SETTINGS_TYPE_PPAPI_BROKER)); |
562 result.push_back( | 576 result.push_back( |
563 new ContentSettingBlockedImageModel(CONTENT_SETTINGS_TYPE_PLUGINS)); | 577 new ContentSettingBlockedImageModel(CONTENT_SETTINGS_TYPE_PLUGINS)); |
564 result.push_back( | 578 result.push_back( |
565 new ContentSettingBlockedImageModel(CONTENT_SETTINGS_TYPE_POPUPS)); | 579 new ContentSettingBlockedImageModel(CONTENT_SETTINGS_TYPE_POPUPS)); |
| 580 result.push_back( |
| 581 new ContentSettingBlockedImageModel(CONTENT_SETTINGS_TYPE_KEYGEN)); |
566 result.push_back(new ContentSettingGeolocationImageModel()); | 582 result.push_back(new ContentSettingGeolocationImageModel()); |
567 result.push_back( | 583 result.push_back( |
568 new ContentSettingBlockedImageModel(CONTENT_SETTINGS_TYPE_MIXEDSCRIPT)); | 584 new ContentSettingBlockedImageModel(CONTENT_SETTINGS_TYPE_MIXEDSCRIPT)); |
569 result.push_back(new ContentSettingRPHImageModel()); | 585 result.push_back(new ContentSettingRPHImageModel()); |
570 result.push_back(new ContentSettingMediaImageModel()); | 586 result.push_back(new ContentSettingMediaImageModel()); |
571 result.push_back( | 587 result.push_back( |
572 new ContentSettingBlockedImageModel( | 588 new ContentSettingBlockedImageModel( |
573 CONTENT_SETTINGS_TYPE_AUTOMATIC_DOWNLOADS)); | 589 CONTENT_SETTINGS_TYPE_AUTOMATIC_DOWNLOADS)); |
574 result.push_back(new ContentSettingMIDISysExImageModel()); | 590 result.push_back(new ContentSettingMIDISysExImageModel()); |
| 591 result.push_back( |
| 592 new ContentSettingBlockedImageModel(CONTENT_SETTINGS_TYPE_KEYGEN)); |
575 | 593 |
576 return result.Pass(); | 594 return result.Pass(); |
577 } | 595 } |
578 | 596 |
579 void ContentSettingImageModel::SetIconByResourceId(int id) { | 597 void ContentSettingImageModel::SetIconByResourceId(int id) { |
580 raster_icon_id_ = id; | 598 raster_icon_id_ = id; |
581 raster_icon_ = | 599 raster_icon_ = |
582 ui::ResourceBundle::GetSharedInstance().GetNativeImageNamed(id); | 600 ui::ResourceBundle::GetSharedInstance().GetNativeImageNamed(id); |
583 } | 601 } |
OLD | NEW |