| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_SEARCH_ENGINES_PRIVATE_SEARCH_ENGINES_PRIV
ATE_API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_SEARCH_ENGINES_PRIVATE_SEARCH_ENGINES_PRIV
ATE_API_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_SEARCH_ENGINES_PRIVATE_SEARCH_ENGINES_PRIV
ATE_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_SEARCH_ENGINES_PRIVATE_SEARCH_ENGINES_PRIV
ATE_API_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "chrome/browser/extensions/chrome_extension_function_details.h" | 11 #include "chrome/browser/extensions/chrome_extension_function_details.h" |
| 12 #include "chrome/common/extensions/api/search_engines_private.h" |
| 12 #include "extensions/browser/extension_function.h" | 13 #include "extensions/browser/extension_function.h" |
| 13 | 14 |
| 14 namespace extensions { | 15 namespace extensions { |
| 15 | 16 |
| 16 // Implements the chrome.searchEnginesPrivate.getDefaultSearchEngines method. | 17 // Implements the chrome.searchEnginesPrivate.getDefaultSearchEngines method. |
| 17 class SearchEnginesPrivateGetDefaultSearchEnginesFunction | 18 class SearchEnginesPrivateGetDefaultSearchEnginesFunction |
| 18 : public UIThreadExtensionFunction { | 19 : public UIThreadExtensionFunction { |
| 19 public: | 20 public: |
| 20 SearchEnginesPrivateGetDefaultSearchEnginesFunction(); | 21 SearchEnginesPrivateGetDefaultSearchEnginesFunction(); |
| 21 DECLARE_EXTENSION_FUNCTION("searchEnginesPrivate.getDefaultSearchEngines", | 22 DECLARE_EXTENSION_FUNCTION("searchEnginesPrivate.getDefaultSearchEngines", |
| (...skipping 24 matching lines...) Expand all Loading... |
| 46 | 47 |
| 47 // AsyncExtensionFunction overrides. | 48 // AsyncExtensionFunction overrides. |
| 48 ResponseAction Run() override; | 49 ResponseAction Run() override; |
| 49 | 50 |
| 50 private: | 51 private: |
| 51 ChromeExtensionFunctionDetails chrome_details_; | 52 ChromeExtensionFunctionDetails chrome_details_; |
| 52 | 53 |
| 53 DISALLOW_COPY_AND_ASSIGN(SearchEnginesPrivateSetSelectedSearchEngineFunction); | 54 DISALLOW_COPY_AND_ASSIGN(SearchEnginesPrivateSetSelectedSearchEngineFunction); |
| 54 }; | 55 }; |
| 55 | 56 |
| 57 // Implements the chrome.searchEnginesPrivate.getOtherSearchEngines method. |
| 58 class SearchEnginesPrivateGetOtherSearchEnginesFunction |
| 59 : public UIThreadExtensionFunction { |
| 60 public: |
| 61 SearchEnginesPrivateGetOtherSearchEnginesFunction(); |
| 62 DECLARE_EXTENSION_FUNCTION("searchEnginesPrivate.getOtherSearchEngines", |
| 63 SEARCHENGINESPRIVATE_GETOTHERSEARCHENGINES); |
| 64 |
| 65 protected: |
| 66 ~SearchEnginesPrivateGetOtherSearchEnginesFunction() override; |
| 67 |
| 68 // ExtensionFunction overrides. |
| 69 ResponseAction Run() override; |
| 70 |
| 71 private: |
| 72 ChromeExtensionFunctionDetails chrome_details_; |
| 73 |
| 74 DISALLOW_COPY_AND_ASSIGN(SearchEnginesPrivateGetOtherSearchEnginesFunction); |
| 75 }; |
| 76 |
| 77 // Implements the chrome.searchEnginesPrivate.addOtherSearchEngine method. |
| 78 class SearchEnginesPrivateAddOtherSearchEngineFunction |
| 79 : public UIThreadExtensionFunction { |
| 80 public: |
| 81 SearchEnginesPrivateAddOtherSearchEngineFunction(); |
| 82 DECLARE_EXTENSION_FUNCTION("searchEnginesPrivate.addOtherSearchEngine", |
| 83 SEARCHENGINESPRIVATE_ADDOTHERSEARCHENGINE); |
| 84 |
| 85 protected: |
| 86 ~SearchEnginesPrivateAddOtherSearchEngineFunction() override; |
| 87 |
| 88 // ExtensionFunction overrides. |
| 89 ResponseAction Run() override; |
| 90 |
| 91 private: |
| 92 ChromeExtensionFunctionDetails chrome_details_; |
| 93 |
| 94 DISALLOW_COPY_AND_ASSIGN(SearchEnginesPrivateAddOtherSearchEngineFunction); |
| 95 }; |
| 96 |
| 97 // Implements the chrome.searchEnginesPrivate.updateSearchEngine method. |
| 98 class SearchEnginesPrivateUpdateSearchEngineFunction |
| 99 : public UIThreadExtensionFunction { |
| 100 public: |
| 101 SearchEnginesPrivateUpdateSearchEngineFunction(); |
| 102 DECLARE_EXTENSION_FUNCTION("searchEnginesPrivate.updateSearchEngine", |
| 103 SEARCHENGINESPRIVATE_UPDATESEARCHENGINE); |
| 104 |
| 105 protected: |
| 106 ~SearchEnginesPrivateUpdateSearchEngineFunction() override; |
| 107 |
| 108 // ExtensionFunction overrides. |
| 109 ResponseAction Run() override; |
| 110 |
| 111 private: |
| 112 ChromeExtensionFunctionDetails chrome_details_; |
| 113 |
| 114 DISALLOW_COPY_AND_ASSIGN(SearchEnginesPrivateUpdateSearchEngineFunction); |
| 115 }; |
| 116 |
| 117 // Implements the chrome.searchEnginesPrivate.removeSearchEngine method. |
| 118 class SearchEnginesPrivateRemoveSearchEngineFunction |
| 119 : public UIThreadExtensionFunction { |
| 120 public: |
| 121 SearchEnginesPrivateRemoveSearchEngineFunction(); |
| 122 DECLARE_EXTENSION_FUNCTION("searchEnginesPrivate.removeSearchEngine", |
| 123 SEARCHENGINESPRIVATE_REMOVESEARCHENGINE); |
| 124 |
| 125 protected: |
| 126 ~SearchEnginesPrivateRemoveSearchEngineFunction() override; |
| 127 |
| 128 // ExtensionFunction overrides. |
| 129 ResponseAction Run() override; |
| 130 |
| 131 private: |
| 132 ChromeExtensionFunctionDetails chrome_details_; |
| 133 |
| 134 DISALLOW_COPY_AND_ASSIGN(SearchEnginesPrivateRemoveSearchEngineFunction); |
| 135 }; |
| 136 |
| 137 // Implements the chrome.searchEnginesPrivate.getHotwordState method. |
| 138 class SearchEnginesPrivateGetHotwordStateFunction |
| 139 : public UIThreadExtensionFunction { |
| 140 public: |
| 141 SearchEnginesPrivateGetHotwordStateFunction(); |
| 142 DECLARE_EXTENSION_FUNCTION("searchEnginesPrivate.getHotwordState", |
| 143 SEARCHENGINESPRIVATE_GETHOTWORDSTATE); |
| 144 |
| 145 protected: |
| 146 ~SearchEnginesPrivateGetHotwordStateFunction() override; |
| 147 |
| 148 // ExtensionFunction overrides. |
| 149 ResponseAction Run() override; |
| 150 |
| 151 private: |
| 152 void OnAudioHistoryChecked( |
| 153 scoped_ptr<api::search_engines_private::HotwordState> state, |
| 154 const base::string16& audio_history_state, |
| 155 bool success, |
| 156 bool logging_enabled); |
| 157 |
| 158 ChromeExtensionFunctionDetails chrome_details_; |
| 159 |
| 160 // Used to get WeakPtr to self for use on the UI thread. |
| 161 base::WeakPtrFactory<SearchEnginesPrivateGetHotwordStateFunction> |
| 162 weak_ptr_factory_; |
| 163 |
| 164 DISALLOW_COPY_AND_ASSIGN(SearchEnginesPrivateGetHotwordStateFunction); |
| 165 }; |
| 166 |
| 167 // Implements the chrome.searchEnginesPrivate.optIntoHotwording method. |
| 168 class SearchEnginesPrivateOptIntoHotwordingFunction |
| 169 : public UIThreadExtensionFunction { |
| 170 public: |
| 171 SearchEnginesPrivateOptIntoHotwordingFunction(); |
| 172 DECLARE_EXTENSION_FUNCTION("searchEnginesPrivate.optIntoHotwording", |
| 173 SEARCHENGINESPRIVATE_OPTINTOHOTWORDING); |
| 174 |
| 175 protected: |
| 176 ~SearchEnginesPrivateOptIntoHotwordingFunction() override; |
| 177 |
| 178 // ExtensionFunction overrides. |
| 179 ResponseAction Run() override; |
| 180 |
| 181 private: |
| 182 ChromeExtensionFunctionDetails chrome_details_; |
| 183 |
| 184 DISALLOW_COPY_AND_ASSIGN(SearchEnginesPrivateOptIntoHotwordingFunction); |
| 185 }; |
| 186 |
| 56 } // namespace extensions | 187 } // namespace extensions |
| 57 | 188 |
| 58 #endif // CHROME_BROWSER_EXTENSIONS_API_SEARCH_ENGINES_PRIVATE_SEARCH_ENGINES_P
RIVATE_API_H_ | 189 #endif // CHROME_BROWSER_EXTENSIONS_API_SEARCH_ENGINES_PRIVATE_SEARCH_ENGINES_P
RIVATE_API_H_ |
| OLD | NEW |