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