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

Side by Side Diff: extensions/browser/api/networking_private/networking_private_chromeos.h

Issue 1283613005: Add networkingPrivate.getThirdPartyVpnProviderList (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@issue_515987_cr_network_list
Patch Set: Rebase Created 5 years, 4 months 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 EXTENSIONS_BROWSER_API_NETWORKING_PRIVATE_NETWORKING_PRIVATE_CHROMEOS_H_ 5 #ifndef EXTENSIONS_BROWSER_API_NETWORKING_PRIVATE_NETWORKING_PRIVATE_CHROMEOS_H_
6 #define EXTENSIONS_BROWSER_API_NETWORKING_PRIVATE_NETWORKING_PRIVATE_CHROMEOS_H_ 6 #define EXTENSIONS_BROWSER_API_NETWORKING_PRIVATE_NETWORKING_PRIVATE_CHROMEOS_H_
7 7
8 #include "base/memory/linked_ptr.h"
9 #include "base/memory/scoped_ptr.h"
8 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
11 #include "base/values.h"
9 #include "extensions/browser/api/networking_private/networking_private_delegate. h" 12 #include "extensions/browser/api/networking_private/networking_private_delegate. h"
10 13
11 namespace context { 14 namespace content {
12 class BrowserContext; 15 class BrowserContext;
13 } 16 }
14 17
15 namespace extensions { 18 namespace extensions {
16 19
17 // Chrome OS NetworkingPrivateDelegate implementation. 20 // Chrome OS NetworkingPrivateDelegate implementation.
18 21
19 class NetworkingPrivateChromeOS : public NetworkingPrivateDelegate { 22 class NetworkingPrivateChromeOS : public NetworkingPrivateDelegate {
20 public: 23 public:
21 // |verify_delegate| is passed to NetworkingPrivateDelegate and may be NULL. 24 // |verify_delegate| is passed to NetworkingPrivateDelegate and may be NULL.
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 bool require_pin, 83 bool require_pin,
81 const std::string& current_pin, 84 const std::string& current_pin,
82 const std::string& new_pin, 85 const std::string& new_pin,
83 const VoidCallback& success_callback, 86 const VoidCallback& success_callback,
84 const FailureCallback& failure_callback) override; 87 const FailureCallback& failure_callback) override;
85 scoped_ptr<base::ListValue> GetEnabledNetworkTypes() override; 88 scoped_ptr<base::ListValue> GetEnabledNetworkTypes() override;
86 scoped_ptr<DeviceStateList> GetDeviceStateList() override; 89 scoped_ptr<DeviceStateList> GetDeviceStateList() override;
87 bool EnableNetworkType(const std::string& type) override; 90 bool EnableNetworkType(const std::string& type) override;
88 bool DisableNetworkType(const std::string& type) override; 91 bool DisableNetworkType(const std::string& type) override;
89 bool RequestScan() override; 92 bool RequestScan() override;
93 scoped_ptr<base::ListValue> GetThirdPartyVpnProviderList() override;
90 94
91 private: 95 private:
96 // Callback for both GetProperties and GetManagedProperties. Copies
97 // |dictionary| and appends any networkingPrivate API specific properties,
98 // then calls |callback| with the result.
99 void GetPropertiesCallback(
100 const NetworkingPrivateDelegate::DictionaryCallback& callback,
101 const std::string& service_path,
102 const base::DictionaryValue& dictionary);
103
104 // Populate ThirdPartyVPN.Name with the provider name for third-party VPNs.
105 // The provider name needs to be looked up from the list of extensions which
106 // is not available to the chromeos/network module.
107 void AppendThirdPartyProviderName(base::DictionaryValue* dictionary);
108
109 // Handles connection failures, possibly showing UI for configuration
110 // failures, then calls the appropriate callback.
92 void ConnectFailureCallback(const std::string& guid, 111 void ConnectFailureCallback(const std::string& guid,
93 const VoidCallback& success_callback, 112 const VoidCallback& success_callback,
94 const FailureCallback& failure_callback, 113 const FailureCallback& failure_callback,
95 const std::string& error_name, 114 const std::string& error_name,
96 scoped_ptr<base::DictionaryValue> error_data); 115 scoped_ptr<base::DictionaryValue> error_data);
97 116
98 content::BrowserContext* browser_context_; 117 content::BrowserContext* browser_context_;
99 base::WeakPtrFactory<NetworkingPrivateChromeOS> weak_ptr_factory_; 118 base::WeakPtrFactory<NetworkingPrivateChromeOS> weak_ptr_factory_;
100 119
101 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateChromeOS); 120 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateChromeOS);
102 }; 121 };
103 122
104 } // namespace extensions 123 } // namespace extensions
105 124
106 #endif // EXTENSIONS_BROWSER_API_NETWORKING_PRIVATE_NETWORKING_PRIVATE_CHROMEOS _H_ 125 #endif // EXTENSIONS_BROWSER_API_NETWORKING_PRIVATE_NETWORKING_PRIVATE_CHROMEOS _H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698