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

Side by Side Diff: chrome/browser/extensions/api/search_engines_private/search_engines_private_api.h

Issue 1109563003: Implement remaining chrome.searchEnginesPrivate methods. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address last comment sync fix trybot failure Created 5 years, 7 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
« no previous file with comments | « no previous file | chrome/browser/extensions/api/search_engines_private/search_engines_private_api.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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.getSearchEngines method.
17 class SearchEnginesPrivateGetDefaultSearchEnginesFunction 18 class SearchEnginesPrivateGetSearchEnginesFunction
18 : public UIThreadExtensionFunction { 19 : public UIThreadExtensionFunction {
19 public: 20 public:
20 SearchEnginesPrivateGetDefaultSearchEnginesFunction(); 21 SearchEnginesPrivateGetSearchEnginesFunction();
21 DECLARE_EXTENSION_FUNCTION("searchEnginesPrivate.getDefaultSearchEngines", 22 DECLARE_EXTENSION_FUNCTION("searchEnginesPrivate.getSearchEngines",
22 SEARCHENGINESPRIVATE_GETDEFAULTSEARCHENGINES); 23 SEARCHENGINESPRIVATE_GETSEARCHENGINES);
23 24
24 protected: 25 protected:
25 ~SearchEnginesPrivateGetDefaultSearchEnginesFunction() override; 26 ~SearchEnginesPrivateGetSearchEnginesFunction() override;
26 27
27 // ExtensionFunction overrides. 28 // ExtensionFunction overrides.
28 ResponseAction Run() override; 29 ResponseAction Run() override;
29 30
30 private: 31 private:
31 ChromeExtensionFunctionDetails chrome_details_; 32 ChromeExtensionFunctionDetails chrome_details_;
32 33
33 DISALLOW_COPY_AND_ASSIGN(SearchEnginesPrivateGetDefaultSearchEnginesFunction); 34 DISALLOW_COPY_AND_ASSIGN(SearchEnginesPrivateGetSearchEnginesFunction);
34 }; 35 };
35 36
36 // Implements the chrome.searchEnginesPrivate.setSelectedSearchEngine method. 37 // Implements the chrome.searchEnginesPrivate.setSelectedSearchEngine method.
37 class SearchEnginesPrivateSetSelectedSearchEngineFunction 38 class SearchEnginesPrivateSetSelectedSearchEngineFunction
38 : public UIThreadExtensionFunction { 39 : public UIThreadExtensionFunction {
39 public: 40 public:
40 SearchEnginesPrivateSetSelectedSearchEngineFunction(); 41 SearchEnginesPrivateSetSelectedSearchEngineFunction();
41 DECLARE_EXTENSION_FUNCTION("searchEnginesPrivate.setSelectedSearchEngine", 42 DECLARE_EXTENSION_FUNCTION("searchEnginesPrivate.setSelectedSearchEngine",
42 SEARCHENGINESPRIVATE_SETSELECTEDSEARCHENGINE); 43 SEARCHENGINESPRIVATE_SETSELECTEDSEARCHENGINE);
43 44
44 protected: 45 protected:
45 ~SearchEnginesPrivateSetSelectedSearchEngineFunction() override; 46 ~SearchEnginesPrivateSetSelectedSearchEngineFunction() override;
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.addOtherSearchEngine method.
58 class SearchEnginesPrivateAddOtherSearchEngineFunction
59 : public UIThreadExtensionFunction {
60 public:
61 SearchEnginesPrivateAddOtherSearchEngineFunction();
62 DECLARE_EXTENSION_FUNCTION("searchEnginesPrivate.addOtherSearchEngine",
63 SEARCHENGINESPRIVATE_ADDOTHERSEARCHENGINE);
64
65 protected:
66 ~SearchEnginesPrivateAddOtherSearchEngineFunction() override;
67
68 // ExtensionFunction overrides.
69 ResponseAction Run() override;
70
71 private:
72 ChromeExtensionFunctionDetails chrome_details_;
73
74 DISALLOW_COPY_AND_ASSIGN(SearchEnginesPrivateAddOtherSearchEngineFunction);
75 };
76
77 // Implements the chrome.searchEnginesPrivate.updateSearchEngine method.
78 class SearchEnginesPrivateUpdateSearchEngineFunction
79 : public UIThreadExtensionFunction {
80 public:
81 SearchEnginesPrivateUpdateSearchEngineFunction();
82 DECLARE_EXTENSION_FUNCTION("searchEnginesPrivate.updateSearchEngine",
83 SEARCHENGINESPRIVATE_UPDATESEARCHENGINE);
84
85 protected:
86 ~SearchEnginesPrivateUpdateSearchEngineFunction() override;
87
88 // ExtensionFunction overrides.
89 ResponseAction Run() override;
90
91 private:
92 ChromeExtensionFunctionDetails chrome_details_;
93
94 DISALLOW_COPY_AND_ASSIGN(SearchEnginesPrivateUpdateSearchEngineFunction);
95 };
96
97 // Implements the chrome.searchEnginesPrivate.removeSearchEngine method.
98 class SearchEnginesPrivateRemoveSearchEngineFunction
99 : public UIThreadExtensionFunction {
100 public:
101 SearchEnginesPrivateRemoveSearchEngineFunction();
102 DECLARE_EXTENSION_FUNCTION("searchEnginesPrivate.removeSearchEngine",
103 SEARCHENGINESPRIVATE_REMOVESEARCHENGINE);
104
105 protected:
106 ~SearchEnginesPrivateRemoveSearchEngineFunction() override;
107
108 // ExtensionFunction overrides.
109 ResponseAction Run() override;
110
111 private:
112 ChromeExtensionFunctionDetails chrome_details_;
113
114 DISALLOW_COPY_AND_ASSIGN(SearchEnginesPrivateRemoveSearchEngineFunction);
115 };
116
117 // Implements the chrome.searchEnginesPrivate.getHotwordState method.
118 class SearchEnginesPrivateGetHotwordStateFunction
119 : public UIThreadExtensionFunction {
120 public:
121 SearchEnginesPrivateGetHotwordStateFunction();
122 DECLARE_EXTENSION_FUNCTION("searchEnginesPrivate.getHotwordState",
123 SEARCHENGINESPRIVATE_GETHOTWORDSTATE);
124
125 protected:
126 ~SearchEnginesPrivateGetHotwordStateFunction() override;
127
128 // ExtensionFunction overrides.
129 ResponseAction Run() override;
130
131 private:
132 void OnAudioHistoryChecked(
133 scoped_ptr<api::search_engines_private::HotwordState> state,
134 const base::string16& audio_history_state,
135 bool success,
136 bool logging_enabled);
137
138 ChromeExtensionFunctionDetails chrome_details_;
139
140 // Used to get WeakPtr to self for use on the UI thread.
141 base::WeakPtrFactory<SearchEnginesPrivateGetHotwordStateFunction>
142 weak_ptr_factory_;
143
144 DISALLOW_COPY_AND_ASSIGN(SearchEnginesPrivateGetHotwordStateFunction);
145 };
146
147 // Implements the chrome.searchEnginesPrivate.optIntoHotwording method.
148 class SearchEnginesPrivateOptIntoHotwordingFunction
149 : public UIThreadExtensionFunction {
150 public:
151 SearchEnginesPrivateOptIntoHotwordingFunction();
152 DECLARE_EXTENSION_FUNCTION("searchEnginesPrivate.optIntoHotwording",
153 SEARCHENGINESPRIVATE_OPTINTOHOTWORDING);
154
155 protected:
156 ~SearchEnginesPrivateOptIntoHotwordingFunction() override;
157
158 // ExtensionFunction overrides.
159 ResponseAction Run() override;
160
161 private:
162 ChromeExtensionFunctionDetails chrome_details_;
163
164 DISALLOW_COPY_AND_ASSIGN(SearchEnginesPrivateOptIntoHotwordingFunction);
165 };
166
56 } // namespace extensions 167 } // namespace extensions
57 168
58 #endif // CHROME_BROWSER_EXTENSIONS_API_SEARCH_ENGINES_PRIVATE_SEARCH_ENGINES_P RIVATE_API_H_ 169 #endif // CHROME_BROWSER_EXTENSIONS_API_SEARCH_ENGINES_PRIVATE_SEARCH_ENGINES_P RIVATE_API_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/api/search_engines_private/search_engines_private_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698