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

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

Issue 2471723002: chromeos: networkingPrivate: Set active proxy values (Closed)
Patch Set: Fix test expectations Created 4 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
« no previous file with comments | « extensions/browser/api/networking_private/networking_private_chromeos.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "extensions/browser/api/networking_private/networking_private_chromeos. h" 5 #include "extensions/browser/api/networking_private/networking_private_chromeos. h"
6 6
7 #include <memory>
8
7 #include "base/bind.h" 9 #include "base/bind.h"
8 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
9 #include "base/callback.h" 11 #include "base/callback.h"
10 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "base/memory/ptr_util.h"
11 #include "base/values.h" 14 #include "base/values.h"
12 #include "chromeos/dbus/dbus_thread_manager.h" 15 #include "chromeos/dbus/dbus_thread_manager.h"
13 #include "chromeos/dbus/shill_manager_client.h" 16 #include "chromeos/dbus/shill_manager_client.h"
14 #include "chromeos/login/login_state.h" 17 #include "chromeos/login/login_state.h"
15 #include "chromeos/network/device_state.h" 18 #include "chromeos/network/device_state.h"
16 #include "chromeos/network/managed_network_configuration_handler.h" 19 #include "chromeos/network/managed_network_configuration_handler.h"
17 #include "chromeos/network/network_activation_handler.h" 20 #include "chromeos/network/network_activation_handler.h"
18 #include "chromeos/network/network_connection_handler.h" 21 #include "chromeos/network/network_connection_handler.h"
19 #include "chromeos/network/network_device_handler.h" 22 #include "chromeos/network/network_device_handler.h"
20 #include "chromeos/network/network_event_log.h" 23 #include "chromeos/network/network_event_log.h"
21 #include "chromeos/network/network_state.h" 24 #include "chromeos/network/network_state.h"
22 #include "chromeos/network/network_state_handler.h" 25 #include "chromeos/network/network_state_handler.h"
23 #include "chromeos/network/network_util.h" 26 #include "chromeos/network/network_util.h"
24 #include "chromeos/network/onc/onc_signature.h" 27 #include "chromeos/network/onc/onc_signature.h"
25 #include "chromeos/network/onc/onc_translator.h" 28 #include "chromeos/network/onc/onc_translator.h"
26 #include "chromeos/network/onc/onc_utils.h" 29 #include "chromeos/network/onc/onc_utils.h"
27 #include "chromeos/network/portal_detector/network_portal_detector.h" 30 #include "chromeos/network/portal_detector/network_portal_detector.h"
31 #include "chromeos/network/proxy/ui_proxy_config.h"
32 #include "chromeos/network/proxy/ui_proxy_config_service.h"
28 #include "components/onc/onc_constants.h" 33 #include "components/onc/onc_constants.h"
34 #include "components/proxy_config/proxy_prefs.h"
29 #include "content/public/browser/browser_context.h" 35 #include "content/public/browser/browser_context.h"
30 #include "extensions/browser/api/networking_private/networking_private_api.h" 36 #include "extensions/browser/api/networking_private/networking_private_api.h"
31 #include "extensions/browser/extension_registry.h" 37 #include "extensions/browser/extension_registry.h"
32 #include "extensions/browser/extensions_browser_client.h" 38 #include "extensions/browser/extensions_browser_client.h"
33 #include "extensions/common/extension.h" 39 #include "extensions/common/extension.h"
34 #include "extensions/common/extension_set.h" 40 #include "extensions/common/extension_set.h"
35 #include "extensions/common/permissions/api_permission.h" 41 #include "extensions/common/permissions/api_permission.h"
36 #include "extensions/common/permissions/permissions_data.h" 42 #include "extensions/common/permissions/permissions_data.h"
37 #include "third_party/cros_system_api/dbus/service_constants.h" 43 #include "third_party/cros_system_api/dbus/service_constants.h"
38 44
39 using chromeos::NetworkHandler; 45 using chromeos::NetworkHandler;
40 using chromeos::NetworkStateHandler; 46 using chromeos::NetworkStateHandler;
41 using chromeos::NetworkTypePattern; 47 using chromeos::NetworkTypePattern;
42 using chromeos::ShillManagerClient; 48 using chromeos::ShillManagerClient;
49 using chromeos::UIProxyConfig;
43 using extensions::NetworkingPrivateDelegate; 50 using extensions::NetworkingPrivateDelegate;
44 51
45 namespace private_api = extensions::api::networking_private; 52 namespace private_api = extensions::api::networking_private;
46 53
47 namespace { 54 namespace {
48 55
49 chromeos::NetworkStateHandler* GetStateHandler() { 56 chromeos::NetworkStateHandler* GetStateHandler() {
50 return NetworkHandler::Get()->network_state_handler(); 57 return NetworkHandler::Get()->network_state_handler();
51 } 58 }
52 59
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 device_state = 214 device_state =
208 GetStateHandler()->GetDeviceState(network_state->device_path()); 215 GetStateHandler()->GetDeviceState(network_state->device_path());
209 } 216 }
210 if (!device_state) { 217 if (!device_state) {
211 device_state = 218 device_state =
212 GetStateHandler()->GetDeviceStateByType(NetworkTypePattern::Cellular()); 219 GetStateHandler()->GetDeviceStateByType(NetworkTypePattern::Cellular());
213 } 220 }
214 return device_state; 221 return device_state;
215 } 222 }
216 223
224 // Ensures that |container| has a DictionaryValue for |key| and returns it.
225 base::DictionaryValue* EnsureDictionaryValue(const std::string& key,
226 base::DictionaryValue* container) {
227 base::DictionaryValue* dict;
228 if (!container->GetDictionary(key, &dict)) {
229 container->SetWithoutPathExpansion(
230 key, base::MakeUnique<base::DictionaryValue>());
231 container->GetDictionary(key, &dict);
232 }
233 return dict;
234 }
235
236 // Sets the active and effective ONC dictionary values of |dict| based on
237 // |state|. Also sets the UserEditable property to false.
238 void SetProxyEffectiveValue(base::DictionaryValue* dict,
239 ProxyPrefs::ConfigState state,
240 std::unique_ptr<base::Value> value) {
241 // NOTE: ProxyPrefs::ConfigState only exposes 'CONFIG_POLICY' so just use
242 // 'UserPolicy' here for the effective type. The existing UI does not
243 // differentiate between policy types. TODO(stevenjb): Eliminate UIProxyConfig
244 // and instead generate a proper ONC dictionary with the correct policy source
245 // preserved. crbug.com/662529.
246 dict->SetStringWithoutPathExpansion(::onc::kAugmentationEffectiveSetting,
247 state == ProxyPrefs::CONFIG_EXTENSION
248 ? ::onc::kAugmentationActiveExtension
249 : ::onc::kAugmentationUserPolicy);
250 if (state != ProxyPrefs::CONFIG_EXTENSION) {
251 std::unique_ptr<base::Value> value_copy(value->CreateDeepCopy());
252 dict->SetWithoutPathExpansion(::onc::kAugmentationUserPolicy,
253 std::move(value_copy));
254 }
255 dict->SetWithoutPathExpansion(::onc::kAugmentationActiveSetting,
256 std::move(value));
257 dict->SetBooleanWithoutPathExpansion(::onc::kAugmentationUserEditable, false);
258 }
259
260 std::string GetProxySettingsType(const UIProxyConfig::Mode& mode) {
261 switch (mode) {
262 case UIProxyConfig::MODE_DIRECT:
263 return ::onc::proxy::kDirect;
264 case UIProxyConfig::MODE_AUTO_DETECT:
265 return ::onc::proxy::kWPAD;
266 case UIProxyConfig::MODE_PAC_SCRIPT:
267 return ::onc::proxy::kPAC;
268 case UIProxyConfig::MODE_SINGLE_PROXY:
269 case UIProxyConfig::MODE_PROXY_PER_SCHEME:
270 return ::onc::proxy::kManual;
271 }
272 NOTREACHED();
273 return ::onc::proxy::kDirect;
274 }
275
276 void SetManualProxy(base::DictionaryValue* manual,
277 ProxyPrefs::ConfigState state,
278 const std::string& key,
279 const UIProxyConfig::ManualProxy& proxy) {
280 base::DictionaryValue* dict = EnsureDictionaryValue(key, manual);
281 base::DictionaryValue* host_dict =
282 EnsureDictionaryValue(::onc::proxy::kHost, dict);
283 SetProxyEffectiveValue(host_dict, state,
284 base::MakeUnique<base::StringValue>(
285 proxy.server.host_port_pair().host()));
286 uint16_t port = proxy.server.host_port_pair().port();
287 base::DictionaryValue* port_dict =
288 EnsureDictionaryValue(::onc::proxy::kPort, dict);
289 SetProxyEffectiveValue(port_dict, state,
290 base::MakeUnique<base::FundamentalValue>(port));
291 }
292
217 } // namespace 293 } // namespace
218 294
219 //////////////////////////////////////////////////////////////////////////////// 295 ////////////////////////////////////////////////////////////////////////////////
220 296
221 namespace extensions { 297 namespace extensions {
222 298
223 NetworkingPrivateChromeOS::NetworkingPrivateChromeOS( 299 NetworkingPrivateChromeOS::NetworkingPrivateChromeOS(
224 content::BrowserContext* browser_context, 300 content::BrowserContext* browser_context,
225 std::unique_ptr<VerifyDelegate> verify_delegate) 301 std::unique_ptr<VerifyDelegate> verify_delegate)
226 : NetworkingPrivateDelegate(std::move(verify_delegate)), 302 : NetworkingPrivateDelegate(std::move(verify_delegate)),
227 browser_context_(browser_context), 303 browser_context_(browser_context),
228 weak_ptr_factory_(this) {} 304 weak_ptr_factory_(this) {}
229 305
230 NetworkingPrivateChromeOS::~NetworkingPrivateChromeOS() { 306 NetworkingPrivateChromeOS::~NetworkingPrivateChromeOS() {}
231 }
232 307
233 void NetworkingPrivateChromeOS::GetProperties( 308 void NetworkingPrivateChromeOS::GetProperties(
234 const std::string& guid, 309 const std::string& guid,
235 const DictionaryCallback& success_callback, 310 const DictionaryCallback& success_callback,
236 const FailureCallback& failure_callback) { 311 const FailureCallback& failure_callback) {
237 std::string service_path, error; 312 std::string service_path, error;
238 if (!GetServicePathFromGuid(guid, &service_path, &error)) { 313 if (!GetServicePathFromGuid(guid, &service_path, &error)) {
239 failure_callback.Run(error); 314 failure_callback.Run(error);
240 return; 315 return;
241 } 316 }
242 317
243 std::string user_id_hash; 318 std::string user_id_hash;
244 if (!GetPrimaryUserIdHash(browser_context_, &user_id_hash, &error)) { 319 if (!GetPrimaryUserIdHash(browser_context_, &user_id_hash, &error)) {
245 failure_callback.Run(error); 320 failure_callback.Run(error);
246 return; 321 return;
247 } 322 }
248 323
249 GetManagedConfigurationHandler()->GetProperties( 324 GetManagedConfigurationHandler()->GetProperties(
250 user_id_hash, service_path, 325 user_id_hash, service_path,
251 base::Bind(&NetworkingPrivateChromeOS::GetPropertiesCallback, 326 base::Bind(&NetworkingPrivateChromeOS::GetPropertiesCallback,
252 weak_ptr_factory_.GetWeakPtr(), success_callback), 327 weak_ptr_factory_.GetWeakPtr(), guid, false /* managed */,
328 success_callback),
253 base::Bind(&NetworkHandlerFailureCallback, failure_callback)); 329 base::Bind(&NetworkHandlerFailureCallback, failure_callback));
254 } 330 }
255 331
256 void NetworkingPrivateChromeOS::GetManagedProperties( 332 void NetworkingPrivateChromeOS::GetManagedProperties(
257 const std::string& guid, 333 const std::string& guid,
258 const DictionaryCallback& success_callback, 334 const DictionaryCallback& success_callback,
259 const FailureCallback& failure_callback) { 335 const FailureCallback& failure_callback) {
260 std::string service_path, error; 336 std::string service_path, error;
261 if (!GetServicePathFromGuid(guid, &service_path, &error)) { 337 if (!GetServicePathFromGuid(guid, &service_path, &error)) {
262 failure_callback.Run(error); 338 failure_callback.Run(error);
263 return; 339 return;
264 } 340 }
265 341
266 std::string user_id_hash; 342 std::string user_id_hash;
267 if (!GetPrimaryUserIdHash(browser_context_, &user_id_hash, &error)) { 343 if (!GetPrimaryUserIdHash(browser_context_, &user_id_hash, &error)) {
268 failure_callback.Run(error); 344 failure_callback.Run(error);
269 return; 345 return;
270 } 346 }
271 347
272 GetManagedConfigurationHandler()->GetManagedProperties( 348 GetManagedConfigurationHandler()->GetManagedProperties(
273 user_id_hash, service_path, 349 user_id_hash, service_path,
274 base::Bind(&NetworkingPrivateChromeOS::GetPropertiesCallback, 350 base::Bind(&NetworkingPrivateChromeOS::GetPropertiesCallback,
275 weak_ptr_factory_.GetWeakPtr(), success_callback), 351 weak_ptr_factory_.GetWeakPtr(), guid, true /* managed */,
352 success_callback),
276 base::Bind(&NetworkHandlerFailureCallback, failure_callback)); 353 base::Bind(&NetworkHandlerFailureCallback, failure_callback));
277 } 354 }
278 355
279 void NetworkingPrivateChromeOS::GetState( 356 void NetworkingPrivateChromeOS::GetState(
280 const std::string& guid, 357 const std::string& guid,
281 const DictionaryCallback& success_callback, 358 const DictionaryCallback& success_callback,
282 const FailureCallback& failure_callback) { 359 const FailureCallback& failure_callback) {
283 std::string service_path, error; 360 std::string service_path, error;
284 if (!GetServicePathFromGuid(guid, &service_path, &error)) { 361 if (!GetServicePathFromGuid(guid, &service_path, &error)) {
285 failure_callback.Run(error); 362 failure_callback.Run(error);
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
576 653
577 std::unique_ptr<DeviceStateList> device_state_list(new DeviceStateList); 654 std::unique_ptr<DeviceStateList> device_state_list(new DeviceStateList);
578 for (const chromeos::DeviceState* device : devices) { 655 for (const chromeos::DeviceState* device : devices) {
579 std::string onc_type = 656 std::string onc_type =
580 chromeos::network_util::TranslateShillTypeToONC(device->type()); 657 chromeos::network_util::TranslateShillTypeToONC(device->type());
581 AppendDeviceState(onc_type, device, device_state_list.get()); 658 AppendDeviceState(onc_type, device, device_state_list.get());
582 technologies_found.insert(onc_type); 659 technologies_found.insert(onc_type);
583 } 660 }
584 661
585 // For any technologies that we do not have a DeviceState entry for, append 662 // For any technologies that we do not have a DeviceState entry for, append
586 // an entry if the technolog is available. 663 // an entry if the technology is available.
587 const char* technology_types[] = {::onc::network_type::kEthernet, 664 const char* technology_types[] = {
588 ::onc::network_type::kWiFi, 665 ::onc::network_type::kEthernet, ::onc::network_type::kWiFi,
589 ::onc::network_type::kWimax, 666 ::onc::network_type::kWimax, ::onc::network_type::kCellular};
590 ::onc::network_type::kCellular};
591 for (const char* technology : technology_types) { 667 for (const char* technology : technology_types) {
592 if (base::ContainsValue(technologies_found, technology)) 668 if (base::ContainsValue(technologies_found, technology))
593 continue; 669 continue;
594 AppendDeviceState(technology, nullptr /* device */, 670 AppendDeviceState(technology, nullptr /* device */,
595 device_state_list.get()); 671 device_state_list.get());
596 } 672 }
597 return device_state_list; 673 return device_state_list;
598 } 674 }
599 675
600 bool NetworkingPrivateChromeOS::EnableNetworkType(const std::string& type) { 676 bool NetworkingPrivateChromeOS::EnableNetworkType(const std::string& type) {
(...skipping 17 matching lines...) Expand all
618 } 694 }
619 695
620 bool NetworkingPrivateChromeOS::RequestScan() { 696 bool NetworkingPrivateChromeOS::RequestScan() {
621 GetStateHandler()->RequestScan(); 697 GetStateHandler()->RequestScan();
622 return true; 698 return true;
623 } 699 }
624 700
625 // Private methods 701 // Private methods
626 702
627 void NetworkingPrivateChromeOS::GetPropertiesCallback( 703 void NetworkingPrivateChromeOS::GetPropertiesCallback(
704 const std::string& guid,
705 bool managed,
628 const DictionaryCallback& callback, 706 const DictionaryCallback& callback,
629 const std::string& service_path, 707 const std::string& service_path,
630 const base::DictionaryValue& dictionary) { 708 const base::DictionaryValue& dictionary) {
631 std::unique_ptr<base::DictionaryValue> dictionary_copy(dictionary.DeepCopy()); 709 std::unique_ptr<base::DictionaryValue> dictionary_copy(dictionary.DeepCopy());
632 AppendThirdPartyProviderName(dictionary_copy.get()); 710 AppendThirdPartyProviderName(dictionary_copy.get());
711 if (managed)
712 SetManagedActiveProxyValues(guid, dictionary_copy.get());
633 callback.Run(std::move(dictionary_copy)); 713 callback.Run(std::move(dictionary_copy));
634 } 714 }
635 715
636 // Populate ThirdPartyVPN.kProviderName for third-party VPNs.
637 void NetworkingPrivateChromeOS::AppendThirdPartyProviderName( 716 void NetworkingPrivateChromeOS::AppendThirdPartyProviderName(
638 base::DictionaryValue* dictionary) { 717 base::DictionaryValue* dictionary) {
639 base::DictionaryValue* third_party_vpn = 718 base::DictionaryValue* third_party_vpn =
640 GetThirdPartyVPNDictionary(dictionary); 719 GetThirdPartyVPNDictionary(dictionary);
641 if (!third_party_vpn) 720 if (!third_party_vpn)
642 return; 721 return;
643 722
644 const std::string extension_id = GetStringFromDictionary( 723 const std::string extension_id = GetStringFromDictionary(
645 *third_party_vpn, ::onc::third_party_vpn::kExtensionID); 724 *third_party_vpn, ::onc::third_party_vpn::kExtensionID);
646 const ExtensionSet& extensions = 725 const ExtensionSet& extensions =
647 ExtensionRegistry::Get(browser_context_)->enabled_extensions(); 726 ExtensionRegistry::Get(browser_context_)->enabled_extensions();
648 for (const auto& extension : extensions) { 727 for (const auto& extension : extensions) {
649 if (extension->permissions_data()->HasAPIPermission( 728 if (extension->permissions_data()->HasAPIPermission(
650 APIPermission::kVpnProvider) && 729 APIPermission::kVpnProvider) &&
651 extension->id() == extension_id) { 730 extension->id() == extension_id) {
652 third_party_vpn->SetStringWithoutPathExpansion( 731 third_party_vpn->SetStringWithoutPathExpansion(
653 ::onc::third_party_vpn::kProviderName, extension->name()); 732 ::onc::third_party_vpn::kProviderName, extension->name());
654 break; 733 break;
655 } 734 }
656 } 735 }
657 } 736 }
658 737
738 void NetworkingPrivateChromeOS::SetManagedActiveProxyValues(
739 const std::string& guid,
740 base::DictionaryValue* dictionary) {
741 // NOTE: We use UIProxyConfigService and UIProxyConfig for historical
742 // reasons. The model and service were written for a much older UI but
743 // contain a fair amount of subtle logic which is why we use them.
744 // TODO(stevenjb): Re-factor this code and eliminate UIProxyConfig once
745 // the old options UI is abandoned. crbug.com/662529.
746 chromeos::UIProxyConfigService* ui_proxy_config_service =
747 NetworkHandler::Get()->ui_proxy_config_service();
748 ui_proxy_config_service->UpdateFromPrefs(guid);
749 UIProxyConfig config;
750 ui_proxy_config_service->GetProxyConfig(guid, &config);
751 ProxyPrefs::ConfigState state = config.state;
752
753 VLOG(1) << "CONFIG STATE FOR: " << guid << ": " << state
754 << " MODE: " << config.mode;
755
756 if (state != ProxyPrefs::CONFIG_POLICY &&
757 state != ProxyPrefs::CONFIG_EXTENSION &&
758 state != ProxyPrefs::CONFIG_OTHER_PRECEDE) {
759 return;
760 }
761
762 // Ensure that the ProxySettings dictionary exists.
763 base::DictionaryValue* proxy_settings =
764 EnsureDictionaryValue(::onc::network_config::kProxySettings, dictionary);
765 VLOG(2) << " PROXY: " << *proxy_settings;
766
767 // Ensure that the ProxySettings.Type dictionary exists and set the Type
768 // value to the value from |ui_proxy_config_service|.
769 base::DictionaryValue* proxy_type_dict =
770 EnsureDictionaryValue(::onc::network_config::kType, proxy_settings);
771 SetProxyEffectiveValue(proxy_type_dict, state,
772 base::WrapUnique<base::Value>(new base::StringValue(
773 GetProxySettingsType(config.mode))));
774
775 // Update any appropriate sub dictionary based on the new type.
776 switch (config.mode) {
777 case UIProxyConfig::MODE_SINGLE_PROXY: {
778 // Use the same proxy value (config.single_proxy) for all proxies.
779 base::DictionaryValue* manual =
780 EnsureDictionaryValue(::onc::proxy::kManual, proxy_settings);
781 SetManualProxy(manual, state, ::onc::proxy::kHttp, config.single_proxy);
782 SetManualProxy(manual, state, ::onc::proxy::kHttps, config.single_proxy);
783 SetManualProxy(manual, state, ::onc::proxy::kFtp, config.single_proxy);
784 SetManualProxy(manual, state, ::onc::proxy::kSocks, config.single_proxy);
785 break;
786 }
787 case UIProxyConfig::MODE_PROXY_PER_SCHEME: {
788 base::DictionaryValue* manual =
789 EnsureDictionaryValue(::onc::proxy::kManual, proxy_settings);
790 SetManualProxy(manual, state, ::onc::proxy::kHttp, config.http_proxy);
791 SetManualProxy(manual, state, ::onc::proxy::kHttps, config.https_proxy);
792 SetManualProxy(manual, state, ::onc::proxy::kFtp, config.ftp_proxy);
793 SetManualProxy(manual, state, ::onc::proxy::kSocks, config.socks_proxy);
794 break;
795 }
796 case UIProxyConfig::MODE_PAC_SCRIPT: {
797 base::DictionaryValue* pac =
798 EnsureDictionaryValue(::onc::proxy::kPAC, proxy_settings);
799 SetProxyEffectiveValue(
800 pac, state, base::WrapUnique<base::Value>(new base::StringValue(
801 config.automatic_proxy.pac_url.spec())));
802 break;
803 }
804 case UIProxyConfig::MODE_DIRECT:
805 case UIProxyConfig::MODE_AUTO_DETECT:
806 break;
807 }
808
809 VLOG(2) << " NEW PROXY: " << *proxy_settings;
810 }
811
659 void NetworkingPrivateChromeOS::ConnectFailureCallback( 812 void NetworkingPrivateChromeOS::ConnectFailureCallback(
660 const std::string& guid, 813 const std::string& guid,
661 const VoidCallback& success_callback, 814 const VoidCallback& success_callback,
662 const FailureCallback& failure_callback, 815 const FailureCallback& failure_callback,
663 const std::string& error_name, 816 const std::string& error_name,
664 std::unique_ptr<base::DictionaryValue> error_data) { 817 std::unique_ptr<base::DictionaryValue> error_data) {
665 // TODO(stevenjb): Temporary workaround to show the configuration UI. 818 // TODO(stevenjb): Temporary workaround to show the configuration UI.
666 // Eventually the caller (e.g. Settings) should handle any failures and 819 // Eventually the caller (e.g. Settings) should handle any failures and
667 // show its own configuration UI. crbug.com/380937. 820 // show its own configuration UI. crbug.com/380937.
668 if (ui_delegate()->HandleConnectFailed(guid, error_name)) { 821 if (ui_delegate()->HandleConnectFailed(guid, error_name)) {
669 success_callback.Run(); 822 success_callback.Run();
670 return; 823 return;
671 } 824 }
672 failure_callback.Run(error_name); 825 failure_callback.Run(error_name);
673 } 826 }
674 827
675 } // namespace extensions 828 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/api/networking_private/networking_private_chromeos.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698