| OLD | NEW |
| 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_API_HOTWORD_PRIVATE_HOTWORD_PRIVATE_API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_HOTWORD_PRIVATE_HOTWORD_PRIVATE_API_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_HOTWORD_PRIVATE_HOTWORD_PRIVATE_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_HOTWORD_PRIVATE_HOTWORD_PRIVATE_API_H_ |
| 7 | 7 |
| 8 #include "base/prefs/pref_change_registrar.h" | 8 #include "base/prefs/pref_change_registrar.h" |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "chrome/browser/extensions/chrome_extension_function.h" | 10 #include "chrome/browser/extensions/chrome_extension_function.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 virtual ~HotwordPrivateEventService(); | 23 virtual ~HotwordPrivateEventService(); |
| 24 | 24 |
| 25 // BrowserContextKeyedAPI implementation. | 25 // BrowserContextKeyedAPI implementation. |
| 26 virtual void Shutdown() OVERRIDE; | 26 virtual void Shutdown() OVERRIDE; |
| 27 static BrowserContextKeyedAPIFactory<HotwordPrivateEventService>* | 27 static BrowserContextKeyedAPIFactory<HotwordPrivateEventService>* |
| 28 GetFactoryInstance(); | 28 GetFactoryInstance(); |
| 29 static const char* service_name(); | 29 static const char* service_name(); |
| 30 | 30 |
| 31 void OnEnabledChanged(const std::string& pref_name); | 31 void OnEnabledChanged(const std::string& pref_name); |
| 32 | 32 |
| 33 void OnHotwordSessionRequested(); |
| 34 |
| 35 void OnHotwordSessionStopped(); |
| 36 |
| 33 private: | 37 private: |
| 34 friend class BrowserContextKeyedAPIFactory<HotwordPrivateEventService>; | 38 friend class BrowserContextKeyedAPIFactory<HotwordPrivateEventService>; |
| 35 | 39 |
| 36 void SignalEvent(); | 40 void SignalEvent(const std::string& event_name); |
| 37 | 41 |
| 38 Profile* profile_; | 42 Profile* profile_; |
| 39 PrefChangeRegistrar pref_change_registrar_; | 43 PrefChangeRegistrar pref_change_registrar_; |
| 40 }; | 44 }; |
| 41 | 45 |
| 42 | 46 |
| 43 class HotwordPrivateSetEnabledFunction : public ChromeSyncExtensionFunction { | 47 class HotwordPrivateSetEnabledFunction : public ChromeSyncExtensionFunction { |
| 44 public: | 48 public: |
| 45 DECLARE_EXTENSION_FUNCTION("hotwordPrivate.setEnabled", | 49 DECLARE_EXTENSION_FUNCTION("hotwordPrivate.setEnabled", |
| 46 HOTWORDPRIVATE_SETENABLED) | 50 HOTWORDPRIVATE_SETENABLED) |
| (...skipping 23 matching lines...) Expand all Loading... |
| 70 DECLARE_EXTENSION_FUNCTION("hotwordPrivate.getStatus", | 74 DECLARE_EXTENSION_FUNCTION("hotwordPrivate.getStatus", |
| 71 HOTWORDPRIVATE_GETSTATUS) | 75 HOTWORDPRIVATE_GETSTATUS) |
| 72 | 76 |
| 73 protected: | 77 protected: |
| 74 virtual ~HotwordPrivateGetStatusFunction() {} | 78 virtual ~HotwordPrivateGetStatusFunction() {} |
| 75 | 79 |
| 76 // ExtensionFunction: | 80 // ExtensionFunction: |
| 77 virtual bool RunSync() OVERRIDE; | 81 virtual bool RunSync() OVERRIDE; |
| 78 }; | 82 }; |
| 79 | 83 |
| 84 class HotwordPrivateSetHotwordSessionStateFunction |
| 85 : public ChromeSyncExtensionFunction { |
| 86 public: |
| 87 DECLARE_EXTENSION_FUNCTION("hotwordPrivate.setHotwordSessionState", |
| 88 HOTWORDPRIVATE_SETHOTWORDSESSIONSTATE); |
| 89 |
| 90 protected: |
| 91 virtual ~HotwordPrivateSetHotwordSessionStateFunction() {} |
| 92 |
| 93 // ExtensionFunction: |
| 94 virtual bool RunSync() OVERRIDE; |
| 95 }; |
| 96 |
| 97 class HotwordPrivateNotifyHotwordRecognitionFunction |
| 98 : public ChromeSyncExtensionFunction { |
| 99 public: |
| 100 DECLARE_EXTENSION_FUNCTION("hotwordPrivate.notifyHotwordRecognition", |
| 101 HOTWORDPRIVATE_NOTIFYHOTWORDRECOGNITION); |
| 102 |
| 103 protected: |
| 104 virtual ~HotwordPrivateNotifyHotwordRecognitionFunction() {} |
| 105 |
| 106 // ExtensionFunction: |
| 107 virtual bool RunSync() OVERRIDE; |
| 108 }; |
| 109 |
| 80 } // namespace extensions | 110 } // namespace extensions |
| 81 | 111 |
| 82 #endif // CHROME_BROWSER_EXTENSIONS_API_HOTWORD_PRIVATE_HOTWORD_PRIVATE_API_H_ | 112 #endif // CHROME_BROWSER_EXTENSIONS_API_HOTWORD_PRIVATE_HOTWORD_PRIVATE_API_H_ |
| OLD | NEW |