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

Side by Side Diff: chrome/browser/services/gcm/push_messaging_permission_context.h

Issue 896173002: Clean-up refactoring of chrome_content_browser_client to use GetPermissionContext consistently. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 10 months 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_SERVICES_GCM_PUSH_MESSAGING_PERMISSION_CONTEXT_H_ 5 #ifndef CHROME_BROWSER_SERVICES_GCM_PUSH_MESSAGING_PERMISSION_CONTEXT_H_
6 #define CHROME_BROWSER_SERVICES_GCM_PUSH_MESSAGING_PERMISSION_CONTEXT_H_ 6 #define CHROME_BROWSER_SERVICES_GCM_PUSH_MESSAGING_PERMISSION_CONTEXT_H_
7 7
8 #include "chrome/browser/content_settings/permission_context_base.h" 8 #include "chrome/browser/content_settings/permission_context_base.h"
9 9
10 #include "components/content_settings/core/common/content_settings_types.h" 10 #include "components/content_settings/core/common/content_settings_types.h"
11 11
12 class PermissionRequestID; 12 class PermissionRequestID;
13 class Profile; 13 class Profile;
14 14
15 namespace gcm { 15 namespace gcm {
16 16
17 // Permission context for push messages. 17 // Permission context for push messages.
18 class PushMessagingPermissionContext : public PermissionContextBase { 18 class PushMessagingPermissionContext : public PermissionContextBase {
19 public: 19 public:
20 explicit PushMessagingPermissionContext(Profile* profile); 20 explicit PushMessagingPermissionContext(Profile* profile);
21 ~PushMessagingPermissionContext() override; 21 ~PushMessagingPermissionContext() override;
22 22
23 // PermissionContextBase: 23 // PermissionContextBase:
24 ContentSetting GetPermissionStatus( 24 ContentSetting GetPermissionStatus(
25 const GURL& requesting_origin, 25 const GURL& requesting_origin,
26 const GURL& embedding_origin) const override; 26 const GURL& embedding_origin) const override;
27 27
28 void CancelPermissionRequest(content::WebContents* web_contents,
29 const PermissionRequestID& id) override;
30
28 protected: 31 protected:
29 // PermissionContextBase: 32 // PermissionContextBase:
30 void DecidePermission(content::WebContents* web_contents, 33 void DecidePermission(content::WebContents* web_contents,
31 const PermissionRequestID& id, 34 const PermissionRequestID& id,
32 const GURL& requesting_origin, 35 const GURL& requesting_origin,
33 const GURL& embedding_origin, 36 const GURL& embedding_origin,
34 bool user_gesture, 37 bool user_gesture,
35 const BrowserPermissionCallback& callback) override; 38 const BrowserPermissionCallback& callback) override;
36 39
37 private: 40 private:
(...skipping 12 matching lines...) Expand all
50 53
51 // Must be the last member, to ensure that it will be 54 // Must be the last member, to ensure that it will be
52 // destroyed first, which will invalidate weak pointers 55 // destroyed first, which will invalidate weak pointers
53 base::WeakPtrFactory<PushMessagingPermissionContext> weak_factory_ui_thread_; 56 base::WeakPtrFactory<PushMessagingPermissionContext> weak_factory_ui_thread_;
54 57
55 DISALLOW_COPY_AND_ASSIGN(PushMessagingPermissionContext); 58 DISALLOW_COPY_AND_ASSIGN(PushMessagingPermissionContext);
56 }; 59 };
57 60
58 } // namespace gcm 61 } // namespace gcm
59 #endif // CHROME_BROWSER_SERVICES_GCM_PUSH_MESSAGING_PERMISSION_CONTEXT_H_ 62 #endif // CHROME_BROWSER_SERVICES_GCM_PUSH_MESSAGING_PERMISSION_CONTEXT_H_
OLDNEW
« no previous file with comments | « chrome/browser/chrome_content_browser_client.cc ('k') | chrome/browser/services/gcm/push_messaging_permission_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698