| 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 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 {CONTENT_SETTINGS_TYPE_JAVASCRIPT, "javascript"}, | 332 {CONTENT_SETTINGS_TYPE_JAVASCRIPT, "javascript"}, |
| 333 {CONTENT_SETTINGS_TYPE_PLUGINS, "plugins"}, | 333 {CONTENT_SETTINGS_TYPE_PLUGINS, "plugins"}, |
| 334 {CONTENT_SETTINGS_TYPE_POPUPS, "popups"}, | 334 {CONTENT_SETTINGS_TYPE_POPUPS, "popups"}, |
| 335 {CONTENT_SETTINGS_TYPE_GEOLOCATION, "location"}, | 335 {CONTENT_SETTINGS_TYPE_GEOLOCATION, "location"}, |
| 336 {CONTENT_SETTINGS_TYPE_NOTIFICATIONS, "notifications"}, | 336 {CONTENT_SETTINGS_TYPE_NOTIFICATIONS, "notifications"}, |
| 337 {CONTENT_SETTINGS_TYPE_INTENTS, "intents"}, | 337 {CONTENT_SETTINGS_TYPE_INTENTS, "intents"}, |
| 338 {CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE, "auto-select-certificate"}, | 338 {CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE, "auto-select-certificate"}, |
| 339 {CONTENT_SETTINGS_TYPE_FULLSCREEN, "fullscreen"}, | 339 {CONTENT_SETTINGS_TYPE_FULLSCREEN, "fullscreen"}, |
| 340 {CONTENT_SETTINGS_TYPE_MOUSELOCK, "mouselock"}, | 340 {CONTENT_SETTINGS_TYPE_MOUSELOCK, "mouselock"}, |
| 341 {CONTENT_SETTINGS_TYPE_MIXEDSCRIPT, "mixed-script"}, | 341 {CONTENT_SETTINGS_TYPE_MIXEDSCRIPT, "mixed-script"}, |
| 342 {CONTENT_SETTINGS_TYPE_PROTOCOL_HANDLERS, "register-protocol-handler"}, |
| 342 {EX_CONTENT_SETTINGS_TYPE_PEPPER_FLASH_CAMERAMIC, "pepper-flash-cameramic"}, | 343 {EX_CONTENT_SETTINGS_TYPE_PEPPER_FLASH_CAMERAMIC, "pepper-flash-cameramic"}, |
| 343 {CONTENT_SETTINGS_TYPE_MEDIASTREAM, "media-stream"}, | 344 {CONTENT_SETTINGS_TYPE_MEDIASTREAM, "media-stream"}, |
| 344 }; | 345 }; |
| 345 | 346 |
| 346 ContentSettingsHandler::ContentSettingsHandler() { | 347 ContentSettingsHandler::ContentSettingsHandler() { |
| 347 } | 348 } |
| 348 | 349 |
| 349 ContentSettingsHandler::~ContentSettingsHandler() { | 350 ContentSettingsHandler::~ContentSettingsHandler() { |
| 350 } | 351 } |
| 351 | 352 |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 654 } | 655 } |
| 655 | 656 |
| 656 void ContentSettingsHandler::UpdateAllExceptionsViewsFromModel() { | 657 void ContentSettingsHandler::UpdateAllExceptionsViewsFromModel() { |
| 657 for (int type = CONTENT_SETTINGS_TYPE_DEFAULT + 1; | 658 for (int type = CONTENT_SETTINGS_TYPE_DEFAULT + 1; |
| 658 type < EX_CONTENT_SETTINGS_NUM_TYPES; ++type) { | 659 type < EX_CONTENT_SETTINGS_NUM_TYPES; ++type) { |
| 659 // The content settings type CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE | 660 // The content settings type CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE |
| 660 // is supposed to be set by policy only. Hence there is no user facing UI | 661 // is supposed to be set by policy only. Hence there is no user facing UI |
| 661 // for this content type and we skip it here. | 662 // for this content type and we skip it here. |
| 662 if (type == CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE) | 663 if (type == CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE) |
| 663 continue; | 664 continue; |
| 665 // The RPH settings are retrieved separately. |
| 666 if (type == CONTENT_SETTINGS_TYPE_PROTOCOL_HANDLERS) |
| 667 continue; |
| 664 UpdateExceptionsViewFromModel(ExContentSettingsType(type)); | 668 UpdateExceptionsViewFromModel(ExContentSettingsType(type)); |
| 665 } | 669 } |
| 666 } | 670 } |
| 667 | 671 |
| 668 void ContentSettingsHandler::UpdateAllOTRExceptionsViewsFromModel() { | 672 void ContentSettingsHandler::UpdateAllOTRExceptionsViewsFromModel() { |
| 669 for (int type = CONTENT_SETTINGS_TYPE_DEFAULT + 1; | 673 for (int type = CONTENT_SETTINGS_TYPE_DEFAULT + 1; |
| 670 type < EX_CONTENT_SETTINGS_NUM_TYPES; ++type) { | 674 type < EX_CONTENT_SETTINGS_NUM_TYPES; ++type) { |
| 671 UpdateOTRExceptionsViewFromModel(ExContentSettingsType(type)); | 675 UpdateOTRExceptionsViewFromModel(ExContentSettingsType(type)); |
| 672 } | 676 } |
| 673 } | 677 } |
| (...skipping 10 matching lines...) Expand all Loading... |
| 684 case EX_CONTENT_SETTINGS_TYPE_PEPPER_FLASH_CAMERAMIC: | 688 case EX_CONTENT_SETTINGS_TYPE_PEPPER_FLASH_CAMERAMIC: |
| 685 UpdateFlashCameraMicExceptionsView(); | 689 UpdateFlashCameraMicExceptionsView(); |
| 686 break; | 690 break; |
| 687 case CONTENT_SETTINGS_TYPE_INTENTS: | 691 case CONTENT_SETTINGS_TYPE_INTENTS: |
| 688 // Don't update intents settings at this point. | 692 // Don't update intents settings at this point. |
| 689 // Turn on when enable_web_intents_tag is enabled. | 693 // Turn on when enable_web_intents_tag is enabled. |
| 690 break; | 694 break; |
| 691 case CONTENT_SETTINGS_TYPE_MIXEDSCRIPT: | 695 case CONTENT_SETTINGS_TYPE_MIXEDSCRIPT: |
| 692 // We don't yet support exceptions for mixed scripting. | 696 // We don't yet support exceptions for mixed scripting. |
| 693 break; | 697 break; |
| 698 case CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE: |
| 699 break; |
| 700 case CONTENT_SETTINGS_TYPE_PROTOCOL_HANDLERS: |
| 701 break; |
| 694 default: | 702 default: |
| 695 UpdateExceptionsViewFromHostContentSettingsMap( | 703 UpdateExceptionsViewFromHostContentSettingsMap( |
| 696 type.ToContentSettingsType()); | 704 type.ToContentSettingsType()); |
| 697 break; | 705 break; |
| 698 } | 706 } |
| 699 } | 707 } |
| 700 | 708 |
| 701 void ContentSettingsHandler::UpdateOTRExceptionsViewFromModel( | 709 void ContentSettingsHandler::UpdateOTRExceptionsViewFromModel( |
| 702 const ExContentSettingsType& type) { | 710 const ExContentSettingsType& type) { |
| 703 switch (type) { | 711 switch (type) { |
| (...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1328 for (size_t i = 0; i < arraysize(kExContentSettingsTypeGroupNames); ++i) { | 1336 for (size_t i = 0; i < arraysize(kExContentSettingsTypeGroupNames); ++i) { |
| 1329 if (type == kExContentSettingsTypeGroupNames[i].type) | 1337 if (type == kExContentSettingsTypeGroupNames[i].type) |
| 1330 return kExContentSettingsTypeGroupNames[i].name; | 1338 return kExContentSettingsTypeGroupNames[i].name; |
| 1331 } | 1339 } |
| 1332 | 1340 |
| 1333 NOTREACHED(); | 1341 NOTREACHED(); |
| 1334 return std::string(); | 1342 return std::string(); |
| 1335 } | 1343 } |
| 1336 | 1344 |
| 1337 } // namespace options2 | 1345 } // namespace options2 |
| OLD | NEW |