Roll src/third_party/WebKit d9c6159:8139f33 (svn 201974:201975)
[chromium-blink-merge.git] / extensions / browser / api / networking_private / networking_private_chromeos.h
blobdd511f9fd4ef53f11ee428bc8c930e45fec9c08a
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
3 // found in the LICENSE file.
5 #ifndef EXTENSIONS_BROWSER_API_NETWORKING_PRIVATE_NETWORKING_PRIVATE_CHROMEOS_H_
6 #define EXTENSIONS_BROWSER_API_NETWORKING_PRIVATE_NETWORKING_PRIVATE_CHROMEOS_H_
8 #include "base/memory/weak_ptr.h"
9 #include "extensions/browser/api/networking_private/networking_private_delegate.h"
11 namespace context {
12 class BrowserContext;
15 namespace extensions {
17 // Chrome OS NetworkingPrivateDelegate implementation.
19 class NetworkingPrivateChromeOS : public NetworkingPrivateDelegate {
20 public:
21 // |verify_delegate| is passed to NetworkingPrivateDelegate and may be NULL.
22 NetworkingPrivateChromeOS(content::BrowserContext* browser_context,
23 scoped_ptr<VerifyDelegate> verify_delegate);
24 ~NetworkingPrivateChromeOS() override;
26 // NetworkingPrivateApi
27 void GetProperties(const std::string& guid,
28 const DictionaryCallback& success_callback,
29 const FailureCallback& failure_callback) override;
30 void GetManagedProperties(const std::string& guid,
31 const DictionaryCallback& success_callback,
32 const FailureCallback& failure_callback) override;
33 void GetState(const std::string& guid,
34 const DictionaryCallback& success_callback,
35 const FailureCallback& failure_callback) override;
36 void SetProperties(const std::string& guid,
37 scoped_ptr<base::DictionaryValue> properties,
38 const VoidCallback& success_callback,
39 const FailureCallback& failure_callback) override;
40 void CreateNetwork(bool shared,
41 scoped_ptr<base::DictionaryValue> properties,
42 const StringCallback& success_callback,
43 const FailureCallback& failure_callback) override;
44 void ForgetNetwork(const std::string& guid,
45 const VoidCallback& success_callback,
46 const FailureCallback& failure_callback) override;
47 void GetNetworks(const std::string& network_type,
48 bool configured_only,
49 bool visible_only,
50 int limit,
51 const NetworkListCallback& success_callback,
52 const FailureCallback& failure_callback) override;
53 void StartConnect(const std::string& guid,
54 const VoidCallback& success_callback,
55 const FailureCallback& failure_callback) override;
56 void StartDisconnect(const std::string& guid,
57 const VoidCallback& success_callback,
58 const FailureCallback& failure_callback) override;
59 void StartActivate(const std::string& guid,
60 const std::string& carrier,
61 const VoidCallback& success_callback,
62 const FailureCallback& failure_callback) override;
63 void SetWifiTDLSEnabledState(
64 const std::string& ip_or_mac_address,
65 bool enabled,
66 const StringCallback& success_callback,
67 const FailureCallback& failure_callback) override;
68 void GetWifiTDLSStatus(const std::string& ip_or_mac_address,
69 const StringCallback& success_callback,
70 const FailureCallback& failure_callback) override;
71 void GetCaptivePortalStatus(const std::string& guid,
72 const StringCallback& success_callback,
73 const FailureCallback& failure_callback) override;
74 void UnlockCellularSim(const std::string& guid,
75 const std::string& pin,
76 const std::string& puk,
77 const VoidCallback& success_callback,
78 const FailureCallback& failure_callback) override;
79 void SetCellularSimState(const std::string& guid,
80 bool require_pin,
81 const std::string& current_pin,
82 const std::string& new_pin,
83 const VoidCallback& success_callback,
84 const FailureCallback& failure_callback) override;
85 scoped_ptr<base::ListValue> GetEnabledNetworkTypes() override;
86 scoped_ptr<DeviceStateList> GetDeviceStateList() override;
87 bool EnableNetworkType(const std::string& type) override;
88 bool DisableNetworkType(const std::string& type) override;
89 bool RequestScan() override;
91 private:
92 void ConnectFailureCallback(const std::string& guid,
93 const VoidCallback& success_callback,
94 const FailureCallback& failure_callback,
95 const std::string& error_name,
96 scoped_ptr<base::DictionaryValue> error_data);
98 content::BrowserContext* browser_context_;
99 base::WeakPtrFactory<NetworkingPrivateChromeOS> weak_ptr_factory_;
101 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateChromeOS);
104 } // namespace extensions
106 #endif // EXTENSIONS_BROWSER_API_NETWORKING_PRIVATE_NETWORKING_PRIVATE_CHROMEOS_H_