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_PROTOCOL_HANDLERS, "register-protocol-handler"}, | |
| 341 {EX_CONTENT_SETTINGS_TYPE_PEPPER_FLASH_CAMERAMIC, "pepper-flash-cameramic"}, | 342 {EX_CONTENT_SETTINGS_TYPE_PEPPER_FLASH_CAMERAMIC, "pepper-flash-cameramic"}, |
| 342 {CONTENT_SETTINGS_TYPE_MEDIASTREAM, "media-stream"}, | 343 {CONTENT_SETTINGS_TYPE_MEDIASTREAM, "media-stream"}, |
| 343 }; | 344 }; |
| 344 | 345 |
| 345 ContentSettingsHandler::ContentSettingsHandler() { | 346 ContentSettingsHandler::ContentSettingsHandler() { |
| 346 } | 347 } |
| 347 | 348 |
| 348 ContentSettingsHandler::~ContentSettingsHandler() { | 349 ContentSettingsHandler::~ContentSettingsHandler() { |
| 349 } | 350 } |
| 350 | 351 |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 653 } | 654 } |
| 654 | 655 |
| 655 void ContentSettingsHandler::UpdateAllExceptionsViewsFromModel() { | 656 void ContentSettingsHandler::UpdateAllExceptionsViewsFromModel() { |
| 656 for (int type = CONTENT_SETTINGS_TYPE_DEFAULT + 1; | 657 for (int type = CONTENT_SETTINGS_TYPE_DEFAULT + 1; |
| 657 type < EX_CONTENT_SETTINGS_NUM_TYPES; ++type) { | 658 type < EX_CONTENT_SETTINGS_NUM_TYPES; ++type) { |
| 658 // The content settings type CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE | 659 // The content settings type CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE |
| 659 // is supposed to be set by policy only. Hence there is no user facing UI | 660 // is supposed to be set by policy only. Hence there is no user facing UI |
| 660 // for this content type and we skip it here. | 661 // for this content type and we skip it here. |
| 661 if (type == CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE) | 662 if (type == CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE) |
| 662 continue; | 663 continue; |
| 664 // The RPH settings are retrieved separately. | |
| 665 if (type == CONTENT_SETTINGS_TYPE_PROTOCOL_HANDLERS) | |
| 666 continue; | |
| 663 UpdateExceptionsViewFromModel(ExContentSettingsType(type)); | 667 UpdateExceptionsViewFromModel(ExContentSettingsType(type)); |
| 664 } | 668 } |
| 665 } | 669 } |
| 666 | 670 |
| 667 void ContentSettingsHandler::UpdateAllOTRExceptionsViewsFromModel() { | 671 void ContentSettingsHandler::UpdateAllOTRExceptionsViewsFromModel() { |
| 668 for (int type = CONTENT_SETTINGS_TYPE_DEFAULT + 1; | 672 for (int type = CONTENT_SETTINGS_TYPE_DEFAULT + 1; |
| 669 type < EX_CONTENT_SETTINGS_NUM_TYPES; ++type) { | 673 type < EX_CONTENT_SETTINGS_NUM_TYPES; ++type) { |
| 670 UpdateOTRExceptionsViewFromModel(ExContentSettingsType(type)); | 674 UpdateOTRExceptionsViewFromModel(ExContentSettingsType(type)); |
| 671 } | 675 } |
| 672 } | 676 } |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 683 case EX_CONTENT_SETTINGS_TYPE_PEPPER_FLASH_CAMERAMIC: | 687 case EX_CONTENT_SETTINGS_TYPE_PEPPER_FLASH_CAMERAMIC: |
| 684 UpdateFlashCameraMicExceptionsView(); | 688 UpdateFlashCameraMicExceptionsView(); |
| 685 break; | 689 break; |
| 686 case CONTENT_SETTINGS_TYPE_INTENTS: | 690 case CONTENT_SETTINGS_TYPE_INTENTS: |
| 687 // Don't update intents settings at this point. | 691 // Don't update intents settings at this point. |
| 688 // Turn on when enable_web_intents_tag is enabled. | 692 // Turn on when enable_web_intents_tag is enabled. |
| 689 break; | 693 break; |
| 690 case CONTENT_SETTINGS_TYPE_MIXEDSCRIPT: | 694 case CONTENT_SETTINGS_TYPE_MIXEDSCRIPT: |
| 691 // We don't yet support exceptions for mixed scripting. | 695 // We don't yet support exceptions for mixed scripting. |
| 692 break; | 696 break; |
| 697 case CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE: | |
|
Peter Kasting
2012/06/26 19:53:00
Did you mean to include this?
Greg Billock
2012/06/26 20:31:41
Yes. This is the one you thought should to be incl
| |
| 698 break; | |
| 699 case CONTENT_SETTINGS_TYPE_PROTOCOL_HANDLERS: | |
| 700 break; | |
| 693 default: | 701 default: |
| 694 UpdateExceptionsViewFromHostContentSettingsMap( | 702 UpdateExceptionsViewFromHostContentSettingsMap( |
| 695 type.ToContentSettingsType()); | 703 type.ToContentSettingsType()); |
| 696 break; | 704 break; |
| 697 } | 705 } |
| 698 } | 706 } |
| 699 | 707 |
| 700 void ContentSettingsHandler::UpdateOTRExceptionsViewFromModel( | 708 void ContentSettingsHandler::UpdateOTRExceptionsViewFromModel( |
| 701 const ExContentSettingsType& type) { | 709 const ExContentSettingsType& type) { |
| 702 switch (type) { | 710 switch (type) { |
| (...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1327 for (size_t i = 0; i < arraysize(kExContentSettingsTypeGroupNames); ++i) { | 1335 for (size_t i = 0; i < arraysize(kExContentSettingsTypeGroupNames); ++i) { |
| 1328 if (type == kExContentSettingsTypeGroupNames[i].type) | 1336 if (type == kExContentSettingsTypeGroupNames[i].type) |
| 1329 return kExContentSettingsTypeGroupNames[i].name; | 1337 return kExContentSettingsTypeGroupNames[i].name; |
| 1330 } | 1338 } |
| 1331 | 1339 |
| 1332 NOTREACHED(); | 1340 NOTREACHED(); |
| 1333 return std::string(); | 1341 return std::string(); |
| 1334 } | 1342 } |
| 1335 | 1343 |
| 1336 } // namespace options2 | 1344 } // namespace options2 |
| OLD | NEW |