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

Side by Side Diff: chrome/browser/extensions/api/gcd_private/gcd_private_api.h

Issue 695253002: chrome.gcdPrivate allows app to choose pairing method. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Mon Nov 3 17:47:42 PST 2014 Created 6 years, 1 month 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
OLDNEW
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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 130
131 GcdPrivateEstablishSessionFunction(); 131 GcdPrivateEstablishSessionFunction();
132 132
133 protected: 133 protected:
134 ~GcdPrivateEstablishSessionFunction() override; 134 ~GcdPrivateEstablishSessionFunction() override;
135 135
136 // AsyncExtensionFunction overrides. 136 // AsyncExtensionFunction overrides.
137 bool RunAsync() override; 137 bool RunAsync() override;
138 138
139 private: 139 private:
140 void OnConfirmCodeCallback( 140 void OnSessionInitialized(
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::vector<api::gcd_private::PairingType>& pairing_types);
144 api::gcd_private::ConfirmationType confirmation_type); 144 };
145
146 class GcdPrivateStartPairingFunction : public ChromeAsyncExtensionFunction {
147 public:
148 DECLARE_EXTENSION_FUNCTION("gcdPrivate.startPairing", GCDPRIVATE_STARTPAIRING)
149
150 GcdPrivateStartPairingFunction();
151
152 protected:
153 ~GcdPrivateStartPairingFunction() override;
154
155 // AsyncExtensionFunction overrides.
156 bool RunAsync() override;
157
158 private:
159 void OnPairingStarted(api::gcd_private::Status status);
145 }; 160 };
146 161
147 class GcdPrivateConfirmCodeFunction : public ChromeAsyncExtensionFunction { 162 class GcdPrivateConfirmCodeFunction : public ChromeAsyncExtensionFunction {
148 public: 163 public:
149 DECLARE_EXTENSION_FUNCTION("gcdPrivate.confirmCode", GCDPRIVATE_CONFIRMCODE) 164 DECLARE_EXTENSION_FUNCTION("gcdPrivate.confirmCode", GCDPRIVATE_CONFIRMCODE)
150 165
151 GcdPrivateConfirmCodeFunction(); 166 GcdPrivateConfirmCodeFunction();
152 167
153 protected: 168 protected:
154 ~GcdPrivateConfirmCodeFunction() override; 169 ~GcdPrivateConfirmCodeFunction() override;
155 170
156 // AsyncExtensionFunction overrides. 171 // AsyncExtensionFunction overrides.
157 bool RunAsync() override; 172 bool RunAsync() override;
158 173
159 private: 174 private:
160 void OnSessionEstablishedCallback(api::gcd_private::Status status); 175 void OnCodeConfirmed(api::gcd_private::Status status);
161 }; 176 };
162 177
163 class GcdPrivateSendMessageFunction : public ChromeAsyncExtensionFunction { 178 class GcdPrivateSendMessageFunction : public ChromeAsyncExtensionFunction {
164 public: 179 public:
165 DECLARE_EXTENSION_FUNCTION("gcdPrivate.sendMessage", GCDPRIVATE_SENDMESSAGE) 180 DECLARE_EXTENSION_FUNCTION("gcdPrivate.sendMessage", GCDPRIVATE_SENDMESSAGE)
166 181
167 GcdPrivateSendMessageFunction(); 182 GcdPrivateSendMessageFunction();
168 183
169 protected: 184 protected:
170 ~GcdPrivateSendMessageFunction() override; 185 ~GcdPrivateSendMessageFunction() override;
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 282
268 // AsyncExtensionFunction overrides. 283 // AsyncExtensionFunction overrides.
269 bool RunAsync() override; 284 bool RunAsync() override;
270 285
271 private: 286 private:
272 }; 287 };
273 288
274 } // namespace extensions 289 } // namespace extensions
275 290
276 #endif // CHROME_BROWSER_EXTENSIONS_API_GCD_PRIVATE_GCD_PRIVATE_API_H_ 291 #endif // CHROME_BROWSER_EXTENSIONS_API_GCD_PRIVATE_GCD_PRIVATE_API_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698