| 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_GCD_PRIVATE_GCD_PRIVATE_API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_GCD_PRIVATE_GCD_PRIVATE_API_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_GCD_PRIVATE_GCD_PRIVATE_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_GCD_PRIVATE_GCD_PRIVATE_API_H_ |
| 7 | 7 |
| 8 #include "base/memory/linked_ptr.h" | 8 #include "base/memory/linked_ptr.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "chrome/browser/extensions/chrome_extension_function.h" | 10 #include "chrome/browser/extensions/chrome_extension_function.h" |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 | 91 |
| 92 int requests_succeeded_; | 92 int requests_succeeded_; |
| 93 int requests_failed_; | 93 int requests_failed_; |
| 94 DeviceList devices_; | 94 DeviceList devices_; |
| 95 | 95 |
| 96 scoped_ptr<local_discovery::GCDApiFlow> printer_list_; | 96 scoped_ptr<local_discovery::GCDApiFlow> printer_list_; |
| 97 scoped_ptr<local_discovery::GCDApiFlow> device_list_; | 97 scoped_ptr<local_discovery::GCDApiFlow> device_list_; |
| 98 }; | 98 }; |
| 99 | 99 |
| 100 class GcdPrivateQueryForNewLocalDevicesFunction | 100 class GcdPrivateQueryForNewLocalDevicesFunction |
| 101 : public ChromeAsyncExtensionFunction { | 101 : public ChromeSyncExtensionFunction { |
| 102 public: | 102 public: |
| 103 DECLARE_EXTENSION_FUNCTION("gcdPrivate.queryForNewLocalDevices", | 103 DECLARE_EXTENSION_FUNCTION("gcdPrivate.queryForNewLocalDevices", |
| 104 GCDPRIVATE_QUERYFORNEWLOCALDEVICES) | 104 GCDPRIVATE_QUERYFORNEWLOCALDEVICES) |
| 105 | 105 |
| 106 GcdPrivateQueryForNewLocalDevicesFunction(); | 106 GcdPrivateQueryForNewLocalDevicesFunction(); |
| 107 | 107 |
| 108 protected: | 108 protected: |
| 109 virtual ~GcdPrivateQueryForNewLocalDevicesFunction(); | 109 virtual ~GcdPrivateQueryForNewLocalDevicesFunction(); |
| 110 | 110 |
| 111 // AsyncExtensionFunction overrides. | 111 // SyncExtensionFunction overrides. |
| 112 virtual bool RunAsync() OVERRIDE; | 112 virtual bool RunSync() OVERRIDE; |
| 113 }; | 113 }; |
| 114 | 114 |
| 115 class GcdPrivateStartSetupFunction : public ChromeAsyncExtensionFunction { | 115 class GcdPrivateStartSetupFunction : public ChromeAsyncExtensionFunction { |
| 116 public: | 116 public: |
| 117 public: | 117 public: |
| 118 DECLARE_EXTENSION_FUNCTION("gcdPrivate.startSetup", GCDPRIVATE_STARTSETUP) | 118 DECLARE_EXTENSION_FUNCTION("gcdPrivate.startSetup", GCDPRIVATE_STARTSETUP) |
| 119 | 119 |
| 120 GcdPrivateStartSetupFunction(); | 120 GcdPrivateStartSetupFunction(); |
| 121 | 121 |
| 122 protected: | 122 protected: |
| 123 virtual ~GcdPrivateStartSetupFunction(); | 123 virtual ~GcdPrivateStartSetupFunction(); |
| 124 | 124 |
| 125 // AsyncExtensionFunction overrides. | 125 // AsyncExtensionFunction overrides. |
| 126 virtual bool RunAsync() OVERRIDE; | 126 virtual bool RunAsync() OVERRIDE; |
| 127 | 127 |
| 128 private: | 128 private: |
| 129 }; | 129 }; |
| 130 | 130 |
| 131 class GcdPrivateSetWiFiNetworksFunction : public ChromeAsyncExtensionFunction { | 131 class GcdPrivateSetWiFiNetworkFunction : public ChromeAsyncExtensionFunction { |
| 132 public: | 132 public: |
| 133 DECLARE_EXTENSION_FUNCTION("gcdPrivate.setWiFiNetworks", | 133 DECLARE_EXTENSION_FUNCTION("gcdPrivate.setWiFiNetwork", |
| 134 GCDPRIVATE_SETWIFINETWORKS) | 134 GCDPRIVATE_SETWIFINETWORK) |
| 135 | 135 |
| 136 GcdPrivateSetWiFiNetworksFunction(); | 136 GcdPrivateSetWiFiNetworkFunction(); |
| 137 | 137 |
| 138 protected: | 138 protected: |
| 139 virtual ~GcdPrivateSetWiFiNetworksFunction(); | 139 virtual ~GcdPrivateSetWiFiNetworkFunction(); |
| 140 | 140 |
| 141 // AsyncExtensionFunction overrides. | 141 // AsyncExtensionFunction overrides. |
| 142 virtual bool RunAsync() OVERRIDE; | 142 virtual bool RunAsync() OVERRIDE; |
| 143 | 143 |
| 144 private: | 144 private: |
| 145 }; | 145 }; |
| 146 | 146 |
| 147 class GcdPrivateSetWiFiCredentialsFunction | 147 class GcdPrivateSetWiFiPasswordFunction : public ChromeAsyncExtensionFunction { |
| 148 : public ChromeAsyncExtensionFunction { | |
| 149 public: | 148 public: |
| 150 DECLARE_EXTENSION_FUNCTION("gcdPrivate.setWiFiCredentials", | 149 DECLARE_EXTENSION_FUNCTION("gcdPrivate.setWiFiPassword", |
| 151 GCDPRIVATE_SETWIFICREDENTIALS) | 150 GCDPRIVATE_SETWIFIPASSWORD) |
| 152 | 151 |
| 153 GcdPrivateSetWiFiCredentialsFunction(); | 152 GcdPrivateSetWiFiPasswordFunction(); |
| 154 | 153 |
| 155 protected: | 154 protected: |
| 156 virtual ~GcdPrivateSetWiFiCredentialsFunction(); | 155 virtual ~GcdPrivateSetWiFiPasswordFunction(); |
| 157 | 156 |
| 158 // AsyncExtensionFunction overrides. | 157 // AsyncExtensionFunction overrides. |
| 159 virtual bool RunAsync() OVERRIDE; | 158 virtual bool RunAsync() OVERRIDE; |
| 160 | 159 |
| 161 private: | 160 private: |
| 162 }; | 161 }; |
| 163 | 162 |
| 164 class GcdPrivateConfirmCodeFunction : public ChromeAsyncExtensionFunction { | 163 class GcdPrivateConfirmCodeFunction : public ChromeAsyncExtensionFunction { |
| 165 public: | 164 public: |
| 166 DECLARE_EXTENSION_FUNCTION("gcdPrivate.confirmCode", GCDPRIVATE_CONFIRMCODE) | 165 DECLARE_EXTENSION_FUNCTION("gcdPrivate.confirmCode", GCDPRIVATE_CONFIRMCODE) |
| (...skipping 17 matching lines...) Expand all Loading... |
| 184 | 183 |
| 185 protected: | 184 protected: |
| 186 virtual ~GcdPrivateStopSetupFunction(); | 185 virtual ~GcdPrivateStopSetupFunction(); |
| 187 | 186 |
| 188 // AsyncExtensionFunction overrides. | 187 // AsyncExtensionFunction overrides. |
| 189 virtual bool RunAsync() OVERRIDE; | 188 virtual bool RunAsync() OVERRIDE; |
| 190 | 189 |
| 191 private: | 190 private: |
| 192 }; | 191 }; |
| 193 | 192 |
| 193 class GcdPrivateGetCommandDefinitionsFunction |
| 194 : public ChromeAsyncExtensionFunction { |
| 195 public: |
| 196 DECLARE_EXTENSION_FUNCTION("gcdPrivate.getCommandDefinitions", |
| 197 GCDPRIVATE_GETCOMMANDDEFINITIONS) |
| 198 |
| 199 GcdPrivateGetCommandDefinitionsFunction(); |
| 200 |
| 201 protected: |
| 202 virtual ~GcdPrivateGetCommandDefinitionsFunction(); |
| 203 |
| 204 // AsyncExtensionFunction overrides. |
| 205 virtual bool RunAsync() OVERRIDE; |
| 206 |
| 207 private: |
| 208 }; |
| 209 |
| 210 class GcdPrivateInsertCommandFunction : public ChromeAsyncExtensionFunction { |
| 211 public: |
| 212 DECLARE_EXTENSION_FUNCTION("gcdPrivate.insertCommand", |
| 213 GCDPRIVATE_INSERTCOMMAND) |
| 214 |
| 215 GcdPrivateInsertCommandFunction(); |
| 216 |
| 217 protected: |
| 218 virtual ~GcdPrivateInsertCommandFunction(); |
| 219 |
| 220 // AsyncExtensionFunction overrides. |
| 221 virtual bool RunAsync() OVERRIDE; |
| 222 |
| 223 private: |
| 224 }; |
| 225 |
| 226 class GcdPrivateGetCommandFunction : public ChromeAsyncExtensionFunction { |
| 227 public: |
| 228 DECLARE_EXTENSION_FUNCTION("gcdPrivate.getCommand", GCDPRIVATE_GETCOMMAND) |
| 229 |
| 230 GcdPrivateGetCommandFunction(); |
| 231 |
| 232 protected: |
| 233 virtual ~GcdPrivateGetCommandFunction(); |
| 234 |
| 235 // AsyncExtensionFunction overrides. |
| 236 virtual bool RunAsync() OVERRIDE; |
| 237 |
| 238 private: |
| 239 }; |
| 240 |
| 241 class GcdPrivateCancelCommandFunction : public ChromeAsyncExtensionFunction { |
| 242 public: |
| 243 DECLARE_EXTENSION_FUNCTION("gcdPrivate.cancelCommand", |
| 244 GCDPRIVATE_CANCELCOMMAND) |
| 245 |
| 246 GcdPrivateCancelCommandFunction(); |
| 247 |
| 248 protected: |
| 249 virtual ~GcdPrivateCancelCommandFunction(); |
| 250 |
| 251 // AsyncExtensionFunction overrides. |
| 252 virtual bool RunAsync() OVERRIDE; |
| 253 |
| 254 private: |
| 255 }; |
| 256 |
| 257 class GcdPrivateGetCommandsListFunction : public ChromeAsyncExtensionFunction { |
| 258 public: |
| 259 DECLARE_EXTENSION_FUNCTION("gcdPrivate.getCommandsList", |
| 260 GCDPRIVATE_GETCOMMANDSLIST) |
| 261 |
| 262 GcdPrivateGetCommandsListFunction(); |
| 263 |
| 264 protected: |
| 265 virtual ~GcdPrivateGetCommandsListFunction(); |
| 266 |
| 267 // AsyncExtensionFunction overrides. |
| 268 virtual bool RunAsync() OVERRIDE; |
| 269 |
| 270 private: |
| 271 }; |
| 272 |
| 194 } // namespace extensions | 273 } // namespace extensions |
| 195 | 274 |
| 196 #endif // CHROME_BROWSER_EXTENSIONS_API_GCD_PRIVATE_GCD_PRIVATE_API_H_ | 275 #endif // CHROME_BROWSER_EXTENSIONS_API_GCD_PRIVATE_GCD_PRIVATE_API_H_ |
| OLD | NEW |