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" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 // After this you can override several other methods to customize behavior, | 45 // After this you can override several other methods to customize behavior, |
46 // in particular it is advised to override UpdateTabContext in order to manage | 46 // in particular it is advised to override UpdateTabContext in order to manage |
47 // the permission from the omnibox. | 47 // the permission from the omnibox. |
48 // See midi_permission_context.h/cc or push_permission_context.cc/h for some | 48 // See midi_permission_context.h/cc or push_permission_context.cc/h for some |
49 // examples. | 49 // examples. |
50 | 50 |
51 class PermissionContextBase : public KeyedService { | 51 class PermissionContextBase : public KeyedService { |
52 public: | 52 public: |
53 PermissionContextBase(Profile* profile, | 53 PermissionContextBase(Profile* profile, |
54 const ContentSettingsType permission_type); | 54 const ContentSettingsType permission_type); |
55 virtual ~PermissionContextBase(); | 55 ~PermissionContextBase() override; |
56 | 56 |
57 // The renderer is requesting permission to push messages. | 57 // The renderer is requesting permission to push messages. |
58 // When the answer to a permission request has been determined, |callback| | 58 // When the answer to a permission request has been determined, |callback| |
59 // should be called with the result. | 59 // should be called with the result. |
60 virtual void RequestPermission(content::WebContents* web_contents, | 60 virtual void RequestPermission(content::WebContents* web_contents, |
61 const PermissionRequestID& id, | 61 const PermissionRequestID& id, |
62 const GURL& requesting_frame, | 62 const GURL& requesting_frame, |
63 bool user_gesture, | 63 bool user_gesture, |
64 const BrowserPermissionCallback& callback); | 64 const BrowserPermissionCallback& callback); |
65 | 65 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 scoped_ptr<PermissionQueueController> permission_queue_controller_; | 120 scoped_ptr<PermissionQueueController> permission_queue_controller_; |
121 base::ScopedPtrHashMap<std::string, PermissionBubbleRequest> | 121 base::ScopedPtrHashMap<std::string, PermissionBubbleRequest> |
122 pending_bubbles_; | 122 pending_bubbles_; |
123 | 123 |
124 // Must be the last member, to ensure that it will be | 124 // Must be the last member, to ensure that it will be |
125 // destroyed first, which will invalidate weak pointers | 125 // destroyed first, which will invalidate weak pointers |
126 base::WeakPtrFactory<PermissionContextBase> weak_factory_; | 126 base::WeakPtrFactory<PermissionContextBase> weak_factory_; |
127 }; | 127 }; |
128 | 128 |
129 #endif // CHROME_BROWSER_CONTENT_SETTINGS_PERMISSION_CONTEXT_BASE_H_ | 129 #endif // CHROME_BROWSER_CONTENT_SETTINGS_PERMISSION_CONTEXT_BASE_H_ |
OLD | NEW |