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

Side by Side Diff: chrome/browser/extensions/api/managed_mode/managed_mode_api.h

Issue 11682005: Remove some Profile-keyed factory boilerplate: management omnibox preference push_messaging. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 11 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // Defines the Chrome Extensions Managed Mode API relevant classes to realize 5 // Defines the Chrome Extensions Managed Mode API relevant classes to realize
6 // the API as specified in the extension API JSON. 6 // the API as specified in the extension API JSON.
7 7
8 #ifndef CHROME_BROWSER_EXTENSIONS_API_MANAGED_MODE_MANAGED_MODE_API_H_ 8 #ifndef CHROME_BROWSER_EXTENSIONS_API_MANAGED_MODE_MANAGED_MODE_API_H_
9 #define CHROME_BROWSER_EXTENSIONS_API_MANAGED_MODE_MANAGED_MODE_API_H_ 9 #define CHROME_BROWSER_EXTENSIONS_API_MANAGED_MODE_MANAGED_MODE_API_H_
10 10
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 83
84 class ManagedModeAPI : public ProfileKeyedAPI, 84 class ManagedModeAPI : public ProfileKeyedAPI,
85 public extensions::EventRouter::Observer { 85 public extensions::EventRouter::Observer {
86 public: 86 public:
87 explicit ManagedModeAPI(Profile* profile); 87 explicit ManagedModeAPI(Profile* profile);
88 virtual ~ManagedModeAPI(); 88 virtual ~ManagedModeAPI();
89 89
90 // ProfileKeyedService implementation. 90 // ProfileKeyedService implementation.
91 virtual void Shutdown() OVERRIDE; 91 virtual void Shutdown() OVERRIDE;
92 92
93 // ProfileKeyedAPIFactory implementation.
94 static ProfileKeyedAPIFactory<ManagedModeAPI>* GetFactoryInstance();
95
93 // EventRouter::Observer implementation. 96 // EventRouter::Observer implementation.
94 virtual void OnListenerAdded(const extensions::EventListenerInfo& details) 97 virtual void OnListenerAdded(const extensions::EventListenerInfo& details)
95 OVERRIDE; 98 OVERRIDE;
96 99
97 private: 100 private:
98 friend class ProfileKeyedAPIFactory<ManagedModeAPI>; 101 friend class ProfileKeyedAPIFactory<ManagedModeAPI>;
99 102
100 Profile* profile_; 103 Profile* profile_;
101 104
102 // ProfileKeyedAPI implementation. 105 // ProfileKeyedAPI implementation.
103 static const char* service_name() { 106 static const char* service_name() {
104 return "ManagedModeAPI"; 107 return "ManagedModeAPI";
105 } 108 }
106 static const bool kServiceIsNULLWhileTesting = true; 109 static const bool kServiceIsNULLWhileTesting = true;
107 110
108 // Created lazily upon OnListenerAdded. 111 // Created lazily upon OnListenerAdded.
109 scoped_ptr<ManagedModeEventRouter> managed_mode_event_router_; 112 scoped_ptr<ManagedModeEventRouter> managed_mode_event_router_;
110 113
111 DISALLOW_COPY_AND_ASSIGN(ManagedModeAPI); 114 DISALLOW_COPY_AND_ASSIGN(ManagedModeAPI);
112 }; 115 };
113 116
114 template <>
115 ProfileKeyedAPIFactory<ManagedModeAPI>*
116 ProfileKeyedAPIFactory<ManagedModeAPI>::GetInstance();
117
118 } // namespace extensions 117 } // namespace extensions
119 118
120 #endif // CHROME_BROWSER_EXTENSIONS_API_MANAGED_MODE_MANAGED_MODE_API_H_ 119 #endif // CHROME_BROWSER_EXTENSIONS_API_MANAGED_MODE_MANAGED_MODE_API_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698