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

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

Issue 661463002: Implement PushManager#hasPermission (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Support all three possible states of the permission Created 6 years, 2 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_SERVICE_IMPL_H_ 5 #ifndef CHROME_BROWSER_SERVICES_GCM_PUSH_MESSAGING_SERVICE_IMPL_H_
6 #define CHROME_BROWSER_SERVICES_GCM_PUSH_MESSAGING_SERVICE_IMPL_H_ 6 #define CHROME_BROWSER_SERVICES_GCM_PUSH_MESSAGING_SERVICE_IMPL_H_
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "components/gcm_driver/gcm_app_handler.h" 10 #include "components/gcm_driver/gcm_app_handler.h"
11 #include "components/gcm_driver/gcm_client.h" 11 #include "components/gcm_driver/gcm_client.h"
12 #include "content/public/browser/push_messaging_service.h" 12 #include "content/public/browser/push_messaging_service.h"
13 #include "content/public/common/push_messaging_status.h" 13 #include "content/public/common/push_messaging_status.h"
14 #include "third_party/WebKit/public/platform/WebPushPermissionCallback.h"
14 15
15 class Profile; 16 class Profile;
16 17
18 typedef blink::WebPushPermissionCallback::PushPermissionStatus
19 PushPermissionStatus;
mlamouri (slow - plz ping) 2014/10/16 09:04:57 Do we allow typedef's to be added in a header?
Miguel Garcia 2014/10/16 13:50:26 I see this all the time https://cs.corp.google.com
mlamouri (slow - plz ping) 2014/10/17 09:30:56 I see it being used inside classes or when a class
20
17 namespace user_prefs { 21 namespace user_prefs {
18 class PrefRegistrySyncable; 22 class PrefRegistrySyncable;
19 } 23 }
20 24
21 namespace gcm { 25 namespace gcm {
22 26
23 class GCMProfileService; 27 class GCMProfileService;
24 struct PushMessagingApplicationId; 28 struct PushMessagingApplicationId;
25 29
26 class PushMessagingServiceImpl : public content::PushMessagingService, 30 class PushMessagingServiceImpl : public content::PushMessagingService,
(...skipping 23 matching lines...) Expand all
50 54
51 // content::PushMessagingService implementation: 55 // content::PushMessagingService implementation:
52 virtual void Register( 56 virtual void Register(
53 const GURL& origin, 57 const GURL& origin,
54 int64 service_worker_registration_id, 58 int64 service_worker_registration_id,
55 const std::string& sender_id, 59 const std::string& sender_id,
56 int renderer_id, 60 int renderer_id,
57 int render_frame_id, 61 int render_frame_id,
58 bool user_gesture, 62 bool user_gesture,
59 const content::PushMessagingService::RegisterCallback& callback) override; 63 const content::PushMessagingService::RegisterCallback& callback) override;
64 virtual PushPermissionStatus PermissionStatus(
65 const GURL& requesting_origin, int renderer_id,
66 int render_frame_id) override;
60 67
61 private: 68 private:
62 void DeliverMessageCallback(const PushMessagingApplicationId& application_id, 69 void DeliverMessageCallback(const PushMessagingApplicationId& application_id,
63 const GCMClient::IncomingMessage& message, 70 const GCMClient::IncomingMessage& message,
64 content::PushMessagingStatus status); 71 content::PushMessagingStatus status);
65 72
66 void RegisterEnd( 73 void RegisterEnd(
67 const content::PushMessagingService::RegisterCallback& callback, 74 const content::PushMessagingService::RegisterCallback& callback,
68 const std::string& registration_id, 75 const std::string& registration_id,
69 content::PushMessagingStatus status); 76 content::PushMessagingStatus status);
(...skipping 14 matching lines...) Expand all
84 Profile* profile_; // It owns our owner. 91 Profile* profile_; // It owns our owner.
85 92
86 base::WeakPtrFactory<PushMessagingServiceImpl> weak_factory_; 93 base::WeakPtrFactory<PushMessagingServiceImpl> weak_factory_;
87 94
88 DISALLOW_COPY_AND_ASSIGN(PushMessagingServiceImpl); 95 DISALLOW_COPY_AND_ASSIGN(PushMessagingServiceImpl);
89 }; 96 };
90 97
91 } // namespace gcm 98 } // namespace gcm
92 99
93 #endif // CHROME_BROWSER_SERVICES_GCM_PUSH_MESSAGING_SERVICE_IMPL_H_ 100 #endif // CHROME_BROWSER_SERVICES_GCM_PUSH_MESSAGING_SERVICE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698