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

Side by Side Diff: chrome/browser/services/gcm/gcm_permission_context_factory.cc

Issue 343743004: Implement a permission check for push. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments from Peter, Bernhard and Elliot Created 6 years, 6 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 | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/services/gcm/gcm_permission_context_factory.h"
6
7 #include "chrome/browser/profiles/incognito_helpers.h"
8 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/browser/services/gcm/gcm_permission_context.h"
10 #include "components/keyed_service/content/browser_context_dependency_manager.h"
11
12 namespace gcm {
13 // static
jianli 2014/06/20 17:19:29 nit: empty line before this line
Miguel Garcia 2014/06/20 20:50:12 Done.
14 GCMPermissionContext* GCMPermissionContextFactory::GetForProfile(
15 Profile* profile) {
16 return static_cast<GCMPermissionContext*>(
17 GetInstance()->GetServiceForBrowserContext(profile, true));
18 }
19
20 // static
21 GCMPermissionContextFactory* GCMPermissionContextFactory::GetInstance() {
22 return Singleton<GCMPermissionContextFactory>::get();
23 }
24
25 GCMPermissionContextFactory::GCMPermissionContextFactory()
26 : BrowserContextKeyedServiceFactory(
27 "GCMPermissionContext",
28 BrowserContextDependencyManager::GetInstance()) {
29 }
30
31 GCMPermissionContextFactory::~GCMPermissionContextFactory() {
32 }
33
34 KeyedService* GCMPermissionContextFactory::BuildServiceInstanceFor(
35 content::BrowserContext* profile) const {
36 return new GCMPermissionContext(static_cast<Profile*>(profile));
37 }
38
39 content::BrowserContext* GCMPermissionContextFactory::GetBrowserContextToUse(
40 content::BrowserContext* context) const {
41 return chrome::GetBrowserContextOwnInstanceInIncognito(context);
42 }
43
44 } // namespace gcm
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698