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/pepper_flash_settings_manager.h" | 5 #include "chrome/browser/pepper_flash_settings_manager.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
675 BrowserThread::UI, FROM_HERE, | 675 BrowserThread::UI, FROM_HERE, |
676 base::Bind(&Core::NotifyError, this, notifications)); | 676 base::Bind(&Core::NotifyError, this, notifications)); |
677 } | 677 } |
678 | 678 |
679 void PepperFlashSettingsManager::Core:: | 679 void PepperFlashSettingsManager::Core:: |
680 NotifyDeauthorizeContentLicensesCompleted(uint32_t request_id, | 680 NotifyDeauthorizeContentLicensesCompleted(uint32_t request_id, |
681 bool success) { | 681 bool success) { |
682 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 682 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
683 | 683 |
684 if (manager_.get()) { | 684 if (manager_.get()) { |
685 manager_->client_->OnDeauthorizeContentLicensesCompleted( | 685 manager_->client_->OnDeauthorizeFlashContentLicensesCompleted(request_id, |
686 request_id, success); | 686 success); |
687 } | 687 } |
688 } | 688 } |
689 | 689 |
690 void PepperFlashSettingsManager::Core::NotifyGetPermissionSettingsCompleted( | 690 void PepperFlashSettingsManager::Core::NotifyGetPermissionSettingsCompleted( |
691 uint32_t request_id, | 691 uint32_t request_id, |
692 bool success, | 692 bool success, |
693 PP_Flash_BrowserOperations_Permission default_permission, | 693 PP_Flash_BrowserOperations_Permission default_permission, |
694 const ppapi::FlashSiteSettings& sites) { | 694 const ppapi::FlashSiteSettings& sites) { |
695 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 695 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
696 | 696 |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
753 // Check |manager_| for each iteration in case it is destroyed in one of | 753 // Check |manager_| for each iteration in case it is destroyed in one of |
754 // the callbacks. | 754 // the callbacks. |
755 if (!manager_.get()) | 755 if (!manager_.get()) |
756 return; | 756 return; |
757 | 757 |
758 switch (iter->second) { | 758 switch (iter->second) { |
759 case INVALID_REQUEST_TYPE: | 759 case INVALID_REQUEST_TYPE: |
760 NOTREACHED(); | 760 NOTREACHED(); |
761 break; | 761 break; |
762 case DEAUTHORIZE_CONTENT_LICENSES: | 762 case DEAUTHORIZE_CONTENT_LICENSES: |
763 manager_->client_->OnDeauthorizeContentLicensesCompleted( | 763 manager_->client_->OnDeauthorizeFlashContentLicensesCompleted( |
764 iter->first, false); | 764 iter->first, false); |
765 break; | 765 break; |
766 case GET_PERMISSION_SETTINGS: | 766 case GET_PERMISSION_SETTINGS: |
767 manager_->client_->OnGetPermissionSettingsCompleted( | 767 manager_->client_->OnGetPermissionSettingsCompleted( |
768 iter->first, false, PP_FLASH_BROWSEROPERATIONS_PERMISSION_DEFAULT, | 768 iter->first, false, PP_FLASH_BROWSEROPERATIONS_PERMISSION_DEFAULT, |
769 ppapi::FlashSiteSettings()); | 769 ppapi::FlashSiteSettings()); |
770 break; | 770 break; |
771 case SET_DEFAULT_PERMISSION: | 771 case SET_DEFAULT_PERMISSION: |
772 manager_->client_->OnSetDefaultPermissionCompleted( | 772 manager_->client_->OnSetDefaultPermissionCompleted( |
773 iter->first, false); | 773 iter->first, false); |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
963 *plugin_info = *iter; | 963 *plugin_info = *iter; |
964 return true; | 964 return true; |
965 } | 965 } |
966 } | 966 } |
967 return false; | 967 return false; |
968 } | 968 } |
969 | 969 |
970 // static | 970 // static |
971 void PepperFlashSettingsManager::RegisterProfilePrefs( | 971 void PepperFlashSettingsManager::RegisterProfilePrefs( |
972 user_prefs::PrefRegistrySyncable* registry) { | 972 user_prefs::PrefRegistrySyncable* registry) { |
973 registry->RegisterBooleanPref(prefs::kDeauthorizeContentLicenses, false); | |
974 | |
975 registry->RegisterBooleanPref(prefs::kPepperFlashSettingsEnabled, true); | 973 registry->RegisterBooleanPref(prefs::kPepperFlashSettingsEnabled, true); |
976 } | 974 } |
977 | 975 |
978 uint32_t PepperFlashSettingsManager::DeauthorizeContentLicenses( | 976 uint32_t PepperFlashSettingsManager::DeauthorizeContentLicenses( |
979 PrefService* prefs) { | 977 PrefService* prefs) { |
980 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 978 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
981 | 979 |
982 // Clear the device ID salt which has the effect of regenerating a device | 980 // Clear the device ID salt which has the effect of regenerating a device |
983 // ID. Since this happens synchronously (and on the UI thread), we don't have | 981 // ID. Since this happens synchronously (and on the UI thread), we don't have |
984 // to add it to a pending request. | 982 // to add it to a pending request. |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1056 } | 1054 } |
1057 | 1055 |
1058 void PepperFlashSettingsManager::OnError(Core* core) { | 1056 void PepperFlashSettingsManager::OnError(Core* core) { |
1059 DCHECK(core); | 1057 DCHECK(core); |
1060 if (core != core_.get()) | 1058 if (core != core_.get()) |
1061 return; | 1059 return; |
1062 | 1060 |
1063 core_->Detach(); | 1061 core_->Detach(); |
1064 core_ = NULL; | 1062 core_ = NULL; |
1065 } | 1063 } |
OLD | NEW |