Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(194)

Side by Side Diff: chrome/browser/content_settings/permission_context_base.h

Issue 661463002: Implement PushManager#hasPermission (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_types.h" 14 #include "components/content_settings/core/common/content_settings_types.h"
14 #include "components/keyed_service/core/keyed_service.h" 15 #include "components/keyed_service/core/keyed_service.h"
15 #include "url/gurl.h" 16 #include "url/gurl.h"
16 17
17 class PermissionQueueController; 18 class PermissionQueueController;
18 class PermissionRequestID; 19 class PermissionRequestID;
19 class Profile; 20 class Profile;
20 21
21 namespace content { 22 namespace content {
22 class WebContents; 23 class WebContents;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 57
57 // The renderer is requesting permission to push messages. 58 // The renderer is requesting permission to push messages.
58 // When the answer to a permission request has been determined, |callback| 59 // When the answer to a permission request has been determined, |callback|
59 // should be called with the result. 60 // should be called with the result.
60 virtual void RequestPermission(content::WebContents* web_contents, 61 virtual void RequestPermission(content::WebContents* web_contents,
61 const PermissionRequestID& id, 62 const PermissionRequestID& id,
62 const GURL& requesting_frame, 63 const GURL& requesting_frame,
63 bool user_gesture, 64 bool user_gesture,
64 const BrowserPermissionCallback& callback); 65 const BrowserPermissionCallback& callback);
65 66
67 // Returns whether the permission has been granted, denied...
68 virtual ContentSetting PermissionStatus(const GURL& requesting_origin,
palmer 2014/10/29 20:45:25 Gloriously minor nit: choose 1 of -ing, -[oe]r. I'
Miguel Garcia 2014/10/30 12:27:15 Done. I took the chance and made the method const
69 const GURL& embedder_origin);
70
66 // Withdraw an existing permission request, no op if the permission request 71 // Withdraw an existing permission request, no op if the permission request
67 // was already cancelled by some other means. 72 // was already cancelled by some other means.
68 virtual void CancelPermissionRequest(content::WebContents* web_contents, 73 virtual void CancelPermissionRequest(content::WebContents* web_contents,
69 const PermissionRequestID& id); 74 const PermissionRequestID& id);
70 75
71 protected: 76 protected:
72 // Decide whether the permission should be granted. 77 // Decide whether the permission should be granted.
73 // Calls PermissionDecided if permission can be decided non-interactively, 78 // Calls PermissionDecided if permission can be decided non-interactively,
74 // or NotifyPermissionSet if permission decided by presenting an infobar. 79 // or NotifyPermissionSet if permission decided by presenting an infobar.
75 void DecidePermission(content::WebContents* web_contents, 80 void DecidePermission(content::WebContents* web_contents,
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 scoped_ptr<PermissionQueueController> permission_queue_controller_; 125 scoped_ptr<PermissionQueueController> permission_queue_controller_;
121 base::ScopedPtrHashMap<std::string, PermissionBubbleRequest> 126 base::ScopedPtrHashMap<std::string, PermissionBubbleRequest>
122 pending_bubbles_; 127 pending_bubbles_;
123 128
124 // Must be the last member, to ensure that it will be 129 // Must be the last member, to ensure that it will be
125 // destroyed first, which will invalidate weak pointers 130 // destroyed first, which will invalidate weak pointers
126 base::WeakPtrFactory<PermissionContextBase> weak_factory_; 131 base::WeakPtrFactory<PermissionContextBase> weak_factory_;
127 }; 132 };
128 133
129 #endif // CHROME_BROWSER_CONTENT_SETTINGS_PERMISSION_CONTEXT_BASE_H_ 134 #endif // CHROME_BROWSER_CONTENT_SETTINGS_PERMISSION_CONTEXT_BASE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698