| 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/page_info/page_info.h" | 5 #include "chrome/browser/ui/page_info/page_info.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 14 matching lines...) Expand all Loading... |
| 25 #include "chrome/browser/browsing_data/browsing_data_cookie_helper.h" | 25 #include "chrome/browser/browsing_data/browsing_data_cookie_helper.h" |
| 26 #include "chrome/browser/browsing_data/browsing_data_database_helper.h" | 26 #include "chrome/browser/browsing_data/browsing_data_database_helper.h" |
| 27 #include "chrome/browser/browsing_data/browsing_data_file_system_helper.h" | 27 #include "chrome/browser/browsing_data/browsing_data_file_system_helper.h" |
| 28 #include "chrome/browser/browsing_data/browsing_data_indexed_db_helper.h" | 28 #include "chrome/browser/browsing_data/browsing_data_indexed_db_helper.h" |
| 29 #include "chrome/browser/browsing_data/browsing_data_local_storage_helper.h" | 29 #include "chrome/browser/browsing_data/browsing_data_local_storage_helper.h" |
| 30 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" | 30 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" |
| 31 #include "chrome/browser/content_settings/local_shared_objects_container.h" | 31 #include "chrome/browser/content_settings/local_shared_objects_container.h" |
| 32 #include "chrome/browser/history/history_service_factory.h" | 32 #include "chrome/browser/history/history_service_factory.h" |
| 33 #include "chrome/browser/infobars/infobar_service.h" | 33 #include "chrome/browser/infobars/infobar_service.h" |
| 34 #include "chrome/browser/permissions/chooser_context_base.h" | 34 #include "chrome/browser/permissions/chooser_context_base.h" |
| 35 #include "chrome/browser/permissions/permission_decision_auto_blocker.h" |
| 35 #include "chrome/browser/permissions/permission_manager.h" | 36 #include "chrome/browser/permissions/permission_manager.h" |
| 36 #include "chrome/browser/permissions/permission_result.h" | 37 #include "chrome/browser/permissions/permission_result.h" |
| 37 #include "chrome/browser/permissions/permission_uma_util.h" | 38 #include "chrome/browser/permissions/permission_uma_util.h" |
| 38 #include "chrome/browser/permissions/permission_util.h" | 39 #include "chrome/browser/permissions/permission_util.h" |
| 39 #include "chrome/browser/profiles/profile.h" | 40 #include "chrome/browser/profiles/profile.h" |
| 40 #include "chrome/browser/ssl/chrome_ssl_host_state_delegate.h" | 41 #include "chrome/browser/ssl/chrome_ssl_host_state_delegate.h" |
| 41 #include "chrome/browser/ssl/chrome_ssl_host_state_delegate_factory.h" | 42 #include "chrome/browser/ssl/chrome_ssl_host_state_delegate_factory.h" |
| 42 #include "chrome/browser/ui/page_info/page_info_ui.h" | 43 #include "chrome/browser/ui/page_info/page_info_ui.h" |
| 43 #include "chrome/browser/usb/usb_chooser_context.h" | 44 #include "chrome/browser/usb/usb_chooser_context.h" |
| 44 #include "chrome/browser/usb/usb_chooser_context_factory.h" | 45 #include "chrome/browser/usb/usb_chooser_context_factory.h" |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 "WebsiteSettings.OriginInfo.PermissionChanged.Blocked", histogram_value, | 334 "WebsiteSettings.OriginInfo.PermissionChanged.Blocked", histogram_value, |
| 334 num_values); | 335 num_values); |
| 335 } | 336 } |
| 336 | 337 |
| 337 // This is technically redundant given the histogram above, but putting the | 338 // This is technically redundant given the histogram above, but putting the |
| 338 // total count of permission changes in another histogram makes it easier to | 339 // total count of permission changes in another histogram makes it easier to |
| 339 // compare it against other kinds of actions in PageInfo[PopupView]. | 340 // compare it against other kinds of actions in PageInfo[PopupView]. |
| 340 RecordPageInfoAction(PAGE_INFO_CHANGED_PERMISSION); | 341 RecordPageInfoAction(PAGE_INFO_CHANGED_PERMISSION); |
| 341 | 342 |
| 342 PermissionUtil::ScopedRevocationReporter scoped_revocation_reporter( | 343 PermissionUtil::ScopedRevocationReporter scoped_revocation_reporter( |
| 343 this->profile_, this->site_url_, this->site_url_, type, | 344 profile_, site_url_, site_url_, type, PermissionSourceUI::OIB); |
| 344 PermissionSourceUI::OIB); | |
| 345 | 345 |
| 346 // The permission may have been blocked due to being under embargo, so if it |
| 347 // was changed away from BLOCK, clear embargo status if it exists. |
| 348 if (setting != CONTENT_SETTING_BLOCK) { |
| 349 PermissionDecisionAutoBlocker::GetForProfile(profile_)->RemoveEmbargoByUrl( |
| 350 site_url_, type); |
| 351 } |
| 346 content_settings_->SetNarrowestContentSetting(site_url_, site_url_, type, | 352 content_settings_->SetNarrowestContentSetting(site_url_, site_url_, type, |
| 347 setting); | 353 setting); |
| 348 | 354 |
| 349 show_info_bar_ = true; | 355 show_info_bar_ = true; |
| 350 | 356 |
| 351 // Refresh the UI to reflect the new setting. | 357 // Refresh the UI to reflect the new setting. |
| 352 PresentSitePermissions(); | 358 PresentSitePermissions(); |
| 353 } | 359 } |
| 354 | 360 |
| 355 void PageInfo::OnSiteChosenObjectDeleted(const ChooserUIInfo& ui_info, | 361 void PageInfo::OnSiteChosenObjectDeleted(const ChooserUIInfo& ui_info, |
| (...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 763 info.site_identity = UTF16ToUTF8(GetSimpleSiteName(site_url_)); | 769 info.site_identity = UTF16ToUTF8(GetSimpleSiteName(site_url_)); |
| 764 | 770 |
| 765 info.connection_status = site_connection_status_; | 771 info.connection_status = site_connection_status_; |
| 766 info.connection_status_description = UTF16ToUTF8(site_connection_details_); | 772 info.connection_status_description = UTF16ToUTF8(site_connection_details_); |
| 767 info.identity_status = site_identity_status_; | 773 info.identity_status = site_identity_status_; |
| 768 info.identity_status_description = UTF16ToUTF8(site_identity_details_); | 774 info.identity_status_description = UTF16ToUTF8(site_identity_details_); |
| 769 info.certificate = certificate_; | 775 info.certificate = certificate_; |
| 770 info.show_ssl_decision_revoke_button = show_ssl_decision_revoke_button_; | 776 info.show_ssl_decision_revoke_button = show_ssl_decision_revoke_button_; |
| 771 ui_->SetIdentityInfo(info); | 777 ui_->SetIdentityInfo(info); |
| 772 } | 778 } |
| OLD | NEW |