| 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/content_settings/tab_specific_content_settings.h" | 5 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
| 6 | 6 |
| 7 #include <list> | 7 #include <list> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 516 void TabSpecificContentSettings::OnGeolocationPermissionSet( | 516 void TabSpecificContentSettings::OnGeolocationPermissionSet( |
| 517 const GURL& requesting_origin, | 517 const GURL& requesting_origin, |
| 518 bool allowed) { | 518 bool allowed) { |
| 519 geolocation_usages_state_.OnPermissionSet(requesting_origin, allowed); | 519 geolocation_usages_state_.OnPermissionSet(requesting_origin, allowed); |
| 520 content::NotificationService::current()->Notify( | 520 content::NotificationService::current()->Notify( |
| 521 chrome::NOTIFICATION_WEB_CONTENT_SETTINGS_CHANGED, | 521 chrome::NOTIFICATION_WEB_CONTENT_SETTINGS_CHANGED, |
| 522 content::Source<WebContents>(web_contents()), | 522 content::Source<WebContents>(web_contents()), |
| 523 content::NotificationService::NoDetails()); | 523 content::NotificationService::NoDetails()); |
| 524 } | 524 } |
| 525 | 525 |
| 526 void TabSpecificContentSettings::OnDidUseKeygen() { |
| 527 OnContentBlocked(CONTENT_SETTINGS_TYPE_KEYGEN); |
| 528 } |
| 529 |
| 526 #if defined(OS_ANDROID) || defined(OS_CHROMEOS) | 530 #if defined(OS_ANDROID) || defined(OS_CHROMEOS) |
| 527 void TabSpecificContentSettings::OnProtectedMediaIdentifierPermissionSet( | 531 void TabSpecificContentSettings::OnProtectedMediaIdentifierPermissionSet( |
| 528 const GURL& requesting_origin, | 532 const GURL& requesting_origin, |
| 529 bool allowed) { | 533 bool allowed) { |
| 530 if (allowed) { | 534 if (allowed) { |
| 531 OnContentAllowed(CONTENT_SETTINGS_TYPE_PROTECTED_MEDIA_IDENTIFIER); | 535 OnContentAllowed(CONTENT_SETTINGS_TYPE_PROTECTED_MEDIA_IDENTIFIER); |
| 532 } else { | 536 } else { |
| 533 OnContentBlocked(CONTENT_SETTINGS_TYPE_PROTECTED_MEDIA_IDENTIFIER); | 537 OnContentBlocked(CONTENT_SETTINGS_TYPE_PROTECTED_MEDIA_IDENTIFIER); |
| 534 } | 538 } |
| 535 } | 539 } |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 744 render_frame_host->GetRoutingID())); | 748 render_frame_host->GetRoutingID())); |
| 745 } | 749 } |
| 746 | 750 |
| 747 bool TabSpecificContentSettings::OnMessageReceived( | 751 bool TabSpecificContentSettings::OnMessageReceived( |
| 748 const IPC::Message& message, | 752 const IPC::Message& message, |
| 749 content::RenderFrameHost* render_frame_host) { | 753 content::RenderFrameHost* render_frame_host) { |
| 750 bool handled = true; | 754 bool handled = true; |
| 751 IPC_BEGIN_MESSAGE_MAP(TabSpecificContentSettings, message) | 755 IPC_BEGIN_MESSAGE_MAP(TabSpecificContentSettings, message) |
| 752 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_ContentBlocked, | 756 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_ContentBlocked, |
| 753 OnContentBlockedWithDetail) | 757 OnContentBlockedWithDetail) |
| 758 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_DidUseKeygen, |
| 759 OnDidUseKeygen) |
| 754 IPC_MESSAGE_UNHANDLED(handled = false) | 760 IPC_MESSAGE_UNHANDLED(handled = false) |
| 755 IPC_END_MESSAGE_MAP() | 761 IPC_END_MESSAGE_MAP() |
| 756 return handled; | 762 return handled; |
| 757 } | 763 } |
| 758 | 764 |
| 759 void TabSpecificContentSettings::DidNavigateMainFrame( | 765 void TabSpecificContentSettings::DidNavigateMainFrame( |
| 760 const content::LoadCommittedDetails& details, | 766 const content::LoadCommittedDetails& details, |
| 761 const content::FrameNavigateParams& params) { | 767 const content::FrameNavigateParams& params) { |
| 762 if (!details.is_in_page) { | 768 if (!details.is_in_page) { |
| 763 // Clear "blocked" flags. | 769 // Clear "blocked" flags. |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 849 static_cast<MicrophoneCameraStateFlags>( | 855 static_cast<MicrophoneCameraStateFlags>( |
| 850 TabSpecificContentSettings::MICROPHONE_ACCESSED | | 856 TabSpecificContentSettings::MICROPHONE_ACCESSED | |
| 851 TabSpecificContentSettings::MICROPHONE_BLOCKED | | 857 TabSpecificContentSettings::MICROPHONE_BLOCKED | |
| 852 TabSpecificContentSettings::CAMERA_ACCESSED | | 858 TabSpecificContentSettings::CAMERA_ACCESSED | |
| 853 TabSpecificContentSettings::CAMERA_BLOCKED); | 859 TabSpecificContentSettings::CAMERA_BLOCKED); |
| 854 OnMediaStreamPermissionSet( | 860 OnMediaStreamPermissionSet( |
| 855 web_contents()->GetLastCommittedURL(), | 861 web_contents()->GetLastCommittedURL(), |
| 856 media_blocked, | 862 media_blocked, |
| 857 std::string(), std::string(), std::string(), std::string()); | 863 std::string(), std::string(), std::string(), std::string()); |
| 858 } | 864 } |
| OLD | NEW |