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

Unified Diff: chrome/browser/extensions/api/input_ime/input_ime_api.h

Issue 11611004: Move the InputComponents out of extensions entirely. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 8 years 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/input_ime/input_ime_api.h
===================================================================
--- chrome/browser/extensions/api/input_ime/input_ime_api.h (revision 174689)
+++ chrome/browser/extensions/api/input_ime/input_ime_api.h (working copy)
@@ -12,8 +12,10 @@
#include "base/memory/singleton.h"
#include "base/values.h"
#include "chrome/browser/chromeos/input_method/input_method_engine.h"
+#include "chrome/browser/extensions/api/profile_keyed_api_factory.h"
#include "chrome/browser/extensions/extension_function.h"
#include "chrome/browser/profiles/profile_keyed_service.h"
+#include "chrome/common/extensions/api/input_ime/input_components_handler.h"
#include "chrome/common/extensions/extension.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
@@ -33,7 +35,7 @@
bool RegisterIme(Profile* profile,
const std::string& extension_id,
- const extensions::Extension::InputComponentInfo& component);
+ const extensions::InputComponentInfo& component);
void UnregisterAllImes(Profile* profile, const std::string& extension_id);
chromeos::InputMethodEngine* GetEngine(const std::string& extension_id,
const std::string& engine_id);
@@ -171,7 +173,7 @@
virtual bool RunImpl() OVERRIDE;
};
-class InputImeAPI : public ProfileKeyedService,
+class InputImeAPI : public ProfileKeyedAPI,
public content::NotificationObserver {
public:
explicit InputImeAPI(Profile* profile);
@@ -183,12 +185,21 @@
const content::NotificationDetails& details) OVERRIDE;
private:
+ friend class ProfileKeyedAPIFactory<InputImeAPI>;
InputImeEventRouter* input_ime_event_router();
+ // ProfileKeyedAPI implementation.
+ static const char* service_name() {
+ return "InputImeAPI";
+ }
Yoyo Zhou 2012/12/28 21:04:28 You need kServiceIsNULLWhileTesting = true; to get
SanjoyPal 2012/12/28 22:38:30 Done.
Profile* const profile_;
content::NotificationRegistrar registrar_;
};
+template <>
+ProfileKeyedAPIFactory<InputImeAPI>*
+ProfileKeyedAPIFactory<InputImeAPI>::GetInstance();
+
} // namespace extensions
#endif // CHROME_BROWSER_EXTENSIONS_API_INPUT_IME_INPUT_IME_API_H_

Powered by Google App Engine
This is Rietveld 408576698