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