ozone: evdev: Sync caps lock LED state to evdev
[chromium-blink-merge.git] / chrome / browser / services / gcm / gcm_profile_service.h
blob4adb01f9b29ca7c20224ff9e567a943411b38cac
1 // Copyright (c) 2013 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.
5 #ifndef CHROME_BROWSER_SERVICES_GCM_GCM_PROFILE_SERVICE_H_
6 #define CHROME_BROWSER_SERVICES_GCM_GCM_PROFILE_SERVICE_H_
8 #include <string>
10 #include "base/compiler_specific.h"
11 #include "base/macros.h"
12 #include "base/memory/scoped_ptr.h"
13 #include "chrome/browser/services/gcm/push_messaging_service_impl.h"
14 #include "components/keyed_service/core/keyed_service.h"
16 class Profile;
18 namespace user_prefs {
19 class PrefRegistrySyncable;
22 namespace gcm {
24 class GCMClientFactory;
25 class GCMDriver;
27 #if defined(OS_CHROMEOS)
28 class GCMConnectionObserver;
29 #endif
31 // Providing GCM service, via GCMDriver, to a profile.
32 class GCMProfileService : public KeyedService {
33 public:
34 // Returns whether GCM is enabled for |profile|.
35 static bool IsGCMEnabled(Profile* profile);
37 // Register profile-specific prefs for GCM.
38 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);
40 #if defined(OS_ANDROID)
41 explicit GCMProfileService(Profile* profile);
42 #else
43 GCMProfileService(Profile* profile,
44 scoped_ptr<GCMClientFactory> gcm_client_factory);
45 #endif
46 ~GCMProfileService() override;
48 // KeyedService:
49 void Shutdown() override;
51 // For testing purpose.
52 void SetDriverForTesting(GCMDriver* driver);
54 GCMDriver* driver() const { return driver_.get(); }
56 content::PushMessagingService* push_messaging_service() {
57 return &push_messaging_service_;
60 protected:
61 // Used for constructing fake GCMProfileService for testing purpose.
62 GCMProfileService();
64 private:
65 // The profile which owns this object.
66 Profile* profile_;
68 scoped_ptr<GCMDriver> driver_;
70 // Implementation of content::PushMessagingService using GCMProfileService.
71 PushMessagingServiceImpl push_messaging_service_;
73 // Used for both account tracker and GCM.UserSignedIn UMA.
74 #if !defined(OS_ANDROID)
75 class IdentityObserver;
76 scoped_ptr<IdentityObserver> identity_observer_;
77 #endif
79 DISALLOW_COPY_AND_ASSIGN(GCMProfileService);
82 } // namespace gcm
84 #endif // CHROME_BROWSER_SERVICES_GCM_GCM_PROFILE_SERVICE_H_