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

Side by Side Diff: chrome/browser/extensions/extension_gcm_app_handler.h

Issue 286213003: Make GCMProfileService own GCMDriver, instead of deriving from it (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync Created 6 years, 7 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
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_EXTENSIONS_EXTENSION_GCM_APP_HANDLER_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_GCM_APP_HANDLER_H_
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_GCM_APP_HANDLER_H_ 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_GCM_APP_HANDLER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
13 #include "base/memory/weak_ptr.h" 13 #include "base/memory/weak_ptr.h"
14 #include "base/scoped_observer.h" 14 #include "base/scoped_observer.h"
15 #include "components/gcm_driver/gcm_app_handler.h" 15 #include "components/gcm_driver/gcm_app_handler.h"
16 #include "content/public/browser/notification_observer.h" 16 #include "content/public/browser/notification_observer.h"
17 #include "content/public/browser/notification_registrar.h" 17 #include "content/public/browser/notification_registrar.h"
18 #include "extensions/browser/browser_context_keyed_api_factory.h" 18 #include "extensions/browser/browser_context_keyed_api_factory.h"
19 #include "extensions/browser/extension_registry_observer.h" 19 #include "extensions/browser/extension_registry_observer.h"
20 #include "google_apis/gcm/gcm_client.h" 20 #include "google_apis/gcm/gcm_client.h"
21 21
22 class Profile; 22 class Profile;
23 23
24 namespace content { 24 namespace content {
25 class BrowserContext; 25 class BrowserContext;
26 } 26 }
27 27
28 namespace gcm { 28 namespace gcm {
29 class GCMDriver;
29 class GCMProfileService; 30 class GCMProfileService;
30 } 31 }
31 32
32 namespace extensions { 33 namespace extensions {
33 34
34 class ExtensionRegistry; 35 class ExtensionRegistry;
35 class GcmJsEventRouter; 36 class GcmJsEventRouter;
36 37
37 // Defines the interface to provide handling logic for a given app. 38 // Defines the interface to provide handling logic for a given app.
38 class ExtensionGCMAppHandler : public gcm::GCMAppHandler, 39 class ExtensionGCMAppHandler : public gcm::GCMAppHandler,
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 const content::NotificationDetails& details) OVERRIDE; 71 const content::NotificationDetails& details) OVERRIDE;
71 72
72 // ExtensionRegistryObserver implementation. 73 // ExtensionRegistryObserver implementation.
73 virtual void OnExtensionLoaded(content::BrowserContext* browser_context, 74 virtual void OnExtensionLoaded(content::BrowserContext* browser_context,
74 const Extension* extension) OVERRIDE; 75 const Extension* extension) OVERRIDE;
75 virtual void OnExtensionUnloaded( 76 virtual void OnExtensionUnloaded(
76 content::BrowserContext* browser_context, 77 content::BrowserContext* browser_context,
77 const Extension* extension, 78 const Extension* extension,
78 UnloadedExtensionInfo::Reason reason) OVERRIDE; 79 UnloadedExtensionInfo::Reason reason) OVERRIDE;
79 80
80 gcm::GCMProfileService* GetGCMProfileService() const; 81 gcm::GCMDriver* GetGCMDriver() const;
81 82
82 // BrowserContextKeyedAPI implementation. 83 // BrowserContextKeyedAPI implementation.
83 static const char* service_name() { return "ExtensionGCMAppHandler"; } 84 static const char* service_name() { return "ExtensionGCMAppHandler"; }
84 static const bool kServiceIsNULLWhileTesting = true; 85 static const bool kServiceIsNULLWhileTesting = true;
85 86
86 Profile* profile_; 87 Profile* profile_;
87 content::NotificationRegistrar registrar_; 88 content::NotificationRegistrar registrar_;
88 89
89 // Listen to extension load, unloaded notifications. 90 // Listen to extension load, unloaded notifications.
90 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> 91 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver>
91 extension_registry_observer_; 92 extension_registry_observer_;
92 93
93 #if !defined(OS_ANDROID) 94 #if !defined(OS_ANDROID)
94 scoped_ptr<extensions::GcmJsEventRouter> js_event_router_; 95 scoped_ptr<extensions::GcmJsEventRouter> js_event_router_;
95 #endif 96 #endif
96 97
97 base::WeakPtrFactory<ExtensionGCMAppHandler> weak_factory_; 98 base::WeakPtrFactory<ExtensionGCMAppHandler> weak_factory_;
98 99
99 DISALLOW_COPY_AND_ASSIGN(ExtensionGCMAppHandler); 100 DISALLOW_COPY_AND_ASSIGN(ExtensionGCMAppHandler);
100 }; 101 };
101 102
102 } // namespace extensions 103 } // namespace extensions
103 104
104 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_GCM_APP_HANDLER_H_ 105 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_GCM_APP_HANDLER_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/gcm/gcm_apitest.cc ('k') | chrome/browser/extensions/extension_gcm_app_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698