OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_CONFIG_NETWORKING_CONFIG_SERVICE_H_ | 5 #ifndef EXTENSIONS_BROWSER_API_NETWORKING_CONFIG_NETWORKING_CONFIG_SERVICE_H_ |
6 #define EXTENSIONS_BROWSER_API_NETWORKING_CONFIG_NETWORKING_CONFIG_SERVICE_H_ | 6 #define EXTENSIONS_BROWSER_API_NETWORKING_CONFIG_NETWORKING_CONFIG_SERVICE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 const Extension* extension, | 63 const Extension* extension, |
64 UnloadedExtensionInfo::Reason reason) override; | 64 UnloadedExtensionInfo::Reason reason) override; |
65 | 65 |
66 // Returns the extension id registered for |hex_ssid|. If no extension is | 66 // Returns the extension id registered for |hex_ssid|. If no extension is |
67 // registered for this |hex_ssid|, the function returns an empty string. | 67 // registered for this |hex_ssid|, the function returns an empty string. |
68 // |hex_ssid|: SSID in hex encoding. | 68 // |hex_ssid|: SSID in hex encoding. |
69 std::string LookupExtensionIdForHexSsid(std::string hex_ssid) const; | 69 std::string LookupExtensionIdForHexSsid(std::string hex_ssid) const; |
70 | 70 |
71 // Returns true if the extension with id |extension_id| registered for | 71 // Returns true if the extension with id |extension_id| registered for |
72 // |onCaptivePortalDetected| events, otherwise false. | 72 // |onCaptivePortalDetected| events, otherwise false. |
73 bool IsRegisteredForCaptivePortalEvent(std::string extension_id) const; | 73 bool IsRegisteredForCaptivePortalEvent(const std::string& extension_id) const; |
74 | 74 |
75 // Registers |hex_ssid| as being handled by the extension with extension ID | 75 // Registers |hex_ssid| as being handled by the extension with extension ID |
76 // |extension_id|. Returns true on success and false if another extension | 76 // |extension_id|. Returns true on success and false if another extension |
77 // already registered for |hex_ssid|. | 77 // already registered for |hex_ssid|. |
78 // |hex_ssid|: SSID in hex encoding of the network to be registered. | 78 // |hex_ssid|: SSID in hex encoding of the network to be registered. |
79 // |extension_id|: Extension ID of the extension handling the network | 79 // |extension_id|: Extension ID of the extension handling the network |
80 // configuration for this network. | 80 // configuration for this network. |
81 bool RegisterHexSsid(std::string hex_ssid, const std::string& extension_id); | 81 bool RegisterHexSsid(std::string hex_ssid, const std::string& extension_id); |
82 | 82 |
83 // Unregisters extension with the ID |extension_id| removing all associated | 83 // Unregisters extension with the ID |extension_id| removing all associated |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 | 139 |
140 // This map associates a given hex encoded SSID to an extension entry. | 140 // This map associates a given hex encoded SSID to an extension entry. |
141 std::map<std::string, std::string> hex_ssid_to_extension_id_; | 141 std::map<std::string, std::string> hex_ssid_to_extension_id_; |
142 | 142 |
143 base::WeakPtrFactory<NetworkingConfigService> weak_factory_; | 143 base::WeakPtrFactory<NetworkingConfigService> weak_factory_; |
144 }; | 144 }; |
145 | 145 |
146 } // namespace extensions | 146 } // namespace extensions |
147 | 147 |
148 #endif // EXTENSIONS_BROWSER_API_NETWORKING_CONFIG_NETWORKING_CONFIG_SERVICE_H_ | 148 #endif // EXTENSIONS_BROWSER_API_NETWORKING_CONFIG_NETWORKING_CONFIG_SERVICE_H_ |
OLD | NEW |