| 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 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 {CONTENT_SETTINGS_TYPE_IMAGES, "images"}, | 330 {CONTENT_SETTINGS_TYPE_IMAGES, "images"}, |
| 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 {EX_CONTENT_SETTINGS_TYPE_PEPPER_FLASH_CAMERAMIC, "pepper-flash-cameramic"}, | 341 {EX_CONTENT_SETTINGS_TYPE_PEPPER_FLASH_CAMERAMIC, "pepper-flash-cameramic"}, |
| 341 }; | 342 }; |
| 342 | 343 |
| 343 ContentSettingsHandler::ContentSettingsHandler() { | 344 ContentSettingsHandler::ContentSettingsHandler() { |
| 344 } | 345 } |
| 345 | 346 |
| 346 ContentSettingsHandler::~ContentSettingsHandler() { | 347 ContentSettingsHandler::~ContentSettingsHandler() { |
| 347 } | 348 } |
| 348 | 349 |
| 349 void ContentSettingsHandler::GetLocalizedValues( | 350 void ContentSettingsHandler::GetLocalizedValues( |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 657 | 658 |
| 658 void ContentSettingsHandler::UpdateAllOTRExceptionsViewsFromModel() { | 659 void ContentSettingsHandler::UpdateAllOTRExceptionsViewsFromModel() { |
| 659 for (int type = CONTENT_SETTINGS_TYPE_DEFAULT + 1; | 660 for (int type = CONTENT_SETTINGS_TYPE_DEFAULT + 1; |
| 660 type < EX_CONTENT_SETTINGS_NUM_TYPES; ++type) { | 661 type < EX_CONTENT_SETTINGS_NUM_TYPES; ++type) { |
| 661 UpdateOTRExceptionsViewFromModel(ExContentSettingsType(type)); | 662 UpdateOTRExceptionsViewFromModel(ExContentSettingsType(type)); |
| 662 } | 663 } |
| 663 } | 664 } |
| 664 | 665 |
| 665 void ContentSettingsHandler::UpdateExceptionsViewFromModel( | 666 void ContentSettingsHandler::UpdateExceptionsViewFromModel( |
| 666 const ExContentSettingsType& type) { | 667 const ExContentSettingsType& type) { |
| 667 // Don't update intents settings at this point. | |
| 668 // Turn on when enable_web_intents_tag is enabled. | |
| 669 if (type == CONTENT_SETTINGS_TYPE_INTENTS) | |
| 670 return; | |
| 671 | |
| 672 switch (type) { | 668 switch (type) { |
| 673 case CONTENT_SETTINGS_TYPE_GEOLOCATION: | 669 case CONTENT_SETTINGS_TYPE_GEOLOCATION: |
| 674 UpdateGeolocationExceptionsView(); | 670 UpdateGeolocationExceptionsView(); |
| 675 break; | 671 break; |
| 676 case CONTENT_SETTINGS_TYPE_NOTIFICATIONS: | 672 case CONTENT_SETTINGS_TYPE_NOTIFICATIONS: |
| 677 UpdateNotificationExceptionsView(); | 673 UpdateNotificationExceptionsView(); |
| 678 break; | 674 break; |
| 679 case EX_CONTENT_SETTINGS_TYPE_PEPPER_FLASH_CAMERAMIC: | 675 case EX_CONTENT_SETTINGS_TYPE_PEPPER_FLASH_CAMERAMIC: |
| 680 UpdateFlashCameraMicExceptionsView(); | 676 UpdateFlashCameraMicExceptionsView(); |
| 681 break; | 677 break; |
| 678 case CONTENT_SETTINGS_TYPE_INTENTS: |
| 679 // Don't update intents settings at this point. |
| 680 // Turn on when enable_web_intents_tag is enabled. |
| 681 break; |
| 682 case CONTENT_SETTINGS_TYPE_MIXEDSCRIPT: |
| 683 // We don't yet support exceptions for mixed scripting. |
| 684 break; |
| 682 default: | 685 default: |
| 683 UpdateExceptionsViewFromHostContentSettingsMap( | 686 UpdateExceptionsViewFromHostContentSettingsMap( |
| 684 type.ToContentSettingsType()); | 687 type.ToContentSettingsType()); |
| 685 break; | 688 break; |
| 686 } | 689 } |
| 687 } | 690 } |
| 688 | 691 |
| 689 void ContentSettingsHandler::UpdateOTRExceptionsViewFromModel( | 692 void ContentSettingsHandler::UpdateOTRExceptionsViewFromModel( |
| 690 const ExContentSettingsType& type) { | 693 const ExContentSettingsType& type) { |
| 691 switch (type) { | 694 switch (type) { |
| 692 case CONTENT_SETTINGS_TYPE_GEOLOCATION: | 695 case CONTENT_SETTINGS_TYPE_GEOLOCATION: |
| 693 case CONTENT_SETTINGS_TYPE_NOTIFICATIONS: | 696 case CONTENT_SETTINGS_TYPE_NOTIFICATIONS: |
| 694 case CONTENT_SETTINGS_TYPE_INTENTS: | 697 case CONTENT_SETTINGS_TYPE_INTENTS: |
| 695 case CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE: | 698 case CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE: |
| 699 case CONTENT_SETTINGS_TYPE_MIXEDSCRIPT: |
| 696 case EX_CONTENT_SETTINGS_TYPE_PEPPER_FLASH_CAMERAMIC: | 700 case EX_CONTENT_SETTINGS_TYPE_PEPPER_FLASH_CAMERAMIC: |
| 697 break; | 701 break; |
| 698 default: | 702 default: |
| 699 UpdateExceptionsViewFromOTRHostContentSettingsMap( | 703 UpdateExceptionsViewFromOTRHostContentSettingsMap( |
| 700 type.ToContentSettingsType()); | 704 type.ToContentSettingsType()); |
| 701 break; | 705 break; |
| 702 } | 706 } |
| 703 } | 707 } |
| 704 | 708 |
| 705 void ContentSettingsHandler::UpdateGeolocationExceptionsView() { | 709 void ContentSettingsHandler::UpdateGeolocationExceptionsView() { |
| (...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1266 for (size_t i = 0; i < arraysize(kExContentSettingsTypeGroupNames); ++i) { | 1270 for (size_t i = 0; i < arraysize(kExContentSettingsTypeGroupNames); ++i) { |
| 1267 if (type == kExContentSettingsTypeGroupNames[i].type) | 1271 if (type == kExContentSettingsTypeGroupNames[i].type) |
| 1268 return kExContentSettingsTypeGroupNames[i].name; | 1272 return kExContentSettingsTypeGroupNames[i].name; |
| 1269 } | 1273 } |
| 1270 | 1274 |
| 1271 NOTREACHED(); | 1275 NOTREACHED(); |
| 1272 return std::string(); | 1276 return std::string(); |
| 1273 } | 1277 } |
| 1274 | 1278 |
| 1275 } // namespace options2 | 1279 } // namespace options2 |
| OLD | NEW |