| 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/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "chrome/browser/extensions/chrome_extension_function.h" | 9 #include "chrome/browser/extensions/chrome_extension_function.h" |
| 10 #include "chrome/browser/local_discovery/cloud_device_list_delegate.h" | 10 #include "chrome/browser/local_discovery/cloud_device_list_delegate.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 public: | 52 public: |
| 53 DECLARE_EXTENSION_FUNCTION("gcdPrivate.getCloudDeviceList", | 53 DECLARE_EXTENSION_FUNCTION("gcdPrivate.getCloudDeviceList", |
| 54 GCDPRIVATE_GETCLOUDDEVICELIST) | 54 GCDPRIVATE_GETCLOUDDEVICELIST) |
| 55 | 55 |
| 56 GcdPrivateGetCloudDeviceListFunction(); | 56 GcdPrivateGetCloudDeviceListFunction(); |
| 57 | 57 |
| 58 protected: | 58 protected: |
| 59 virtual ~GcdPrivateGetCloudDeviceListFunction(); | 59 virtual ~GcdPrivateGetCloudDeviceListFunction(); |
| 60 | 60 |
| 61 // AsyncExtensionFunction overrides. | 61 // AsyncExtensionFunction overrides. |
| 62 virtual bool RunAsync() OVERRIDE; | 62 virtual bool RunAsync() override; |
| 63 | 63 |
| 64 private: | 64 private: |
| 65 // CloudDeviceListDelegate implementation | 65 // CloudDeviceListDelegate implementation |
| 66 virtual void OnDeviceListReady(const DeviceList& devices) OVERRIDE; | 66 virtual void OnDeviceListReady(const DeviceList& devices) override; |
| 67 virtual void OnDeviceListUnavailable() OVERRIDE; | 67 virtual void OnDeviceListUnavailable() override; |
| 68 | 68 |
| 69 void CheckListingDone(); | 69 void CheckListingDone(); |
| 70 | 70 |
| 71 int requests_succeeded_; | 71 int requests_succeeded_; |
| 72 int requests_failed_; | 72 int requests_failed_; |
| 73 DeviceList devices_; | 73 DeviceList devices_; |
| 74 | 74 |
| 75 scoped_ptr<local_discovery::GCDApiFlow> printer_list_; | 75 scoped_ptr<local_discovery::GCDApiFlow> printer_list_; |
| 76 scoped_ptr<local_discovery::GCDApiFlow> device_list_; | 76 scoped_ptr<local_discovery::GCDApiFlow> device_list_; |
| 77 }; | 77 }; |
| 78 | 78 |
| 79 class GcdPrivateQueryForNewLocalDevicesFunction | 79 class GcdPrivateQueryForNewLocalDevicesFunction |
| 80 : public ChromeSyncExtensionFunction { | 80 : public ChromeSyncExtensionFunction { |
| 81 public: | 81 public: |
| 82 DECLARE_EXTENSION_FUNCTION("gcdPrivate.queryForNewLocalDevices", | 82 DECLARE_EXTENSION_FUNCTION("gcdPrivate.queryForNewLocalDevices", |
| 83 GCDPRIVATE_QUERYFORNEWLOCALDEVICES) | 83 GCDPRIVATE_QUERYFORNEWLOCALDEVICES) |
| 84 | 84 |
| 85 GcdPrivateQueryForNewLocalDevicesFunction(); | 85 GcdPrivateQueryForNewLocalDevicesFunction(); |
| 86 | 86 |
| 87 protected: | 87 protected: |
| 88 virtual ~GcdPrivateQueryForNewLocalDevicesFunction(); | 88 virtual ~GcdPrivateQueryForNewLocalDevicesFunction(); |
| 89 | 89 |
| 90 // SyncExtensionFunction overrides. | 90 // SyncExtensionFunction overrides. |
| 91 virtual bool RunSync() OVERRIDE; | 91 virtual bool RunSync() override; |
| 92 }; | 92 }; |
| 93 | 93 |
| 94 class GcdPrivatePrefetchWifiPasswordFunction | 94 class GcdPrivatePrefetchWifiPasswordFunction |
| 95 : public ChromeAsyncExtensionFunction { | 95 : public ChromeAsyncExtensionFunction { |
| 96 public: | 96 public: |
| 97 DECLARE_EXTENSION_FUNCTION("gcdPrivate.prefetchWifiPassword", | 97 DECLARE_EXTENSION_FUNCTION("gcdPrivate.prefetchWifiPassword", |
| 98 GCDPRIVATE_PREFETCHWIFIPASSWORD) | 98 GCDPRIVATE_PREFETCHWIFIPASSWORD) |
| 99 | 99 |
| 100 GcdPrivatePrefetchWifiPasswordFunction(); | 100 GcdPrivatePrefetchWifiPasswordFunction(); |
| 101 | 101 |
| 102 protected: | 102 protected: |
| 103 virtual ~GcdPrivatePrefetchWifiPasswordFunction(); | 103 virtual ~GcdPrivatePrefetchWifiPasswordFunction(); |
| 104 | 104 |
| 105 // AsyncExtensionFunction overrides. | 105 // AsyncExtensionFunction overrides. |
| 106 virtual bool RunAsync() OVERRIDE; | 106 virtual bool RunAsync() override; |
| 107 | 107 |
| 108 void OnResponse(bool response); | 108 void OnResponse(bool response); |
| 109 }; | 109 }; |
| 110 | 110 |
| 111 class GcdPrivateGetPrefetchedWifiNameListFunction | 111 class GcdPrivateGetPrefetchedWifiNameListFunction |
| 112 : public ChromeSyncExtensionFunction { | 112 : public ChromeSyncExtensionFunction { |
| 113 public: | 113 public: |
| 114 DECLARE_EXTENSION_FUNCTION("gcdPrivate.getPrefetchedWifiNameList", | 114 DECLARE_EXTENSION_FUNCTION("gcdPrivate.getPrefetchedWifiNameList", |
| 115 GCDPRIVATE_GETPREFETCHEDWIFINAMELIST); | 115 GCDPRIVATE_GETPREFETCHEDWIFINAMELIST); |
| 116 | 116 |
| 117 GcdPrivateGetPrefetchedWifiNameListFunction(); | 117 GcdPrivateGetPrefetchedWifiNameListFunction(); |
| 118 | 118 |
| 119 protected: | 119 protected: |
| 120 virtual ~GcdPrivateGetPrefetchedWifiNameListFunction(); | 120 virtual ~GcdPrivateGetPrefetchedWifiNameListFunction(); |
| 121 | 121 |
| 122 // SyncExtensionFunction overrides. | 122 // SyncExtensionFunction overrides. |
| 123 virtual bool RunSync() OVERRIDE; | 123 virtual bool RunSync() override; |
| 124 }; | 124 }; |
| 125 | 125 |
| 126 class GcdPrivateEstablishSessionFunction : public ChromeAsyncExtensionFunction { | 126 class GcdPrivateEstablishSessionFunction : public ChromeAsyncExtensionFunction { |
| 127 public: | 127 public: |
| 128 DECLARE_EXTENSION_FUNCTION("gcdPrivate.establishSession", | 128 DECLARE_EXTENSION_FUNCTION("gcdPrivate.establishSession", |
| 129 GCDPRIVATE_ESTABLISHSESSION) | 129 GCDPRIVATE_ESTABLISHSESSION) |
| 130 | 130 |
| 131 GcdPrivateEstablishSessionFunction(); | 131 GcdPrivateEstablishSessionFunction(); |
| 132 | 132 |
| 133 protected: | 133 protected: |
| 134 virtual ~GcdPrivateEstablishSessionFunction(); | 134 virtual ~GcdPrivateEstablishSessionFunction(); |
| 135 | 135 |
| 136 // AsyncExtensionFunction overrides. | 136 // AsyncExtensionFunction overrides. |
| 137 virtual bool RunAsync() OVERRIDE; | 137 virtual bool RunAsync() override; |
| 138 | 138 |
| 139 private: | 139 private: |
| 140 void OnConfirmCodeCallback( | 140 void OnConfirmCodeCallback( |
| 141 int session_id, | 141 int session_id, |
| 142 api::gcd_private::Status status, | 142 api::gcd_private::Status status, |
| 143 const std::string& confirm_code, | 143 const std::string& confirm_code, |
| 144 api::gcd_private::ConfirmationType confirmation_type); | 144 api::gcd_private::ConfirmationType confirmation_type); |
| 145 }; | 145 }; |
| 146 | 146 |
| 147 class GcdPrivateConfirmCodeFunction : public ChromeAsyncExtensionFunction { | 147 class GcdPrivateConfirmCodeFunction : public ChromeAsyncExtensionFunction { |
| 148 public: | 148 public: |
| 149 DECLARE_EXTENSION_FUNCTION("gcdPrivate.confirmCode", GCDPRIVATE_CONFIRMCODE) | 149 DECLARE_EXTENSION_FUNCTION("gcdPrivate.confirmCode", GCDPRIVATE_CONFIRMCODE) |
| 150 | 150 |
| 151 GcdPrivateConfirmCodeFunction(); | 151 GcdPrivateConfirmCodeFunction(); |
| 152 | 152 |
| 153 protected: | 153 protected: |
| 154 virtual ~GcdPrivateConfirmCodeFunction(); | 154 virtual ~GcdPrivateConfirmCodeFunction(); |
| 155 | 155 |
| 156 // AsyncExtensionFunction overrides. | 156 // AsyncExtensionFunction overrides. |
| 157 virtual bool RunAsync() OVERRIDE; | 157 virtual bool RunAsync() override; |
| 158 | 158 |
| 159 private: | 159 private: |
| 160 void OnSessionEstablishedCallback(api::gcd_private::Status status); | 160 void OnSessionEstablishedCallback(api::gcd_private::Status status); |
| 161 }; | 161 }; |
| 162 | 162 |
| 163 class GcdPrivateSendMessageFunction : public ChromeAsyncExtensionFunction { | 163 class GcdPrivateSendMessageFunction : public ChromeAsyncExtensionFunction { |
| 164 public: | 164 public: |
| 165 DECLARE_EXTENSION_FUNCTION("gcdPrivate.sendMessage", GCDPRIVATE_SENDMESSAGE) | 165 DECLARE_EXTENSION_FUNCTION("gcdPrivate.sendMessage", GCDPRIVATE_SENDMESSAGE) |
| 166 | 166 |
| 167 GcdPrivateSendMessageFunction(); | 167 GcdPrivateSendMessageFunction(); |
| 168 | 168 |
| 169 protected: | 169 protected: |
| 170 virtual ~GcdPrivateSendMessageFunction(); | 170 virtual ~GcdPrivateSendMessageFunction(); |
| 171 | 171 |
| 172 // AsyncExtensionFunction overrides. | 172 // AsyncExtensionFunction overrides. |
| 173 virtual bool RunAsync() OVERRIDE; | 173 virtual bool RunAsync() override; |
| 174 | 174 |
| 175 private: | 175 private: |
| 176 void OnMessageSentCallback(api::gcd_private::Status status, | 176 void OnMessageSentCallback(api::gcd_private::Status status, |
| 177 const base::DictionaryValue& value); | 177 const base::DictionaryValue& value); |
| 178 }; | 178 }; |
| 179 | 179 |
| 180 class GcdPrivateTerminateSessionFunction : public ChromeAsyncExtensionFunction { | 180 class GcdPrivateTerminateSessionFunction : public ChromeAsyncExtensionFunction { |
| 181 public: | 181 public: |
| 182 DECLARE_EXTENSION_FUNCTION("gcdPrivate.terminateSession", | 182 DECLARE_EXTENSION_FUNCTION("gcdPrivate.terminateSession", |
| 183 GCDPRIVATE_TERMINATESESSION) | 183 GCDPRIVATE_TERMINATESESSION) |
| 184 | 184 |
| 185 GcdPrivateTerminateSessionFunction(); | 185 GcdPrivateTerminateSessionFunction(); |
| 186 | 186 |
| 187 protected: | 187 protected: |
| 188 virtual ~GcdPrivateTerminateSessionFunction(); | 188 virtual ~GcdPrivateTerminateSessionFunction(); |
| 189 | 189 |
| 190 // AsyncExtensionFunction overrides. | 190 // AsyncExtensionFunction overrides. |
| 191 virtual bool RunAsync() OVERRIDE; | 191 virtual bool RunAsync() override; |
| 192 }; | 192 }; |
| 193 | 193 |
| 194 class GcdPrivateGetCommandDefinitionsFunction | 194 class GcdPrivateGetCommandDefinitionsFunction |
| 195 : public ChromeAsyncExtensionFunction { | 195 : public ChromeAsyncExtensionFunction { |
| 196 public: | 196 public: |
| 197 DECLARE_EXTENSION_FUNCTION("gcdPrivate.getCommandDefinitions", | 197 DECLARE_EXTENSION_FUNCTION("gcdPrivate.getCommandDefinitions", |
| 198 GCDPRIVATE_GETCOMMANDDEFINITIONS) | 198 GCDPRIVATE_GETCOMMANDDEFINITIONS) |
| 199 | 199 |
| 200 GcdPrivateGetCommandDefinitionsFunction(); | 200 GcdPrivateGetCommandDefinitionsFunction(); |
| 201 | 201 |
| 202 protected: | 202 protected: |
| 203 virtual ~GcdPrivateGetCommandDefinitionsFunction(); | 203 virtual ~GcdPrivateGetCommandDefinitionsFunction(); |
| 204 | 204 |
| 205 // AsyncExtensionFunction overrides. | 205 // AsyncExtensionFunction overrides. |
| 206 virtual bool RunAsync() OVERRIDE; | 206 virtual bool RunAsync() override; |
| 207 | 207 |
| 208 private: | 208 private: |
| 209 }; | 209 }; |
| 210 | 210 |
| 211 class GcdPrivateInsertCommandFunction : public ChromeAsyncExtensionFunction { | 211 class GcdPrivateInsertCommandFunction : public ChromeAsyncExtensionFunction { |
| 212 public: | 212 public: |
| 213 DECLARE_EXTENSION_FUNCTION("gcdPrivate.insertCommand", | 213 DECLARE_EXTENSION_FUNCTION("gcdPrivate.insertCommand", |
| 214 GCDPRIVATE_INSERTCOMMAND) | 214 GCDPRIVATE_INSERTCOMMAND) |
| 215 | 215 |
| 216 GcdPrivateInsertCommandFunction(); | 216 GcdPrivateInsertCommandFunction(); |
| 217 | 217 |
| 218 protected: | 218 protected: |
| 219 virtual ~GcdPrivateInsertCommandFunction(); | 219 virtual ~GcdPrivateInsertCommandFunction(); |
| 220 | 220 |
| 221 // AsyncExtensionFunction overrides. | 221 // AsyncExtensionFunction overrides. |
| 222 virtual bool RunAsync() OVERRIDE; | 222 virtual bool RunAsync() override; |
| 223 | 223 |
| 224 private: | 224 private: |
| 225 }; | 225 }; |
| 226 | 226 |
| 227 class GcdPrivateGetCommandFunction : public ChromeAsyncExtensionFunction { | 227 class GcdPrivateGetCommandFunction : public ChromeAsyncExtensionFunction { |
| 228 public: | 228 public: |
| 229 DECLARE_EXTENSION_FUNCTION("gcdPrivate.getCommand", GCDPRIVATE_GETCOMMAND) | 229 DECLARE_EXTENSION_FUNCTION("gcdPrivate.getCommand", GCDPRIVATE_GETCOMMAND) |
| 230 | 230 |
| 231 GcdPrivateGetCommandFunction(); | 231 GcdPrivateGetCommandFunction(); |
| 232 | 232 |
| 233 protected: | 233 protected: |
| 234 virtual ~GcdPrivateGetCommandFunction(); | 234 virtual ~GcdPrivateGetCommandFunction(); |
| 235 | 235 |
| 236 // AsyncExtensionFunction overrides. | 236 // AsyncExtensionFunction overrides. |
| 237 virtual bool RunAsync() OVERRIDE; | 237 virtual bool RunAsync() override; |
| 238 | 238 |
| 239 private: | 239 private: |
| 240 }; | 240 }; |
| 241 | 241 |
| 242 class GcdPrivateCancelCommandFunction : public ChromeAsyncExtensionFunction { | 242 class GcdPrivateCancelCommandFunction : public ChromeAsyncExtensionFunction { |
| 243 public: | 243 public: |
| 244 DECLARE_EXTENSION_FUNCTION("gcdPrivate.cancelCommand", | 244 DECLARE_EXTENSION_FUNCTION("gcdPrivate.cancelCommand", |
| 245 GCDPRIVATE_CANCELCOMMAND) | 245 GCDPRIVATE_CANCELCOMMAND) |
| 246 | 246 |
| 247 GcdPrivateCancelCommandFunction(); | 247 GcdPrivateCancelCommandFunction(); |
| 248 | 248 |
| 249 protected: | 249 protected: |
| 250 virtual ~GcdPrivateCancelCommandFunction(); | 250 virtual ~GcdPrivateCancelCommandFunction(); |
| 251 | 251 |
| 252 // AsyncExtensionFunction overrides. | 252 // AsyncExtensionFunction overrides. |
| 253 virtual bool RunAsync() OVERRIDE; | 253 virtual bool RunAsync() override; |
| 254 | 254 |
| 255 private: | 255 private: |
| 256 }; | 256 }; |
| 257 | 257 |
| 258 class GcdPrivateGetCommandsListFunction : public ChromeAsyncExtensionFunction { | 258 class GcdPrivateGetCommandsListFunction : public ChromeAsyncExtensionFunction { |
| 259 public: | 259 public: |
| 260 DECLARE_EXTENSION_FUNCTION("gcdPrivate.getCommandsList", | 260 DECLARE_EXTENSION_FUNCTION("gcdPrivate.getCommandsList", |
| 261 GCDPRIVATE_GETCOMMANDSLIST) | 261 GCDPRIVATE_GETCOMMANDSLIST) |
| 262 | 262 |
| 263 GcdPrivateGetCommandsListFunction(); | 263 GcdPrivateGetCommandsListFunction(); |
| 264 | 264 |
| 265 protected: | 265 protected: |
| 266 virtual ~GcdPrivateGetCommandsListFunction(); | 266 virtual ~GcdPrivateGetCommandsListFunction(); |
| 267 | 267 |
| 268 // AsyncExtensionFunction overrides. | 268 // AsyncExtensionFunction overrides. |
| 269 virtual bool RunAsync() OVERRIDE; | 269 virtual bool RunAsync() override; |
| 270 | 270 |
| 271 private: | 271 private: |
| 272 }; | 272 }; |
| 273 | 273 |
| 274 } // namespace extensions | 274 } // namespace extensions |
| 275 | 275 |
| 276 #endif // CHROME_BROWSER_EXTENSIONS_API_GCD_PRIVATE_GCD_PRIVATE_API_H_ | 276 #endif // CHROME_BROWSER_EXTENSIONS_API_GCD_PRIVATE_GCD_PRIVATE_API_H_ |
| OLD | NEW |