| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef CHROME_BROWSER_CONTENT_SETTINGS_PERMISSION_CONTEXT_BASE_H_ | 5 #ifndef CHROME_BROWSER_CONTENT_SETTINGS_PERMISSION_CONTEXT_BASE_H_ |
| 6 #define CHROME_BROWSER_CONTENT_SETTINGS_PERMISSION_CONTEXT_BASE_H_ | 6 #define CHROME_BROWSER_CONTENT_SETTINGS_PERMISSION_CONTEXT_BASE_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/containers/scoped_ptr_hash_map.h" | 9 #include "base/containers/scoped_ptr_hash_map.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| 11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
| 12 #include "chrome/browser/ui/website_settings/permission_bubble_request.h" | 12 #include "chrome/browser/ui/website_settings/permission_bubble_request.h" |
| 13 #include "components/content_settings/core/common/content_settings.h" | 13 #include "components/content_settings/core/common/content_settings.h" |
| 14 #include "components/content_settings/core/common/content_settings_types.h" | 14 #include "components/content_settings/core/common/content_settings_types.h" |
| 15 #include "components/keyed_service/core/keyed_service.h" | 15 #include "components/keyed_service/core/keyed_service.h" |
| 16 #include "url/gurl.h" | 16 #include "url/gurl.h" |
| 17 | 17 |
| 18 #if defined(OS_CHROMEOS) |
| 19 #include "chrome/browser/chromeos/attestation/platform_verification_flow.h" |
| 20 #endif |
| 21 |
| 18 class PermissionQueueController; | 22 class PermissionQueueController; |
| 19 class PermissionRequestID; | 23 class PermissionRequestID; |
| 20 class Profile; | 24 class Profile; |
| 21 | 25 |
| 22 namespace content { | 26 namespace content { |
| 23 class WebContents; | 27 class WebContents; |
| 24 } | 28 } |
| 25 | 29 |
| 26 typedef base::Callback<void(bool)> BrowserPermissionCallback; | 30 typedef base::Callback<void(bool)> BrowserPermissionCallback; |
| 27 | 31 |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 // virtual since the permission might be stored with different restrictions | 124 // virtual since the permission might be stored with different restrictions |
| 121 // (for example for desktop notifications). | 125 // (for example for desktop notifications). |
| 122 virtual void UpdateContentSetting(const GURL& requesting_origin, | 126 virtual void UpdateContentSetting(const GURL& requesting_origin, |
| 123 const GURL& embedding_origin, | 127 const GURL& embedding_origin, |
| 124 bool allowed); | 128 bool allowed); |
| 125 | 129 |
| 126 private: | 130 private: |
| 127 // Called when a bubble is no longer used so it can be cleaned up. | 131 // Called when a bubble is no longer used so it can be cleaned up. |
| 128 void CleanUpBubble(const PermissionRequestID& id); | 132 void CleanUpBubble(const PermissionRequestID& id); |
| 129 | 133 |
| 134 #if defined(OS_CHROMEOS) |
| 135 void OnPlatformVerificationResult( |
| 136 const PermissionRequestID& id, |
| 137 const GURL& requesting_origin, |
| 138 const GURL& embedding_origin, |
| 139 const BrowserPermissionCallback& callback, |
| 140 chromeos::attestation::PlatformVerificationFlow::ConsentResponse |
| 141 response); |
| 142 #endif |
| 143 |
| 130 Profile* profile_; | 144 Profile* profile_; |
| 131 const ContentSettingsType permission_type_; | 145 const ContentSettingsType permission_type_; |
| 132 scoped_ptr<PermissionQueueController> permission_queue_controller_; | 146 scoped_ptr<PermissionQueueController> permission_queue_controller_; |
| 133 base::ScopedPtrHashMap<std::string, PermissionBubbleRequest> | 147 base::ScopedPtrHashMap<std::string, PermissionBubbleRequest> |
| 134 pending_bubbles_; | 148 pending_bubbles_; |
| 135 | 149 |
| 136 // Must be the last member, to ensure that it will be | 150 // Must be the last member, to ensure that it will be |
| 137 // destroyed first, which will invalidate weak pointers | 151 // destroyed first, which will invalidate weak pointers |
| 138 base::WeakPtrFactory<PermissionContextBase> weak_factory_; | 152 base::WeakPtrFactory<PermissionContextBase> weak_factory_; |
| 139 }; | 153 }; |
| 140 | 154 |
| 141 #endif // CHROME_BROWSER_CONTENT_SETTINGS_PERMISSION_CONTEXT_BASE_H_ | 155 #endif // CHROME_BROWSER_CONTENT_SETTINGS_PERMISSION_CONTEXT_BASE_H_ |
| OLD | NEW |