| 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/website_settings/website_settings.h" | 5 #include "chrome/browser/ui/website_settings/website_settings.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA, | 99 CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA, |
| 100 CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC, | 100 CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC, |
| 101 CONTENT_SETTINGS_TYPE_NOTIFICATIONS, | 101 CONTENT_SETTINGS_TYPE_NOTIFICATIONS, |
| 102 CONTENT_SETTINGS_TYPE_JAVASCRIPT, | 102 CONTENT_SETTINGS_TYPE_JAVASCRIPT, |
| 103 #if !defined(OS_ANDROID) | 103 #if !defined(OS_ANDROID) |
| 104 CONTENT_SETTINGS_TYPE_PLUGINS, | 104 CONTENT_SETTINGS_TYPE_PLUGINS, |
| 105 CONTENT_SETTINGS_TYPE_IMAGES, | 105 CONTENT_SETTINGS_TYPE_IMAGES, |
| 106 #endif | 106 #endif |
| 107 CONTENT_SETTINGS_TYPE_POPUPS, | 107 CONTENT_SETTINGS_TYPE_POPUPS, |
| 108 CONTENT_SETTINGS_TYPE_BACKGROUND_SYNC, | 108 CONTENT_SETTINGS_TYPE_BACKGROUND_SYNC, |
| 109 CONTENT_SETTINGS_TYPE_KEYGEN, | |
| 110 CONTENT_SETTINGS_TYPE_AUTOMATIC_DOWNLOADS, | 109 CONTENT_SETTINGS_TYPE_AUTOMATIC_DOWNLOADS, |
| 111 CONTENT_SETTINGS_TYPE_AUTOPLAY, | 110 CONTENT_SETTINGS_TYPE_AUTOPLAY, |
| 112 CONTENT_SETTINGS_TYPE_MIDI_SYSEX, | 111 CONTENT_SETTINGS_TYPE_MIDI_SYSEX, |
| 113 }; | 112 }; |
| 114 | 113 |
| 115 // Determines whether to show permission |type| in the Website Settings UI. Only | 114 // Determines whether to show permission |type| in the Website Settings UI. Only |
| 116 // applies to permissions listed in |kPermissionType|. | 115 // applies to permissions listed in |kPermissionType|. |
| 117 bool ShouldShowPermission(ContentSettingsType type) { | 116 bool ShouldShowPermission(ContentSettingsType type) { |
| 118 #if !defined(OS_ANDROID) | 117 #if !defined(OS_ANDROID) |
| 119 // Autoplay is Android-only at the moment. | 118 // Autoplay is Android-only at the moment. |
| (...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 722 if (info.primary_pattern == ContentSettingsPattern::Wildcard() && | 721 if (info.primary_pattern == ContentSettingsPattern::Wildcard() && |
| 723 info.secondary_pattern == ContentSettingsPattern::Wildcard()) { | 722 info.secondary_pattern == ContentSettingsPattern::Wildcard()) { |
| 724 permission_info.default_setting = permission_info.setting; | 723 permission_info.default_setting = permission_info.setting; |
| 725 permission_info.setting = CONTENT_SETTING_DEFAULT; | 724 permission_info.setting = CONTENT_SETTING_DEFAULT; |
| 726 } else { | 725 } else { |
| 727 permission_info.default_setting = | 726 permission_info.default_setting = |
| 728 content_settings_->GetDefaultContentSetting(permission_info.type, | 727 content_settings_->GetDefaultContentSetting(permission_info.type, |
| 729 NULL); | 728 NULL); |
| 730 } | 729 } |
| 731 | 730 |
| 732 if (permission_info.type == CONTENT_SETTINGS_TYPE_KEYGEN && | |
| 733 (permission_info.setting == CONTENT_SETTING_DEFAULT || | |
| 734 permission_info.setting == permission_info.default_setting) && | |
| 735 !tab_specific_content_settings()->IsContentBlocked( | |
| 736 permission_info.type)) { | |
| 737 continue; | |
| 738 } | |
| 739 permission_info_list.push_back(permission_info); | 731 permission_info_list.push_back(permission_info); |
| 740 } | 732 } |
| 741 | 733 |
| 742 for (const ChooserUIInfo& ui_info : kChooserUIInfo) { | 734 for (const ChooserUIInfo& ui_info : kChooserUIInfo) { |
| 743 ChooserContextBase* context = ui_info.get_context(profile_); | 735 ChooserContextBase* context = ui_info.get_context(profile_); |
| 744 const GURL origin = site_url_.GetOrigin(); | 736 const GURL origin = site_url_.GetOrigin(); |
| 745 auto chosen_objects = context->GetGrantedObjects(origin, origin); | 737 auto chosen_objects = context->GetGrantedObjects(origin, origin); |
| 746 for (std::unique_ptr<base::DictionaryValue>& object : chosen_objects) { | 738 for (std::unique_ptr<base::DictionaryValue>& object : chosen_objects) { |
| 747 chosen_object_info_list.push_back( | 739 chosen_object_info_list.push_back( |
| 748 base::MakeUnique<WebsiteSettingsUI::ChosenObjectInfo>( | 740 base::MakeUnique<WebsiteSettingsUI::ChosenObjectInfo>( |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 791 info.connection_status = site_connection_status_; | 783 info.connection_status = site_connection_status_; |
| 792 info.connection_status_description = | 784 info.connection_status_description = |
| 793 UTF16ToUTF8(site_connection_details_); | 785 UTF16ToUTF8(site_connection_details_); |
| 794 info.identity_status = site_identity_status_; | 786 info.identity_status = site_identity_status_; |
| 795 info.identity_status_description = | 787 info.identity_status_description = |
| 796 UTF16ToUTF8(site_identity_details_); | 788 UTF16ToUTF8(site_identity_details_); |
| 797 info.certificate = certificate_; | 789 info.certificate = certificate_; |
| 798 info.show_ssl_decision_revoke_button = show_ssl_decision_revoke_button_; | 790 info.show_ssl_decision_revoke_button = show_ssl_decision_revoke_button_; |
| 799 ui_->SetIdentityInfo(info); | 791 ui_->SetIdentityInfo(info); |
| 800 } | 792 } |
| OLD | NEW |