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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 void SendMessage(int session_id, | 70 void SendMessage(int session_id, |
71 const std::string& api, | 71 const std::string& api, |
72 const base::DictionaryValue& input, | 72 const base::DictionaryValue& input, |
73 MessageResponseCallback callback); | 73 MessageResponseCallback callback); |
74 | 74 |
75 void RemoveSession(int session_id); | 75 void RemoveSession(int session_id); |
76 | 76 |
77 void RequestWifiPassword(const std::string& ssid, | 77 void RequestWifiPassword(const std::string& ssid, |
78 const SuccessCallback& callback); | 78 const SuccessCallback& callback); |
79 | 79 |
| 80 scoped_ptr<base::ListValue> GetPrefetchedSSIDList(); |
| 81 |
80 private: | 82 private: |
81 friend class BrowserContextKeyedAPIFactory<GcdPrivateAPI>; | 83 friend class BrowserContextKeyedAPIFactory<GcdPrivateAPI>; |
82 | 84 |
83 typedef std::map<std::string /* id_string */, | 85 typedef std::map<std::string /* id_string */, |
84 linked_ptr<api::gcd_private::GCDDevice> > GCDDeviceMap; | 86 linked_ptr<api::gcd_private::GCDDevice> > GCDDeviceMap; |
85 | 87 |
86 typedef std::map<int /* session id*/, linked_ptr<GcdPrivateSessionHolder> > | 88 typedef std::map<int /* session id*/, linked_ptr<GcdPrivateSessionHolder> > |
87 GCDSessionMap; | 89 GCDSessionMap; |
88 | 90 |
89 typedef std::map<std::string /* ssid */, std::string /* password */> | 91 typedef std::map<std::string /* ssid */, std::string /* password */> |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 | 191 |
190 protected: | 192 protected: |
191 virtual ~GcdPrivatePrefetchWifiPasswordFunction(); | 193 virtual ~GcdPrivatePrefetchWifiPasswordFunction(); |
192 | 194 |
193 // AsyncExtensionFunction overrides. | 195 // AsyncExtensionFunction overrides. |
194 virtual bool RunAsync() OVERRIDE; | 196 virtual bool RunAsync() OVERRIDE; |
195 | 197 |
196 void OnResponse(bool response); | 198 void OnResponse(bool response); |
197 }; | 199 }; |
198 | 200 |
| 201 class GcdPrivateGetPrefetchedWifiNameListFunction |
| 202 : public ChromeSyncExtensionFunction { |
| 203 public: |
| 204 DECLARE_EXTENSION_FUNCTION("gcdPrivate.getPrefetchedWifiNameList", |
| 205 GCDPRIVATE_GETPREFETCHEDWIFINAMELIST); |
| 206 |
| 207 GcdPrivateGetPrefetchedWifiNameListFunction(); |
| 208 |
| 209 protected: |
| 210 virtual ~GcdPrivateGetPrefetchedWifiNameListFunction(); |
| 211 |
| 212 // SyncExtensionFunction overrides. |
| 213 virtual bool RunSync() OVERRIDE; |
| 214 }; |
| 215 |
199 class GcdPrivateEstablishSessionFunction : public ChromeAsyncExtensionFunction { | 216 class GcdPrivateEstablishSessionFunction : public ChromeAsyncExtensionFunction { |
200 public: | 217 public: |
201 DECLARE_EXTENSION_FUNCTION("gcdPrivate.establishSession", | 218 DECLARE_EXTENSION_FUNCTION("gcdPrivate.establishSession", |
202 GCDPRIVATE_ESTABLISHSESSION) | 219 GCDPRIVATE_ESTABLISHSESSION) |
203 | 220 |
204 GcdPrivateEstablishSessionFunction(); | 221 GcdPrivateEstablishSessionFunction(); |
205 | 222 |
206 protected: | 223 protected: |
207 virtual ~GcdPrivateEstablishSessionFunction(); | 224 virtual ~GcdPrivateEstablishSessionFunction(); |
208 | 225 |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 | 357 |
341 // AsyncExtensionFunction overrides. | 358 // AsyncExtensionFunction overrides. |
342 virtual bool RunAsync() OVERRIDE; | 359 virtual bool RunAsync() OVERRIDE; |
343 | 360 |
344 private: | 361 private: |
345 }; | 362 }; |
346 | 363 |
347 } // namespace extensions | 364 } // namespace extensions |
348 | 365 |
349 #endif // CHROME_BROWSER_EXTENSIONS_API_GCD_PRIVATE_GCD_PRIVATE_API_H_ | 366 #endif // CHROME_BROWSER_EXTENSIONS_API_GCD_PRIVATE_GCD_PRIVATE_API_H_ |
OLD | NEW |