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 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 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 // Don't update intents settings at this point. |
| 668 // Turn on when enable_web_intents_tag is enabled. | 669 // Turn on when enable_web_intents_tag is enabled. |
| 669 if (type == CONTENT_SETTINGS_TYPE_INTENTS) | 670 if (type == CONTENT_SETTINGS_TYPE_INTENTS) |
| 670 return; | 671 return; |
| 671 | 672 |
| 673 // We don't yet support exceptions for mixed scripting. | |
| 674 if (type == CONTENT_SETTINGS_TYPE_MIXEDSCRIPT) | |
|
Tom Sepez
2012/06/20 04:16:07
Am I being dense? Shouldn't these two just be cas
| |
| 675 return; | |
| 676 | |
| 672 switch (type) { | 677 switch (type) { |
| 673 case CONTENT_SETTINGS_TYPE_GEOLOCATION: | 678 case CONTENT_SETTINGS_TYPE_GEOLOCATION: |
| 674 UpdateGeolocationExceptionsView(); | 679 UpdateGeolocationExceptionsView(); |
| 675 break; | 680 break; |
| 676 case CONTENT_SETTINGS_TYPE_NOTIFICATIONS: | 681 case CONTENT_SETTINGS_TYPE_NOTIFICATIONS: |
| 677 UpdateNotificationExceptionsView(); | 682 UpdateNotificationExceptionsView(); |
| 678 break; | 683 break; |
| 679 case EX_CONTENT_SETTINGS_TYPE_PEPPER_FLASH_CAMERAMIC: | 684 case EX_CONTENT_SETTINGS_TYPE_PEPPER_FLASH_CAMERAMIC: |
| 680 UpdateFlashCameraMicExceptionsView(); | 685 UpdateFlashCameraMicExceptionsView(); |
| 681 break; | 686 break; |
| 682 default: | 687 default: |
| 683 UpdateExceptionsViewFromHostContentSettingsMap( | 688 UpdateExceptionsViewFromHostContentSettingsMap( |
| 684 type.ToContentSettingsType()); | 689 type.ToContentSettingsType()); |
| 685 break; | 690 break; |
| 686 } | 691 } |
| 687 } | 692 } |
| 688 | 693 |
| 689 void ContentSettingsHandler::UpdateOTRExceptionsViewFromModel( | 694 void ContentSettingsHandler::UpdateOTRExceptionsViewFromModel( |
| 690 const ExContentSettingsType& type) { | 695 const ExContentSettingsType& type) { |
| 691 switch (type) { | 696 switch (type) { |
| 692 case CONTENT_SETTINGS_TYPE_GEOLOCATION: | 697 case CONTENT_SETTINGS_TYPE_GEOLOCATION: |
| 693 case CONTENT_SETTINGS_TYPE_NOTIFICATIONS: | 698 case CONTENT_SETTINGS_TYPE_NOTIFICATIONS: |
| 694 case CONTENT_SETTINGS_TYPE_INTENTS: | 699 case CONTENT_SETTINGS_TYPE_INTENTS: |
| 695 case CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE: | 700 case CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE: |
| 701 case CONTENT_SETTINGS_TYPE_MIXEDSCRIPT: | |
| 696 case EX_CONTENT_SETTINGS_TYPE_PEPPER_FLASH_CAMERAMIC: | 702 case EX_CONTENT_SETTINGS_TYPE_PEPPER_FLASH_CAMERAMIC: |
| 697 break; | 703 break; |
| 698 default: | 704 default: |
| 699 UpdateExceptionsViewFromOTRHostContentSettingsMap( | 705 UpdateExceptionsViewFromOTRHostContentSettingsMap( |
| 700 type.ToContentSettingsType()); | 706 type.ToContentSettingsType()); |
| 701 break; | 707 break; |
| 702 } | 708 } |
| 703 } | 709 } |
| 704 | 710 |
| 705 void ContentSettingsHandler::UpdateGeolocationExceptionsView() { | 711 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) { | 1272 for (size_t i = 0; i < arraysize(kExContentSettingsTypeGroupNames); ++i) { |
| 1267 if (type == kExContentSettingsTypeGroupNames[i].type) | 1273 if (type == kExContentSettingsTypeGroupNames[i].type) |
| 1268 return kExContentSettingsTypeGroupNames[i].name; | 1274 return kExContentSettingsTypeGroupNames[i].name; |
| 1269 } | 1275 } |
| 1270 | 1276 |
| 1271 NOTREACHED(); | 1277 NOTREACHED(); |
| 1272 return std::string(); | 1278 return std::string(); |
| 1273 } | 1279 } |
| 1274 | 1280 |
| 1275 } // namespace options2 | 1281 } // namespace options2 |
| OLD | NEW |