Chromium Code Reviews| 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/webui/options2/content_settings_handler2.h" | 5 #include "chrome/browser/ui/webui/options2/content_settings_handler2.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 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 331 {CONTENT_SETTINGS_TYPE_JAVASCRIPT, "javascript"}, | 331 {CONTENT_SETTINGS_TYPE_JAVASCRIPT, "javascript"}, |
| 332 {CONTENT_SETTINGS_TYPE_PLUGINS, "plugins"}, | 332 {CONTENT_SETTINGS_TYPE_PLUGINS, "plugins"}, |
| 333 {CONTENT_SETTINGS_TYPE_POPUPS, "popups"}, | 333 {CONTENT_SETTINGS_TYPE_POPUPS, "popups"}, |
| 334 {CONTENT_SETTINGS_TYPE_GEOLOCATION, "location"}, | 334 {CONTENT_SETTINGS_TYPE_GEOLOCATION, "location"}, |
| 335 {CONTENT_SETTINGS_TYPE_NOTIFICATIONS, "notifications"}, | 335 {CONTENT_SETTINGS_TYPE_NOTIFICATIONS, "notifications"}, |
| 336 {CONTENT_SETTINGS_TYPE_INTENTS, "intents"}, | 336 {CONTENT_SETTINGS_TYPE_INTENTS, "intents"}, |
| 337 {CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE, "auto-select-certificate"}, | 337 {CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE, "auto-select-certificate"}, |
| 338 {CONTENT_SETTINGS_TYPE_FULLSCREEN, "fullscreen"}, | 338 {CONTENT_SETTINGS_TYPE_FULLSCREEN, "fullscreen"}, |
| 339 {CONTENT_SETTINGS_TYPE_MOUSELOCK, "mouselock"}, | 339 {CONTENT_SETTINGS_TYPE_MOUSELOCK, "mouselock"}, |
| 340 {CONTENT_SETTINGS_TYPE_MIXEDSCRIPT, "mixed-script"}, | 340 {CONTENT_SETTINGS_TYPE_MIXEDSCRIPT, "mixed-script"}, |
| 341 {CONTENT_SETTINGS_TYPE_REGISTER_PROTOCOL_HANDLER, | |
| 342 "register-protocol-handler"}, | |
|
Evan Stade
2012/06/25 23:31:08
2 more indent
Greg Billock
2012/06/26 19:17:04
Done.
| |
| 341 {EX_CONTENT_SETTINGS_TYPE_PEPPER_FLASH_CAMERAMIC, "pepper-flash-cameramic"}, | 343 {EX_CONTENT_SETTINGS_TYPE_PEPPER_FLASH_CAMERAMIC, "pepper-flash-cameramic"}, |
| 342 }; | 344 }; |
| 343 | 345 |
| 344 ContentSettingsHandler::ContentSettingsHandler() { | 346 ContentSettingsHandler::ContentSettingsHandler() { |
| 345 } | 347 } |
| 346 | 348 |
| 347 ContentSettingsHandler::~ContentSettingsHandler() { | 349 ContentSettingsHandler::~ContentSettingsHandler() { |
| 348 } | 350 } |
| 349 | 351 |
| 350 void ContentSettingsHandler::GetLocalizedValues( | 352 void ContentSettingsHandler::GetLocalizedValues( |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 645 } | 647 } |
| 646 | 648 |
| 647 void ContentSettingsHandler::UpdateAllExceptionsViewsFromModel() { | 649 void ContentSettingsHandler::UpdateAllExceptionsViewsFromModel() { |
| 648 for (int type = CONTENT_SETTINGS_TYPE_DEFAULT + 1; | 650 for (int type = CONTENT_SETTINGS_TYPE_DEFAULT + 1; |
| 649 type < EX_CONTENT_SETTINGS_NUM_TYPES; ++type) { | 651 type < EX_CONTENT_SETTINGS_NUM_TYPES; ++type) { |
| 650 // The content settings type CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE | 652 // The content settings type CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE |
| 651 // is supposed to be set by policy only. Hence there is no user facing UI | 653 // is supposed to be set by policy only. Hence there is no user facing UI |
| 652 // for this content type and we skip it here. | 654 // for this content type and we skip it here. |
| 653 if (type == CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE) | 655 if (type == CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE) |
| 654 continue; | 656 continue; |
| 657 // The RPH settings are retrieved separately. | |
| 658 if (type == CONTENT_SETTINGS_TYPE_REGISTER_PROTOCOL_HANDLER) | |
|
Bernhard Bauer
2012/06/25 16:52:20
I think this should be moved into UpdateExceptions
Greg Billock
2012/06/26 19:17:04
This method gets called from InitializePage. Do yo
| |
| 659 continue; | |
| 655 UpdateExceptionsViewFromModel(ExContentSettingsType(type)); | 660 UpdateExceptionsViewFromModel(ExContentSettingsType(type)); |
| 656 } | 661 } |
| 657 } | 662 } |
| 658 | 663 |
| 659 void ContentSettingsHandler::UpdateAllOTRExceptionsViewsFromModel() { | 664 void ContentSettingsHandler::UpdateAllOTRExceptionsViewsFromModel() { |
| 660 for (int type = CONTENT_SETTINGS_TYPE_DEFAULT + 1; | 665 for (int type = CONTENT_SETTINGS_TYPE_DEFAULT + 1; |
| 661 type < EX_CONTENT_SETTINGS_NUM_TYPES; ++type) { | 666 type < EX_CONTENT_SETTINGS_NUM_TYPES; ++type) { |
| 662 UpdateOTRExceptionsViewFromModel(ExContentSettingsType(type)); | 667 UpdateOTRExceptionsViewFromModel(ExContentSettingsType(type)); |
| 663 } | 668 } |
| 664 } | 669 } |
| (...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1270 for (size_t i = 0; i < arraysize(kExContentSettingsTypeGroupNames); ++i) { | 1275 for (size_t i = 0; i < arraysize(kExContentSettingsTypeGroupNames); ++i) { |
| 1271 if (type == kExContentSettingsTypeGroupNames[i].type) | 1276 if (type == kExContentSettingsTypeGroupNames[i].type) |
| 1272 return kExContentSettingsTypeGroupNames[i].name; | 1277 return kExContentSettingsTypeGroupNames[i].name; |
| 1273 } | 1278 } |
| 1274 | 1279 |
| 1275 NOTREACHED(); | 1280 NOTREACHED(); |
| 1276 return std::string(); | 1281 return std::string(); |
| 1277 } | 1282 } |
| 1278 | 1283 |
| 1279 } // namespace options2 | 1284 } // namespace options2 |
| OLD | NEW |