| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_PERMISSIONS_PERMISSION_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_PERMISSIONS_PERMISSION_MANAGER_H_ |
| 6 #define CHROME_BROWSER_PERMISSIONS_PERMISSION_MANAGER_H_ | 6 #define CHROME_BROWSER_PERMISSIONS_PERMISSION_MANAGER_H_ |
| 7 | 7 |
| 8 #include "base/callback_forward.h" | 8 #include "base/callback_forward.h" |
| 9 #include "base/id_map.h" | 9 #include "base/id_map.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 using PendingRequestsMap = IDMap<PendingRequest, IDMapOwnPointer>; | 59 using PendingRequestsMap = IDMap<PendingRequest, IDMapOwnPointer>; |
| 60 | 60 |
| 61 struct Subscription; | 61 struct Subscription; |
| 62 using SubscriptionsMap = IDMap<Subscription, IDMapOwnPointer>; | 62 using SubscriptionsMap = IDMap<Subscription, IDMapOwnPointer>; |
| 63 | 63 |
| 64 void OnPermissionRequestResponse( | 64 void OnPermissionRequestResponse( |
| 65 int request_id, | 65 int request_id, |
| 66 const base::Callback<void(content::PermissionStatus)>& callback, | 66 const base::Callback<void(content::PermissionStatus)>& callback, |
| 67 ContentSetting content_setting); | 67 ContentSetting content_setting); |
| 68 | 68 |
| 69 // Not all WebContents are able to display permission requests. If the PBM | 69 // Not all WebContents are able to display permission requests. If the UI |
| 70 // is required but missing for |web_contents|, don't pass along the request. | 70 // manager is required but missing for |web_contents|, don't pass along the |
| 71 bool IsPermissionBubbleManagerMissing(content::WebContents* web_contents); | 71 // request. |
| 72 bool IsPermissionUIManagerMissing(content::WebContents* web_contents); |
| 72 | 73 |
| 73 // content_settings::Observer implementation. | 74 // content_settings::Observer implementation. |
| 74 void OnContentSettingChanged(const ContentSettingsPattern& primary_pattern, | 75 void OnContentSettingChanged(const ContentSettingsPattern& primary_pattern, |
| 75 const ContentSettingsPattern& secondary_pattern, | 76 const ContentSettingsPattern& secondary_pattern, |
| 76 ContentSettingsType content_type, | 77 ContentSettingsType content_type, |
| 77 std::string resource_identifier) override; | 78 std::string resource_identifier) override; |
| 78 | 79 |
| 79 Profile* profile_; | 80 Profile* profile_; |
| 80 PendingRequestsMap pending_requests_; | 81 PendingRequestsMap pending_requests_; |
| 81 SubscriptionsMap subscriptions_; | 82 SubscriptionsMap subscriptions_; |
| 82 | 83 |
| 83 base::WeakPtrFactory<PermissionManager> weak_ptr_factory_; | 84 base::WeakPtrFactory<PermissionManager> weak_ptr_factory_; |
| 84 | 85 |
| 85 DISALLOW_COPY_AND_ASSIGN(PermissionManager); | 86 DISALLOW_COPY_AND_ASSIGN(PermissionManager); |
| 86 }; | 87 }; |
| 87 | 88 |
| 88 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_MANAGER_H_ | 89 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_MANAGER_H_ |
| OLD | NEW |