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

Side by Side Diff: chrome/browser/extensions/api/input_ime/input_ime_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: - 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 #ifndef CHROME_BROWSER_EXTENSIONS_API_INPUT_IME_INPUT_IME_API_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_INPUT_IME_INPUT_IME_API_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_INPUT_IME_INPUT_IME_API_H_ 6 #define CHROME_BROWSER_EXTENSIONS_API_INPUT_IME_INPUT_IME_API_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 // ExtensionFunction: 172 // ExtensionFunction:
173 virtual bool RunImpl() OVERRIDE; 173 virtual bool RunImpl() OVERRIDE;
174 }; 174 };
175 175
176 class InputImeAPI : public ProfileKeyedAPI, 176 class InputImeAPI : public ProfileKeyedAPI,
177 public content::NotificationObserver { 177 public content::NotificationObserver {
178 public: 178 public:
179 explicit InputImeAPI(Profile* profile); 179 explicit InputImeAPI(Profile* profile);
180 virtual ~InputImeAPI(); 180 virtual ~InputImeAPI();
181 181
182 // ProfileKeyedAPI implementation.
183 static ProfileKeyedAPIFactory<InputImeAPI>* GetInstance();
Jeffrey Yasskin 2013/01/04 22:39:23 GetInstance or GetFactoryInstance?
Yoyo Zhou 2013/01/04 22:43:32 oops.
184
182 // content::NotificationObserver implementation. 185 // content::NotificationObserver implementation.
183 virtual void Observe(int type, 186 virtual void Observe(int type,
184 const content::NotificationSource& source, 187 const content::NotificationSource& source,
185 const content::NotificationDetails& details) OVERRIDE; 188 const content::NotificationDetails& details) OVERRIDE;
186 189
187 private: 190 private:
188 friend class ProfileKeyedAPIFactory<InputImeAPI>; 191 friend class ProfileKeyedAPIFactory<InputImeAPI>;
189 InputImeEventRouter* input_ime_event_router(); 192 InputImeEventRouter* input_ime_event_router();
190 193
191 // ProfileKeyedAPI implementation. 194 // ProfileKeyedAPI implementation.
192 static const char* service_name() { 195 static const char* service_name() {
193 return "InputImeAPI"; 196 return "InputImeAPI";
194 } 197 }
195 static const bool kServiceIsNULLWhileTesting = true; 198 static const bool kServiceIsNULLWhileTesting = true;
196 199
197 Profile* const profile_; 200 Profile* const profile_;
198 content::NotificationRegistrar registrar_; 201 content::NotificationRegistrar registrar_;
199 }; 202 };
200 203
201 template <>
202 ProfileKeyedAPIFactory<InputImeAPI>*
203 ProfileKeyedAPIFactory<InputImeAPI>::GetInstance();
204
205 } // namespace extensions 204 } // namespace extensions
206 205
207 #endif // CHROME_BROWSER_EXTENSIONS_API_INPUT_IME_INPUT_IME_API_H_ 206 #endif // CHROME_BROWSER_EXTENSIONS_API_INPUT_IME_INPUT_IME_API_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/cookies/cookies_api.cc ('k') | chrome/browser/extensions/api/input_ime/input_ime_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698