diff --git a/Android.mk b/Android.mk
index 9755896..45fa10f 100644
--- a/Android.mk
+++ b/Android.mk
@@ -97,10 +97,12 @@
 LOCAL_MODULE := libupdate_engine
 LOCAL_MODULE_CLASS := STATIC_LIBRARIES
 LOCAL_C_INCLUDES += \
-    external/e2fsprogs/lib \
-    $(LOCAL_PATH)/include
+    $(LOCAL_PATH)/include \
+    external/cros/system_api/dbus \
+    external/e2fsprogs/lib
 LOCAL_EXPORT_C_INCLUDE_DIRS += \
-    $(LOCAL_PATH)/include
+    $(LOCAL_PATH)/include \
+    external/cros/system_api/dbus
 LOCAL_STATIC_LIBRARIES += \
     update_metadata-protos \
     update_engine-dbus-adaptor \
@@ -115,6 +117,7 @@
     libcrypto \
     libcurl \
     libmetrics \
+    libshill-client \
     libssl \
     libexpat \
     libchromeos-policy \
@@ -205,6 +208,7 @@
     libcrypto \
     libcurl \
     libmetrics \
+    libshill-client \
     libssl \
     libexpat \
     libchromeos-policy \
@@ -253,6 +257,7 @@
     libcrypto \
     libcurl \
     libmetrics \
+    libshill-client \
     libssl \
     libexpat \
     libchromeos-policy \
@@ -305,6 +310,7 @@
     libcrypto \
     libcurl \
     libmetrics \
+    libshill-client \
     libssl \
     libexpat \
     libchromeos-policy \
diff --git a/include/shill/dbus-constants.h b/include/shill/dbus-constants.h
deleted file mode 100644
index b3ad4bc..0000000
--- a/include/shill/dbus-constants.h
+++ /dev/null
@@ -1,710 +0,0 @@
-// Copyright 2015 The Chromium OS Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef SYSTEM_API_DBUS_SHILL_DBUS_CONSTANTS_H_
-#define SYSTEM_API_DBUS_SHILL_DBUS_CONSTANTS_H_
-
-// TODO(benchan): Reorganize shill constants and remove deprecated ones.
-namespace shill {
-// Flimflam D-Bus service identifiers.
-const char kFlimflamManagerInterface[] = "org.chromium.flimflam.Manager";
-const char kFlimflamServiceName[] = "org.chromium.flimflam";
-const char kFlimflamServicePath[] = "/";  // crosbug.com/20135
-const char kFlimflamServiceInterface[] = "org.chromium.flimflam.Service";
-const char kFlimflamIPConfigInterface[] = "org.chromium.flimflam.IPConfig";
-const char kFlimflamDeviceInterface[] = "org.chromium.flimflam.Device";
-const char kFlimflamProfileInterface[] = "org.chromium.flimflam.Profile";
-const char kFlimflamNetworkInterface[] = "org.chromium.flimflam.Network";
-const char kFlimflamThirdPartyVpnInterface[] =
-    "org.chromium.flimflam.ThirdPartyVpn";
-
-// Flimflam function names.
-const char kGetPropertiesFunction[] = "GetProperties";
-const char kSetPropertyFunction[] = "SetProperty";
-const char kClearPropertyFunction[] = "ClearProperty";
-const char kConnectFunction[] = "Connect";
-const char kDisconnectFunction[] = "Disconnect";
-const char kRequestScanFunction[] = "RequestScan";
-const char kGetServiceFunction[] = "GetService";
-const char kGetWifiServiceFunction[] = "GetWifiService";
-const char kGetVPNServiceFunction[] = "GetVPNService";
-const char kRemoveServiceFunction[] = "Remove";
-const char kEnableTechnologyFunction[] = "EnableTechnology";
-const char kDisableTechnologyFunction[] = "DisableTechnology";
-const char kAddIPConfigFunction[] = "AddIPConfig";
-const char kRemoveConfigFunction[] = "Remove";
-const char kGetEntryFunction[] = "GetEntry";
-const char kDeleteEntryFunction[] = "DeleteEntry";
-const char kActivateCellularModemFunction[] = "ActivateCellularModem";
-const char kRequirePinFunction[] = "RequirePin";
-const char kEnterPinFunction[] = "EnterPin";
-const char kUnblockPinFunction[] = "UnblockPin";
-const char kChangePinFunction[] = "ChangePin";
-const char kProposeScanFunction[] = "ProposeScan";
-const char kRegisterFunction[] = "Register";
-const char kConfigureServiceFunction[] = "ConfigureService";
-const char kConfigureWifiServiceFunction[] = "ConfigureWifiService";
-const char kFindMatchingServiceFunction[] = "FindMatchingService";
-
-// Flimflam Service property names.
-const char kSecurityProperty[] = "Security";
-const char kPriorityProperty[] = "Priority";
-const char kPriorityWithinTechnologyProperty[] = "PriorityWithinTechnology";
-const char kPassphraseProperty[] = "Passphrase";
-const char kIdentityProperty[] = "Identity";
-const char kAuthorityPathProperty[] = "AuthorityPath";
-const char kPassphraseRequiredProperty[] = "PassphraseRequired";
-const char kSaveCredentialsProperty[] = "SaveCredentials";
-const char kSignalStrengthProperty[] = "Strength";
-const char kNameProperty[] = "Name";
-const char kGuidProperty[] = "GUID";
-const char kStateProperty[] = "State";
-const char kTypeProperty[] = "Type";
-const char kDeviceProperty[] = "Device";
-const char kProfileProperty[] = "Profile";
-const char kConnectivityStateProperty[] = "ConnectivityState";
-const char kConnectableProperty[] = "Connectable";
-const char kAutoConnectProperty[] = "AutoConnect";
-const char kIsActiveProperty[] = "IsActive";
-const char kModeProperty[] = "Mode";
-const char kErrorProperty[] = "Error";
-const char kProviderProperty[] = "Provider";
-const char kHostProperty[] = "Host";
-const char kDomainProperty[] = "Domain";
-const char kProxyConfigProperty[] = "ProxyConfig";
-const char kCheckPortalProperty[] = "CheckPortal";
-const char kSSIDProperty[] = "SSID";
-const char kConnectedProperty[] = "Connected";
-const char kUIDataProperty[] = "UIData";
-const char kConnectionIdProperty[] = "ConnectionId";
-const char kVisibleProperty[] = "Visible";
-const char kDnsAutoFallbackProperty[] = "DNSAutoFallback";
-const char kPortalDetectionFailedPhaseProperty[] =
-    "PortalDetectionFailedPhase";
-const char kPortalDetectionFailedStatusProperty[] =
-    "PortalDetectionFailedStatus";
-const char kSavedIPConfigProperty[] = "SavedIPConfig";
-const char kStaticIPConfigProperty[] = "StaticIPConfig";
-const char kLinkMonitorDisableProperty[] = "LinkMonitorDisable";
-const char kSecurityClassProperty[] = "SecurityClass";
-
-// Flimflam provider property names.
-const char kProviderHostProperty[] = "Provider.Host";
-const char kProviderNameProperty[] = "Provider.Name";
-const char kProviderTypeProperty[] = "Provider.Type";
-
-// Flimflam Wifi Service property names.
-const char kWifiBSsid[] = "WiFi.BSSID";
-const char kWifiHexSsid[] = "WiFi.HexSSID";
-const char kWifiFrequency[] = "WiFi.Frequency";
-const char kWifiHiddenSsid[] = "WiFi.HiddenSSID";
-const char kWifiPhyMode[] = "WiFi.PhyMode";
-const char kWifiAuthMode[] = "WiFi.AuthMode";
-const char kWifiChannelProperty[] = "WiFi.Channel";
-const char kWifiPreferredDeviceProperty[] = "WiFi.PreferredDevice";
-const char kWifiRoamThresholdProperty[] = "WiFi.RoamThreshold";
-
-// Flimflam EAP property names.
-const char kEapIdentityProperty[] = "EAP.Identity";
-const char kEapMethodProperty[] = "EAP.EAP";
-const char kEapPhase2AuthProperty[] = "EAP.InnerEAP";
-const char kEapAnonymousIdentityProperty[] = "EAP.AnonymousIdentity";
-const char kEapClientCertProperty[] = "EAP.ClientCert";
-const char kEapCertIdProperty[] = "EAP.CertID";
-const char kEapClientCertNssProperty[] = "EAP.ClientCertNSS";
-const char kEapPrivateKeyProperty[] = "EAP.PrivateKey";
-const char kEapPrivateKeyPasswordProperty[] = "EAP.PrivateKeyPassword";
-const char kEapKeyIdProperty[] = "EAP.KeyID";
-const char kEapCaCertProperty[] = "EAP.CACert";
-const char kEapCaCertIdProperty[] = "EAP.CACertID";
-const char kEapCaCertNssProperty[] = "EAP.CACertNSS";
-const char kEapUseSystemCasProperty[] = "EAP.UseSystemCAs";
-const char kEapUseProactiveKeyCachingProperty[] = "EAP.UseProactiveKeyCaching";
-const char kEapPinProperty[] = "EAP.PIN";
-const char kEapPasswordProperty[] = "EAP.Password";
-const char kEapKeyMgmtProperty[] = "EAP.KeyMgmt";
-
-// Flimflam Cellular Service property names.
-const char kTechnologyFamilyProperty[] = "Cellular.Family";
-const char kActivationStateProperty[] = "Cellular.ActivationState";
-const char kNetworkTechnologyProperty[] = "Cellular.NetworkTechnology";
-const char kRoamingStateProperty[] = "Cellular.RoamingState";
-const char kOperatorNameProperty[] = "Cellular.OperatorName";
-const char kOperatorCodeProperty[] = "Cellular.OperatorCode";
-const char kServingOperatorProperty[] = "Cellular.ServingOperator";
-const char kPaymentPortalProperty[] = "Cellular.Olp";
-const char kUsageURLProperty[] = "Cellular.UsageUrl";
-const char kCellularApnProperty[] = "Cellular.APN";
-const char kCellularLastGoodApnProperty[] = "Cellular.LastGoodAPN";
-const char kCellularApnListProperty[] = "Cellular.APNList";
-
-// Flimflam Manager property names.
-const char kProfilesProperty[] = "Profiles";
-const char kServicesProperty[] = "Services";
-const char kServiceWatchListProperty[] = "ServiceWatchList";
-const char kAvailableTechnologiesProperty[] = "AvailableTechnologies";
-const char kEnabledTechnologiesProperty[] = "EnabledTechnologies";
-const char kConnectedTechnologiesProperty[] = "ConnectedTechnologies";
-const char kDefaultTechnologyProperty[] = "DefaultTechnology";
-const char kOfflineModeProperty[] = "OfflineMode";
-const char kActiveProfileProperty[] = "ActiveProfile";
-const char kDevicesProperty[] = "Devices";
-const char kCheckPortalListProperty[] = "CheckPortalList";
-const char kArpGatewayProperty[] = "ArpGateway";
-const char kCountryProperty[] = "Country";
-const char kPortalURLProperty[] = "PortalURL";
-const char kConnectionStateProperty[] = "ConnectionState";
-const char kClaimedDevicesProperty[] = "ClaimedDevices";
-
-// Flimflam Profile property names.
-const char kEntriesProperty[] = "Entries";
-
-// Flimflam Device property names.
-const char kScanningProperty[] = "Scanning";
-const char kPoweredProperty[] = "Powered";
-const char kNetworksProperty[] = "Networks";
-const char kScanIntervalProperty[] = "ScanInterval";
-const char kBgscanMethodProperty[] = "BgscanMethod";
-const char kBgscanShortIntervalProperty[] = "BgscanShortInterval";
-const char kRoamThresholdProperty[] = "RoamThreshold";
-const char kDBusObjectProperty[] = "DBus.Object";
-const char kDBusServiceProperty[] = "DBus.Service";
-const char kBgscanSignalThresholdProperty[] = "BgscanSignalThreshold";
-const char kWakeToScanPeriodSecondsProperty[] = "WakeToScanPeriodSeconds";
-const char kNetDetectScanPeriodSecondsProperty[] = "NetDetectScanPeriodSeconds";
-const char kForceWakeToScanTimerProperty[] = "ForceWakeToScanTimer";
-// The name of the network interface, ie. wlan0, eth0, etc.
-const char kInterfaceProperty[] = "Interface";
-const char kSelectedServiceProperty[] = "SelectedService";
-const char kIPConfigsProperty[] = "IPConfigs";
-
-// Flimflam Cellular Device property names.
-const char kCarrierProperty[] = "Cellular.Carrier";
-const char kCellularAllowRoamingProperty[] = "Cellular.AllowRoaming";
-const char kHomeProviderProperty[] = "Cellular.HomeProvider";
-const char kMeidProperty[] = "Cellular.MEID";
-const char kImeiProperty[] = "Cellular.IMEI";
-const char kIccidProperty[] = "Cellular.ICCID";
-const char kImsiProperty[] = "Cellular.IMSI";
-const char kEsnProperty[] = "Cellular.ESN";
-const char kMdnProperty[] = "Cellular.MDN";
-const char kMinProperty[] = "Cellular.MIN";
-const char kModelIDProperty[] = "Cellular.ModelID";
-const char kManufacturerProperty[] = "Cellular.Manufacturer";
-const char kFirmwareRevisionProperty[] = "Cellular.FirmwareRevision";
-const char kHardwareRevisionProperty[] = "Cellular.HardwareRevision";
-const char kPRLVersionProperty[] = "Cellular.PRLVersion";
-const char kSelectedNetworkProperty[] = "Cellular.SelectedNetwork";
-const char kSupportNetworkScanProperty[] = "Cellular.SupportNetworkScan";
-const char kFoundNetworksProperty[] = "Cellular.FoundNetworks";
-
-// Flimflam state options.
-const char kStateIdle[] = "idle";
-const char kStateCarrier[] = "carrier";
-const char kStateAssociation[] = "association";
-const char kStateConfiguration[] = "configuration";
-const char kStateReady[] = "ready";
-const char kStatePortal[] = "portal";
-const char kStateOffline[] = "offline";
-const char kStateOnline[] = "online";
-const char kStateDisconnect[] = "disconnect";
-const char kStateFailure[] = "failure";
-const char kStateActivationFailure[] = "activation-failure";
-
-// Flimflam portal phase and status.
-const char kPortalDetectionPhaseConnection[] = "Connection";
-const char kPortalDetectionPhaseDns[] = "DNS";
-const char kPortalDetectionPhaseHttp[] = "HTTP";
-const char kPortalDetectionPhaseContent[] = "Content";
-const char kPortalDetectionPhaseUnknown[] = "Unknown";
-const char kPortalDetectionStatusFailure[] = "Failure";
-const char kPortalDetectionStatusTimeout[] = "Timeout";
-const char kPortalDetectionStatusSuccess[] = "Success";
-
-// Flimflam property names for SIMLock status.
-const char kSIMLockStatusProperty[] = "Cellular.SIMLockStatus";
-const char kSIMLockTypeProperty[] = "LockType";
-const char kSIMLockRetriesLeftProperty[] = "RetriesLeft";
-const char kSIMLockEnabledProperty[] = "LockEnabled";
-
-// Flimflam property names for Cellular.FoundNetworks.
-const char kLongNameProperty[] = "long_name";
-const char kStatusProperty[] = "status";
-const char kShortNameProperty[] = "short_name";
-const char kTechnologyProperty[] = "technology";
-const char kNetworkIdProperty[] = "network_id";
-
-// Flimflam SIMLock status types.
-const char kSIMLockPin[] = "sim-pin";
-const char kSIMLockPuk[] = "sim-puk";
-
-// APN info property names.
-const char kApnProperty[] = "apn";
-const char kApnNetworkIdProperty[] = "network_id";
-const char kApnUsernameProperty[] = "username";
-const char kApnPasswordProperty[] = "password";
-const char kApnNameProperty[] = "name";
-const char kApnLocalizedNameProperty[] = "localized_name";
-const char kApnLanguageProperty[] = "language";
-
-// Payment Portal property names.
-const char kPaymentPortalURL[] = "url";
-const char kPaymentPortalMethod[] = "method";
-const char kPaymentPortalPostData[] = "postdata";
-
-// Operator info property names.
-const char kOperatorNameKey[] = "name";
-const char kOperatorCodeKey[] = "code";
-const char kOperatorCountryKey[] = "country";
-
-// Flimflam network technology options.
-const char kNetworkTechnology1Xrtt[] = "1xRTT";
-const char kNetworkTechnologyEvdo[] = "EVDO";
-const char kNetworkTechnologyGsm[] = "GSM";
-const char kNetworkTechnologyGprs[] = "GPRS";
-const char kNetworkTechnologyEdge[] = "EDGE";
-const char kNetworkTechnologyUmts[] = "UMTS";
-const char kNetworkTechnologyHspa[] = "HSPA";
-const char kNetworkTechnologyHspaPlus[] = "HSPA+";
-const char kNetworkTechnologyLte[] = "LTE";
-const char kNetworkTechnologyLteAdvanced[] = "LTE Advanced";
-
-// Flimflam roaming state options
-const char kRoamingStateHome[] = "home";
-const char kRoamingStateRoaming[] = "roaming";
-const char kRoamingStateUnknown[] = "unknown";
-
-// Flimflam activation state options
-const char kActivationStateActivated[] = "activated";
-const char kActivationStateActivating[] = "activating";
-const char kActivationStateNotActivated[] = "not-activated";
-const char kActivationStatePartiallyActivated[] = "partially-activated";
-const char kActivationStateUnknown[] = "unknown";
-
-// Flimflam EAP method options.
-const char kEapMethodPEAP[] = "PEAP";
-const char kEapMethodTLS[] = "TLS";
-const char kEapMethodTTLS[] = "TTLS";
-const char kEapMethodLEAP[] = "LEAP";
-
-// Flimflam EAP phase 2 auth options.
-const char kEapPhase2AuthPEAPMD5[] = "auth=MD5";
-const char kEapPhase2AuthPEAPMSCHAPV2[] = "auth=MSCHAPV2";
-const char kEapPhase2AuthPEAPGTC[] = "auth=GTC";
-const char kEapPhase2AuthTTLSMD5[] = "autheap=MD5";  // crosbug/26822
-const char kEapPhase2AuthTTLSEAPMD5[] = "autheap=MD5";
-const char kEapPhase2AuthTTLSEAPMSCHAPV2[] = "autheap=MSCHAPV2";
-const char kEapPhase2AuthTTLSMSCHAPV2[] = "auth=MSCHAPV2";
-const char kEapPhase2AuthTTLSMSCHAP[] = "auth=MSCHAP";
-const char kEapPhase2AuthTTLSPAP[] = "auth=PAP";
-const char kEapPhase2AuthTTLSCHAP[] = "auth=CHAP";
-const char kEapPhase2AuthTTLSGTC[] = "auth=GTC";
-const char kEapPhase2AuthTTLSEAPGTC[] = "autheap=GTC";
-
-// Flimflam VPN provider types.
-const char kProviderL2tpIpsec[] = "l2tpipsec";
-const char kProviderOpenVpn[] = "openvpn";
-const char kProviderThirdPartyVpn[] = "thirdpartyvpn";
-
-// Flimflam VPN service properties
-const char kVPNDomainProperty[] = "VPN.Domain";
-
-// Flimflam monitored properties
-const char kMonitorPropertyChanged[] = "PropertyChanged";
-
-// Flimflam type options.
-const char kTypeEthernet[] = "ethernet";
-const char kTypeWifi[] = "wifi";
-const char kTypeWimax[] = "wimax";
-const char kTypeBluetooth[] = "bluetooth";
-const char kTypeCellular[] = "cellular";
-const char kTypeVPN[] = "vpn";
-const char kTypePPPoE[] = "pppoe";
-
-// Flimflam mode options.
-const char kModeManaged[] = "managed";
-const char kModeAdhoc[] = "adhoc";
-
-// Flimflam security options.
-const char kSecurityWpa[] = "wpa";
-const char kSecurityWep[] = "wep";
-const char kSecurityRsn[] = "rsn";
-const char kSecurity8021x[] = "802_1x";
-const char kSecurityPsk[] = "psk";
-const char kSecurityNone[] = "none";
-
-// Flimflam L2TPIPsec property names.
-const char kL2tpIpsecAuthenticationType[] = "L2TPIPsec.AuthenticationType";
-const char kL2tpIpsecCaCertNssProperty[] = "L2TPIPsec.CACertNSS";
-const char kL2tpIpsecClientCertIdProperty[] = "L2TPIPsec.ClientCertID";
-const char kL2tpIpsecClientCertSlotProperty[] = "L2TPIPsec.ClientCertSlot";
-const char kL2tpIpsecIkeVersion[] = "L2TPIPsec.IKEVersion";
-const char kL2tpIpsecPinProperty[] = "L2TPIPsec.PIN";
-const char kL2tpIpsecPskProperty[] = "L2TPIPsec.PSK";
-const char kL2tpIpsecPskRequiredProperty[] = "L2TPIPsec.PSKRequired";
-const char kL2tpIpsecUserProperty[] = "L2TPIPsec.User";
-const char kL2tpIpsecPasswordProperty[] = "L2TPIPsec.Password";
-
-// Flimflam OpenVPN property names.
-const char kOpenVPNAuthNoCacheProperty[] = "OpenVPN.AuthNoCache";
-const char kOpenVPNAuthProperty[] = "OpenVPN.Auth";
-const char kOpenVPNAuthRetryProperty[] = "OpenVPN.AuthRetry";
-const char kOpenVPNAuthUserPassProperty[] = "OpenVPN.AuthUserPass";
-const char kOpenVPNCaCertProperty[] = "OpenVPN.CACert";
-const char kOpenVPNCaCertNSSProperty[] = "OpenVPN.CACertNSS";
-const char kOpenVPNClientCertIdProperty[] = "OpenVPN.Pkcs11.ID";
-const char kOpenVPNClientCertSlotProperty[] = "OpenVPN.Pkcs11.Slot";
-const char kOpenVPNCipherProperty[] = "OpenVPN.Cipher";
-const char kOpenVPNCompLZOProperty[] = "OpenVPN.CompLZO";
-const char kOpenVPNCompNoAdaptProperty[] = "OpenVPN.CompNoAdapt";
-const char kOpenVPNIgnoreDefaultRouteProperty[] = "OpenVPN.IgnoreDefaultRoute";
-const char kOpenVPNKeyDirectionProperty[] = "OpenVPN.KeyDirection";
-const char kOpenVPNMgmtEnableProperty[] = "OpenVPN.Mgmt.Enable";
-const char kOpenVPNNsCertTypeProperty[] = "OpenVPN.NsCertType";
-const char kOpenVPNOTPProperty[] = "OpenVPN.OTP";
-const char kOpenVPNPasswordProperty[] = "OpenVPN.Password";
-const char kOpenVPNPinProperty[] = "OpenVPN.Pkcs11.PIN";
-const char kOpenVPNPortProperty[] = "OpenVPN.Port";
-const char kOpenVPNProtoProperty[] = "OpenVPN.Proto";
-const char kOpenVPNProviderProperty[] = "OpenVPN.Pkcs11.Provider";
-const char kOpenVPNPushPeerInfoProperty[] = "OpenVPN.PushPeerInfo";
-const char kOpenVPNRemoteCertEKUProperty[] = "OpenVPN.RemoteCertEKU";
-const char kOpenVPNRemoteCertKUProperty[] = "OpenVPN.RemoteCertKU";
-const char kOpenVPNRemoteCertTLSProperty[] = "OpenVPN.RemoteCertTLS";
-const char kOpenVPNRenegSecProperty[] = "OpenVPN.RenegSec";
-const char kOpenVPNServerPollTimeoutProperty[] = "OpenVPN.ServerPollTimeout";
-const char kOpenVPNShaperProperty[] = "OpenVPN.Shaper";
-const char kOpenVPNStaticChallengeProperty[] = "OpenVPN.StaticChallenge";
-const char kOpenVPNTLSAuthContentsProperty[] = "OpenVPN.TLSAuthContents";
-const char kOpenVPNTLSRemoteProperty[] = "OpenVPN.TLSRemote";
-const char kOpenVPNUserProperty[] = "OpenVPN.User";
-
-// FlimFlam PPPoE property names.
-const char kPPPoEUsernameProperty[] = "PPPoE.Username";
-const char kPPPoEPasswordProperty[] = "PPPoE.Password";
-const char kPPPoELCPEchoIntervalProperty[] = "PPPoE.LCPEchoInterval";
-const char kPPPoELCPEchoFailureProperty[] = "PPPoE.LCPEchoFailure";
-const char kPPPoEMaxAuthFailureProperty[] = "PPPoE.MaxAuthFailure";
-
-// FlimFlam technology family options
-const char kTechnologyFamilyCdma[] = "CDMA";
-const char kTechnologyFamilyGsm[] = "GSM";
-
-// IPConfig property names.
-const char kMethodProperty[] = "Method";
-const char kAddressProperty[] = "Address";
-const char kMtuProperty[] = "Mtu";
-const char kPrefixlenProperty[] = "Prefixlen";
-const char kBroadcastProperty[] = "Broadcast";
-const char kPeerAddressProperty[] = "PeerAddress";
-const char kGatewayProperty[] = "Gateway";
-const char kDomainNameProperty[] = "DomainName";
-const char kAcceptedHostnameProperty[] = "AcceptedHostname";
-const char kNameServersProperty[] = "NameServers";
-const char kDelegatedPrefixProperty[] = "DelegatedPrefix";
-const char kDelegatedPrefixLengthProperty[] = "DelegatedPrefixLength";
-
-// IPConfig type options.
-const char kTypeIPv4[] = "ipv4";
-const char kTypeIPv6[] = "ipv6";
-const char kTypeDHCP[] = "dhcp";
-const char kTypeBOOTP[] = "bootp";
-const char kTypeZeroConf[] = "zeroconf";
-const char kTypeDHCP6[] = "dhcp6";
-const char kTypePPP[] = "ppp";
-
-// Flimflam error options.
-const char kErrorAaaFailed[] = "aaa-failed";
-const char kErrorActivationFailed[] = "activation-failed";
-const char kErrorBadPassphrase[] = "bad-passphrase";
-const char kErrorBadWEPKey[] = "bad-wepkey";
-const char kErrorConnectFailed[] = "connect-failed";
-const char kErrorDNSLookupFailed[] = "dns-lookup-failed";
-const char kErrorDhcpFailed[] = "dhcp-failed";
-const char kErrorHTTPGetFailed[] = "http-get-failed";
-const char kErrorInternal[] = "internal-error";
-const char kErrorIpsecCertAuthFailed[] = "ipsec-cert-auth-failed";
-const char kErrorIpsecPskAuthFailed[] = "ipsec-psk-auth-failed";
-const char kErrorNeedEvdo[] = "need-evdo";
-const char kErrorNeedHomeNetwork[] = "need-home-network";
-const char kErrorOtaspFailed[] = "otasp-failed";
-const char kErrorOutOfRange[] = "out-of-range";
-const char kErrorPinMissing[] = "pin-missing";
-const char kErrorPppAuthFailed[] = "ppp-auth-failed";
-
-// Flimflam error result codes.
-const char kErrorResultSuccess[] = "org.chromium.flimflam.Error.Success";
-const char kErrorResultFailure[] = "org.chromium.flimflam.Error.Failure";
-const char kErrorResultAlreadyConnected[] =
-    "org.chromium.flimflam.Error.AlreadyConnected";
-const char kErrorResultAlreadyExists[] =
-    "org.chromium.flimflam.Error.AlreadyExists";
-const char kErrorResultIncorrectPin[] =
-     "org.chromium.flimflam.Error.IncorrectPin";
-const char kErrorResultInProgress[] = "org.chromium.flimflam.Error.InProgress";
-const char kErrorResultInternalError[] =
-    "org.chromium.flimflam.Error.InternalError";
-const char kErrorResultInvalidApn[] = "org.chromium.flimflam.Error.InvalidApn";
-const char kErrorResultInvalidArguments[] =
-    "org.chromium.flimflam.Error.InvalidArguments";
-const char kErrorResultInvalidNetworkName[] =
-    "org.chromium.flimflam.Error.InvalidNetworkName";
-const char kErrorResultInvalidPassphrase[] =
-    "org.chromium.flimflam.Error.InvalidPassphrase";
-const char kErrorResultInvalidProperty[] =
-    "org.chromium.flimflam.Error.InvalidProperty";
-const char kErrorResultNoCarrier[] = "org.chromium.flimflam.Error.NoCarrier";
-const char kErrorResultNotConnected[] =
-     "org.chromium.flimflam.Error.NotConnected";
-const char kErrorResultNotFound[] = "org.chromium.flimflam.Error.NotFound";
-const char kErrorResultNotImplemented[] =
-    "org.chromium.flimflam.Error.NotImplemented";
-const char kErrorResultNotOnHomeNetwork[] =
-    "org.chromium.flimflam.Error.NotOnHomeNetwork";
-const char kErrorResultNotRegistered[] =
-    "org.chromium.flimflam.Error.NotRegistered";
-const char kErrorResultNotSupported[] =
-     "org.chromium.flimflam.Error.NotSupported";
-const char kErrorResultOperationAborted[] =
-    "org.chromium.flimflam.Error.OperationAborted";
-const char kErrorResultOperationInitiated[] =
-    "org.chromium.flimflam.Error.OperationInitiated";
-const char kErrorResultOperationTimeout[] =
-    "org.chromium.flimflam.Error.OperationTimeout";
-const char kErrorResultPassphraseRequired[] =
-    "org.chromium.flimflam.Error.PassphraseRequired";
-const char kErrorResultPermissionDenied[] =
-    "org.chromium.flimflam.Error.PermissionDenied";
-const char kErrorResultPinBlocked[] = "org.chromium.flimflam.Error.PinBlocked";
-const char kErrorResultPinRequired[] =
-     "org.chromium.flimflam.Error.PinRequired";
-const char kErrorResultWrongState[] = "org.chromium.flimflam.Error.WrongState";
-
-const char kUnknownString[] = "UNKNOWN";
-
-// Function names.
-const char kClearPropertiesFunction[] = "ClearProperties";
-const char kCompleteCellularActivationFunction[] = "CompleteCellularActivation";
-const char kConfigureServiceForProfileFunction[] = "ConfigureServiceForProfile";
-const char kConnectToBestServicesFunction[] = "ConnectToBestServices";
-const char kCreateConnectivityReportFunction[] = "CreateConnectivityReport";
-const char kAddWakeOnPacketConnectionFunction[] = "AddWakeOnPacketConnection";
-const char kRemoveWakeOnPacketConnectionFunction[] =
-    "RemoveWakeOnPacketConnection";
-const char kRemoveAllWakeOnPacketConnectionsFunction[] =
-    "RemoveAllWakeOnPacketConnections";
-const char kGetLoadableProfileEntriesFunction[] = "GetLoadableProfileEntries";
-const char kGetNetworksForGeolocation[] = "GetNetworksForGeolocation";
-const char kPerformTDLSOperationFunction[] = "PerformTDLSOperation";
-const char kRefreshFunction[] = "Refresh";
-const char kResetFunction[] = "Reset";
-const char kSetCarrierFunction[] = "SetCarrier";
-const char kSetPropertiesFunction[] = "SetProperties";
-const char kVerifyAndEncryptCredentialsFunction[] =
-    "VerifyAndEncryptCredentials";
-const char kVerifyAndEncryptDataFunction[] = "VerifyAndEncryptData";
-const char kVerifyDestinationFunction[] = "VerifyDestination";
-
-// ThirdPartyVpn functions.
-const char kSetParametersFunction[] = "SetParameters";
-const char kSendPacketFunction[] = "SendPacket";
-const char kUpdateConnectionStateFunction[] = "UpdateConnectionState";
-const char kOnPacketReceivedFunction[] = "OnPacketReceived";
-const char kOnPlatformMessageFunction[] = "OnPlatformMessage";
-
-// Device property names.
-const char kEapAuthenticationCompletedProperty[] = "EapAuthenticationCompleted";
-const char kEapAuthenticatorDetectedProperty[] = "EapAuthenticatorDetected";
-const char kLinkMonitorResponseTimeProperty[] = "LinkMonitorResponseTime";
-const char kLinkUpProperty[] = "Ethernet.LinkUp";
-const char kProviderRequiresRoamingProperty[] =
-    "Cellular.ProviderRequiresRoaming";
-const char kPPPoEProperty[] = "Ethernet.PPPoE";
-const char kReceiveByteCountProperty[] = "ReceiveByteCount";
-const char kSIMPresentProperty[] = "Cellular.SIMPresent";
-const char kSupportedCarriersProperty[] = "Cellular.SupportedCarriers";
-const char kTransmitByteCountProperty[] = "TransmitByteCount";
-
-// Technology types (augments "Flimflam type options" above).
-const char kTypeEthernetEap[] = "etherneteap";
-
-// Error strings.
-const char kErrorEapAuthenticationFailed[] = "eap-authentication-failed";
-const char kErrorEapLocalTlsFailed[] = "eap-local-tls-failed";
-const char kErrorEapRemoteTlsFailed[] = "eap-remote-tls-failed";
-
-// IPConfig property names.
-const char kSearchDomainsProperty[] = "SearchDomains";
-const char kVendorEncapsulatedOptionsProperty[] = "VendorEncapsulatedOptions";
-const char kWebProxyAutoDiscoveryUrlProperty[] = "WebProxyAutoDiscoveryUrl";
-
-// Manager property names.
-const char kDefaultServiceProperty[] = "DefaultService";
-const char kDisableWiFiVHTProperty[] = "DisableWiFiVHT";
-const char kHostNameProperty[] = "HostName";
-const char kIgnoredDNSSearchPathsProperty[] = "IgnoredDNSSearchPaths";
-const char kLinkMonitorTechnologiesProperty[] =
-    "LinkMonitorTechnologies";
-const char kNoAutoConnectTechnologiesProperty[] = "NoAutoConnectTechnologies";
-const char kPortalCheckIntervalProperty[] = "PortalCheckInterval";
-const char kProhibitedTechnologiesProperty[] = "ProhibitedTechnologies";
-const char kServiceCompleteListProperty[] = "ServiceCompleteList";
-const char kShortDNSTimeoutTechnologiesProperty[] =
-    "ShortDNSTimeoutTechnologies";
-const char kUninitializedTechnologiesProperty[] = "UninitializedTechnologies";
-const char kWakeOnLanEnabledProperty[] = "WakeOnLanEnabled";
-const char kWakeOnWiFiFeaturesEnabledProperty[] = "WakeOnWiFiFeaturesEnabled";
-
-// Service property names.
-const char kActivationTypeProperty[] = "Cellular.ActivationType";
-const char kDiagnosticsDisconnectsProperty[] = "Diagnostics.Disconnects";
-const char kDiagnosticsMisconnectsProperty[] = "Diagnostics.Misconnects";
-const char kEapRemoteCertificationProperty[] = "EAP.RemoteCertification";
-const char kEapCaCertPemProperty[] = "EAP.CACertPEM";
-const char kEapSubjectMatchProperty[] = "EAP.SubjectMatch";
-const char kErrorDetailsProperty[] = "ErrorDetails";
-const char kHTTPProxyPortProperty[] = "HTTPProxyPort";
-const char kIPConfigProperty[] = "IPConfig";
-const char kL2tpIpsecCaCertPemProperty[] = "L2TPIPsec.CACertPEM";
-const char kL2tpIpsecTunnelGroupProperty[] = "L2TPIPsec.TunnelGroup";
-const char kL2tpIpsecXauthPasswordProperty[] = "L2TPIPsec.XauthPassword";
-const char kL2tpIpsecXauthUserProperty[] = "L2TPIPsec.XauthUser";
-const char kL2tpIpsecLcpEchoDisabledProperty[] = "L2TPIPsec.LCPEchoDisabled";
-const char kManagedCredentialsProperty[] = "ManagedCredentials";
-const char kOpenVPNCaCertPemProperty[] = "OpenVPN.CACertPEM";
-const char kOpenVPNCertProperty[] = "OpenVPN.Cert";
-const char kOpenVPNExtraCertPemProperty[] = "OpenVPN.ExtraCertPEM";
-const char kOpenVPNKeyProperty[] = "OpenVPN.Key";
-const char kOpenVPNPingProperty[] = "OpenVPN.Ping";
-const char kOpenVPNPingExitProperty[] = "OpenVPN.PingExit";
-const char kOpenVPNPingRestartProperty[] = "OpenVPN.PingRestart";
-const char kOpenVPNTLSAuthProperty[] = "OpenVPN.TLSAuth";
-const char kOpenVPNTokenProperty[] = "OpenVPN.Token";
-const char kOpenVPNVerbProperty[] = "OpenVPN.Verb";
-const char kOpenVPNVerifyHashProperty[] = "OpenVPN.VerifyHash";
-const char kOpenVPNVerifyX509NameProperty[] = "OpenVPN.VerifyX509Name";
-const char kOpenVPNVerifyX509TypeProperty[] = "OpenVPN.VerifyX509Type";
-const char kOutOfCreditsProperty[] = "Cellular.OutOfCredits";
-const char kPhysicalTechnologyProperty[] = "PhysicalTechnology";
-const char kPreviousErrorProperty[] = "PreviousError";
-const char kPreviousErrorSerialNumberProperty[] = "PreviousErrorSerialNumber";
-const char kStaticIPAddressProperty[] = "StaticIP.Address";
-const char kStaticIPGatewayProperty[] = "StaticIP.Gateway";
-const char kStaticIPMtuProperty[] = "StaticIP.Mtu";
-const char kStaticIPNameServersProperty[] = "StaticIP.NameServers";
-const char kStaticIPPeerAddressProperty[] = "StaticIP.PeerAddress";
-const char kStaticIPPrefixlenProperty[] = "StaticIP.Prefixlen";
-const char kSavedIPAddressProperty[] = "SavedIP.Address";
-const char kSavedIPGatewayProperty[] = "SavedIP.Gateway";
-const char kSavedIPMtuProperty[] = "SavedIP.Mtu";
-const char kSavedIPNameServersProperty[] = "SavedIP.NameServers";
-const char kSavedIPPeerAddressProperty[] = "SavedIP.PeerAddress";
-const char kSavedIPPrefixlenProperty[] = "SavedIP.Prefixlen";
-const char kTetheringProperty[] = "Tethering";
-const char kVPNMTUProperty[] = "VPN.MTU";
-const char kWifiFrequencyListProperty[] = "WiFi.FrequencyList";
-const char kWifiVendorInformationProperty[] = "WiFi.VendorInformation";
-const char kWifiProtectedManagementFrameRequiredProperty[] =
-    "WiFi.ProtectedManagementFrameRequired";
-
-// Profile property names.
-const char kUserHashProperty[] = "UserHash";
-
-// Service Tethering property values.
-const char kTetheringNotDetectedState[] = "NotDetected";
-const char kTetheringSuspectedState[] = "Suspected";
-const char kTetheringConfirmedState[] = "Confirmed";
-
-// WiFi Service Vendor Information dictionary properties.
-const char kVendorWPSManufacturerProperty[] = "Manufacturer";
-const char kVendorWPSModelNameProperty[] = "ModelName";
-const char kVendorWPSModelNumberProperty[] = "ModelNumber";
-const char kVendorWPSDeviceNameProperty[] = "DeviceName";
-const char kVendorOUIListProperty[] = "OUIList";
-
-// WiFi Device link property names.
-const char kLinkStatisticsProperty[] = "LinkStatistics";
-const char kAverageReceiveSignalDbmProperty[] = "AverageReceiveSignalDbm";
-const char kInactiveTimeMillisecondsProperty[] =
-    "InactiveTimeMilliseconds";
-const char kLastReceiveSignalDbmProperty[] = "LastReceiveSignalDbm";
-const char kPacketReceiveSuccessesProperty[] = "PacketReceiveSuccesses";
-const char kPacketTransmitFailuresProperty[] = "PacketTransmitFailures";
-const char kPacketTransmitSuccessesProperty[] = "PacketTrasmitSuccesses";
-const char kTransmitBitrateProperty[] = "TransmitBitrate";
-const char kTransmitRetriesProperty[] = "TransmitRetries";
-
-// WiFi TDLS operations.
-const char kTDLSDiscoverOperation[] = "Discover";
-const char kTDLSSetupOperation[] = "Setup";
-const char kTDLSStatusOperation[] = "Status";
-const char kTDLSTeardownOperation[] = "Teardown";
-
-// WiFi TDLS states.
-const char kTDLSConnectedState[] = "Connected";
-const char kTDLSDisabledState[] = "Disabled";
-const char kTDLSDisconnectedState[] = "Disconnected";
-const char kTDLSNonexistentState[] = "Nonexistent";
-const char kTDLSUnknownState[] = "Unknown";
-
-// Wake on WiFi features.
-const char kWakeOnWiFiFeaturesEnabledPacket[] = "packet";
-const char kWakeOnWiFiFeaturesEnabledSSID[] = "ssid";
-const char kWakeOnWiFiFeaturesEnabledPacketSSID[] = "packet_and_ssid";
-const char kWakeOnWiFiFeaturesEnabledNone[] = "none";
-const char kWakeOnWiFiFeaturesEnabledNotSupported[] = "not_supported";
-
-// Cellular service carriers.
-const char kCarrierGenericUMTS[] = "Generic UMTS";
-const char kCarrierSprint[] = "Sprint";
-const char kCarrierVerizon[] = "Verizon Wireless";
-
-// Cellular activation types.
-const char kActivationTypeNonCellular[] = "NonCellular";  // For future use
-const char kActivationTypeOMADM[] = "OMADM";  // For future use
-const char kActivationTypeOTA[] = "OTA";
-const char kActivationTypeOTASP[] = "OTASP";
-
-// Geolocation property field names.
-// Reference:
-//    https://devsite.googleplex.com/maps/documentation/business/geolocation/
-// Top level properties for a Geolocation request.
-const char kGeoHomeMobileCountryCodeProperty[] = "homeMobileCountryCode";
-const char kGeoHomeMobileNetworkCodeProperty[] = "homeMobileNetworkCode";
-const char kGeoRadioTypePropertyProperty[] = "radioType";
-const char kGeoCellTowersProperty[] = "cellTowers";
-const char kGeoWifiAccessPointsProperty[] = "wifiAccessPoints";
-// Cell tower object property names.
-const char kGeoCellIdProperty[] = "cellId";
-const char kGeoLocationAreaCodeProperty[] = "locationAreaCode";
-const char kGeoMobileCountryCodeProperty[] = "mobileCountryCode";
-const char kGeoMobileNetworkCodeProperty[] = "mobileNetworkCode";
-const char kGeoTimingAdvanceProperty[] = "timingAdvance";
-// WiFi access point property names.
-const char kGeoMacAddressProperty[] = "macAddress";
-const char kGeoChannelProperty[] = "channel";
-const char kGeoSignalToNoiseRatioProperty[] = "signalToNoiseRatio";
-// Common property names for geolocation objects.
-const char kGeoAgeProperty[] = "age";
-const char kGeoSignalStrengthProperty[] = "signalStrength";
-// ThirdPartyVpn parameters, properties and constants.
-const char kAddressParameterThirdPartyVpn[] = "address";
-const char kBroadcastAddressParameterThirdPartyVpn[] = "broadcast_address";
-const char kGatewayParameterThirdPartyVpn[] = "gateway";
-const char kBypassTunnelForIpParameterThirdPartyVpn[] = "bypass_tunnel_for_ip";
-const char kSubnetPrefixParameterThirdPartyVpn[] = "subnet_prefix";
-const char kMtuParameterThirdPartyVpn[] = "mtu";
-const char kDomainSearchParameterThirdPartyVpn[] = "domain_search";
-const char kDnsServersParameterThirdPartyVpn[] = "dns_servers";
-const char kInclusionListParameterThirdPartyVpn[] = "inclusion_list";
-const char kExclusionListParameterThirdPartyVpn[] = "exclusion_list";
-const char kObjectPathSuffixProperty[] = "ObjectPathSuffix";
-const char kExtensionNameProperty[] = "ExtensionName";
-const char kConfigurationNameProperty[] = "ConfigurationName";
-const char kObjectPathBase[] = "/thirdpartyvpn/";
-const char kNonIPDelimiter = ':';
-const char kIPDelimiter = ' ';
-}  // namespace shill
-
-#endif  // SYSTEM_API_DBUS_SHILL_DBUS_CONSTANTS_H_
diff --git a/include/shill/dbus-proxies.h b/include/shill/dbus-proxies.h
deleted file mode 100644
index 188322a..0000000
--- a/include/shill/dbus-proxies.h
+++ /dev/null
@@ -1,3972 +0,0 @@
-// Automatic generation of D-Bus interfaces:
-//  - org.chromium.flimflam.Device
-//  - org.chromium.flimflam.IPConfig
-//  - org.chromium.flimflam.Manager
-//  - org.chromium.flimflam.Profile
-//  - org.chromium.flimflam.Service
-//  - org.chromium.flimflam.Task
-//  - org.chromium.flimflam.ThirdPartyVpn
-#ifndef ____CHROMEOS_DBUS_BINDING___BUILD_LINK_VAR_CACHE_PORTAGE_CHROMEOS_BASE_SHILL_OUT_DEFAULT_GEN_INCLUDE_SHILL_DBUS_PROXIES_H
-#define ____CHROMEOS_DBUS_BINDING___BUILD_LINK_VAR_CACHE_PORTAGE_CHROMEOS_BASE_SHILL_OUT_DEFAULT_GEN_INCLUDE_SHILL_DBUS_PROXIES_H
-#include <memory>
-#include <string>
-#include <vector>
-
-#include <base/bind.h>
-#include <base/callback.h>
-#include <base/logging.h>
-#include <base/macros.h>
-#include <base/memory/ref_counted.h>
-#include <chromeos/any.h>
-#include <chromeos/dbus/dbus_method_invoker.h>
-#include <chromeos/dbus/dbus_property.h>
-#include <chromeos/dbus/dbus_signal_handler.h>
-#include <chromeos/errors/error.h>
-#include <chromeos/variant_dictionary.h>
-#include <dbus/bus.h>
-#include <dbus/message.h>
-#include <dbus/object_manager.h>
-#include <dbus/object_path.h>
-#include <dbus/object_proxy.h>
-
-namespace org {
-namespace chromium {
-namespace flimflam {
-
-// Abstract interface proxy for org::chromium::flimflam::Device.
-class DeviceProxyInterface {
- public:
-  virtual ~DeviceProxyInterface() = default;
-
-  virtual bool AddWakeOnPacketConnection(
-      const std::string& in_ip_endpoint,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void AddWakeOnPacketConnectionAsync(
-      const std::string& in_ip_endpoint,
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual bool RemoveWakeOnPacketConnection(
-      const std::string& in_ip_endpoint,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void RemoveWakeOnPacketConnectionAsync(
-      const std::string& in_ip_endpoint,
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual bool RemoveAllWakeOnPacketConnections(
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void RemoveAllWakeOnPacketConnectionsAsync(
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual bool GetProperties(
-      chromeos::VariantDictionary* out_1,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void GetPropertiesAsync(
-      const base::Callback<void(const chromeos::VariantDictionary&)>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual bool SetProperty(
-      const std::string& in_1,
-      const chromeos::Any& in_2,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void SetPropertyAsync(
-      const std::string& in_1,
-      const chromeos::Any& in_2,
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual bool ClearProperty(
-      const std::string& in_1,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void ClearPropertyAsync(
-      const std::string& in_1,
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual bool Enable(
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void EnableAsync(
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual bool Disable(
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void DisableAsync(
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual bool ProposeScan(
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void ProposeScanAsync(
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual bool AddIPConfig(
-      const std::string& in_1,
-      dbus::ObjectPath* out_2,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void AddIPConfigAsync(
-      const std::string& in_1,
-      const base::Callback<void(const dbus::ObjectPath&)>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual bool Register(
-      const std::string& in_1,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void RegisterAsync(
-      const std::string& in_1,
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual bool RequirePin(
-      const std::string& in_1,
-      bool in_2,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void RequirePinAsync(
-      const std::string& in_1,
-      bool in_2,
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual bool EnterPin(
-      const std::string& in_1,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void EnterPinAsync(
-      const std::string& in_1,
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual bool UnblockPin(
-      const std::string& in_1,
-      const std::string& in_2,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void UnblockPinAsync(
-      const std::string& in_1,
-      const std::string& in_2,
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual bool ChangePin(
-      const std::string& in_1,
-      const std::string& in_2,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void ChangePinAsync(
-      const std::string& in_1,
-      const std::string& in_2,
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual bool PerformTDLSOperation(
-      const std::string& in_1,
-      const std::string& in_2,
-      std::string* out_3,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void PerformTDLSOperationAsync(
-      const std::string& in_1,
-      const std::string& in_2,
-      const base::Callback<void(const std::string&)>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual bool Reset(
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void ResetAsync(
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual bool ResetByteCounters(
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void ResetByteCountersAsync(
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual bool SetCarrier(
-      const std::string& in_1,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void SetCarrierAsync(
-      const std::string& in_1,
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual bool RequestRoam(
-      const std::string& in_1,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void RequestRoamAsync(
-      const std::string& in_1,
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void RegisterPropertyChangedSignalHandler(
-      const base::Callback<void(const std::string&,
-                                const chromeos::Any&)>& signal_callback,
-      dbus::ObjectProxy::OnConnectedCallback on_connected_callback) = 0;
-};
-
-}  // namespace flimflam
-}  // namespace chromium
-}  // namespace org
-
-namespace org {
-namespace chromium {
-namespace flimflam {
-
-// Interface proxy for org::chromium::flimflam::Device.
-class DeviceProxy final : public DeviceProxyInterface {
- public:
-  DeviceProxy(
-      const scoped_refptr<dbus::Bus>& bus,
-      const dbus::ObjectPath& object_path) :
-          bus_{bus},
-          object_path_{object_path},
-          dbus_object_proxy_{
-              bus_->GetObjectProxy(service_name_, object_path_)} {
-  }
-
-  ~DeviceProxy() override {
-    bus_->RemoveObjectProxy(
-        service_name_, object_path_, base::Bind(&base::DoNothing));
-  }
-
-  void RegisterPropertyChangedSignalHandler(
-      const base::Callback<void(const std::string&,
-                                const chromeos::Any&)>& signal_callback,
-      dbus::ObjectProxy::OnConnectedCallback on_connected_callback) override {
-    chromeos::dbus_utils::ConnectToSignal(
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Device",
-        "PropertyChanged",
-        signal_callback,
-        on_connected_callback);
-  }
-
-  void ReleaseObjectProxy(const base::Closure& callback) {
-    bus_->RemoveObjectProxy(service_name_, object_path_, callback);
-  }
-
-  const dbus::ObjectPath& GetObjectPath() const {
-    return object_path_;
-  }
-
-  dbus::ObjectProxy* GetObjectProxy() const { return dbus_object_proxy_; }
-
-  bool AddWakeOnPacketConnection(
-      const std::string& in_ip_endpoint,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Device",
-        "AddWakeOnPacketConnection",
-        error,
-        in_ip_endpoint);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error);
-  }
-
-  void AddWakeOnPacketConnectionAsync(
-      const std::string& in_ip_endpoint,
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Device",
-        "AddWakeOnPacketConnection",
-        success_callback,
-        error_callback,
-        in_ip_endpoint);
-  }
-
-  bool RemoveWakeOnPacketConnection(
-      const std::string& in_ip_endpoint,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Device",
-        "RemoveWakeOnPacketConnection",
-        error,
-        in_ip_endpoint);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error);
-  }
-
-  void RemoveWakeOnPacketConnectionAsync(
-      const std::string& in_ip_endpoint,
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Device",
-        "RemoveWakeOnPacketConnection",
-        success_callback,
-        error_callback,
-        in_ip_endpoint);
-  }
-
-  bool RemoveAllWakeOnPacketConnections(
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Device",
-        "RemoveAllWakeOnPacketConnections",
-        error);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error);
-  }
-
-  void RemoveAllWakeOnPacketConnectionsAsync(
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Device",
-        "RemoveAllWakeOnPacketConnections",
-        success_callback,
-        error_callback);
-  }
-
-  bool GetProperties(
-      chromeos::VariantDictionary* out_1,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Device",
-        "GetProperties",
-        error);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error, out_1);
-  }
-
-  void GetPropertiesAsync(
-      const base::Callback<void(const chromeos::VariantDictionary&)>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Device",
-        "GetProperties",
-        success_callback,
-        error_callback);
-  }
-
-  bool SetProperty(
-      const std::string& in_1,
-      const chromeos::Any& in_2,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Device",
-        "SetProperty",
-        error,
-        in_1,
-        in_2);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error);
-  }
-
-  void SetPropertyAsync(
-      const std::string& in_1,
-      const chromeos::Any& in_2,
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Device",
-        "SetProperty",
-        success_callback,
-        error_callback,
-        in_1,
-        in_2);
-  }
-
-  bool ClearProperty(
-      const std::string& in_1,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Device",
-        "ClearProperty",
-        error,
-        in_1);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error);
-  }
-
-  void ClearPropertyAsync(
-      const std::string& in_1,
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Device",
-        "ClearProperty",
-        success_callback,
-        error_callback,
-        in_1);
-  }
-
-  bool Enable(
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Device",
-        "Enable",
-        error);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error);
-  }
-
-  void EnableAsync(
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Device",
-        "Enable",
-        success_callback,
-        error_callback);
-  }
-
-  bool Disable(
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Device",
-        "Disable",
-        error);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error);
-  }
-
-  void DisableAsync(
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Device",
-        "Disable",
-        success_callback,
-        error_callback);
-  }
-
-  bool ProposeScan(
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Device",
-        "ProposeScan",
-        error);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error);
-  }
-
-  void ProposeScanAsync(
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Device",
-        "ProposeScan",
-        success_callback,
-        error_callback);
-  }
-
-  bool AddIPConfig(
-      const std::string& in_1,
-      dbus::ObjectPath* out_2,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Device",
-        "AddIPConfig",
-        error,
-        in_1);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error, out_2);
-  }
-
-  void AddIPConfigAsync(
-      const std::string& in_1,
-      const base::Callback<void(const dbus::ObjectPath&)>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Device",
-        "AddIPConfig",
-        success_callback,
-        error_callback,
-        in_1);
-  }
-
-  bool Register(
-      const std::string& in_1,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Device",
-        "Register",
-        error,
-        in_1);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error);
-  }
-
-  void RegisterAsync(
-      const std::string& in_1,
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Device",
-        "Register",
-        success_callback,
-        error_callback,
-        in_1);
-  }
-
-  bool RequirePin(
-      const std::string& in_1,
-      bool in_2,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Device",
-        "RequirePin",
-        error,
-        in_1,
-        in_2);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error);
-  }
-
-  void RequirePinAsync(
-      const std::string& in_1,
-      bool in_2,
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Device",
-        "RequirePin",
-        success_callback,
-        error_callback,
-        in_1,
-        in_2);
-  }
-
-  bool EnterPin(
-      const std::string& in_1,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Device",
-        "EnterPin",
-        error,
-        in_1);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error);
-  }
-
-  void EnterPinAsync(
-      const std::string& in_1,
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Device",
-        "EnterPin",
-        success_callback,
-        error_callback,
-        in_1);
-  }
-
-  bool UnblockPin(
-      const std::string& in_1,
-      const std::string& in_2,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Device",
-        "UnblockPin",
-        error,
-        in_1,
-        in_2);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error);
-  }
-
-  void UnblockPinAsync(
-      const std::string& in_1,
-      const std::string& in_2,
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Device",
-        "UnblockPin",
-        success_callback,
-        error_callback,
-        in_1,
-        in_2);
-  }
-
-  bool ChangePin(
-      const std::string& in_1,
-      const std::string& in_2,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Device",
-        "ChangePin",
-        error,
-        in_1,
-        in_2);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error);
-  }
-
-  void ChangePinAsync(
-      const std::string& in_1,
-      const std::string& in_2,
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Device",
-        "ChangePin",
-        success_callback,
-        error_callback,
-        in_1,
-        in_2);
-  }
-
-  bool PerformTDLSOperation(
-      const std::string& in_1,
-      const std::string& in_2,
-      std::string* out_3,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Device",
-        "PerformTDLSOperation",
-        error,
-        in_1,
-        in_2);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error, out_3);
-  }
-
-  void PerformTDLSOperationAsync(
-      const std::string& in_1,
-      const std::string& in_2,
-      const base::Callback<void(const std::string&)>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Device",
-        "PerformTDLSOperation",
-        success_callback,
-        error_callback,
-        in_1,
-        in_2);
-  }
-
-  bool Reset(
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Device",
-        "Reset",
-        error);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error);
-  }
-
-  void ResetAsync(
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Device",
-        "Reset",
-        success_callback,
-        error_callback);
-  }
-
-  bool ResetByteCounters(
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Device",
-        "ResetByteCounters",
-        error);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error);
-  }
-
-  void ResetByteCountersAsync(
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Device",
-        "ResetByteCounters",
-        success_callback,
-        error_callback);
-  }
-
-  bool SetCarrier(
-      const std::string& in_1,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Device",
-        "SetCarrier",
-        error,
-        in_1);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error);
-  }
-
-  void SetCarrierAsync(
-      const std::string& in_1,
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Device",
-        "SetCarrier",
-        success_callback,
-        error_callback,
-        in_1);
-  }
-
-  bool RequestRoam(
-      const std::string& in_1,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Device",
-        "RequestRoam",
-        error,
-        in_1);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error);
-  }
-
-  void RequestRoamAsync(
-      const std::string& in_1,
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Device",
-        "RequestRoam",
-        success_callback,
-        error_callback,
-        in_1);
-  }
-
- private:
-  scoped_refptr<dbus::Bus> bus_;
-  const std::string service_name_{"org.chromium.flimflam"};
-  dbus::ObjectPath object_path_;
-  dbus::ObjectProxy* dbus_object_proxy_;
-
-  DISALLOW_COPY_AND_ASSIGN(DeviceProxy);
-};
-
-}  // namespace flimflam
-}  // namespace chromium
-}  // namespace org
-
-namespace org {
-namespace chromium {
-namespace flimflam {
-
-// Abstract interface proxy for org::chromium::flimflam::IPConfig.
-class IPConfigProxyInterface {
- public:
-  virtual ~IPConfigProxyInterface() = default;
-
-  virtual bool GetProperties(
-      chromeos::VariantDictionary* out_1,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void GetPropertiesAsync(
-      const base::Callback<void(const chromeos::VariantDictionary&)>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual bool SetProperty(
-      const std::string& in_1,
-      const chromeos::Any& in_2,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void SetPropertyAsync(
-      const std::string& in_1,
-      const chromeos::Any& in_2,
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual bool ClearProperty(
-      const std::string& in_1,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void ClearPropertyAsync(
-      const std::string& in_1,
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual bool Remove(
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void RemoveAsync(
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual bool Refresh(
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void RefreshAsync(
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void RegisterPropertyChangedSignalHandler(
-      const base::Callback<void(const std::string&,
-                                const chromeos::Any&)>& signal_callback,
-      dbus::ObjectProxy::OnConnectedCallback on_connected_callback) = 0;
-};
-
-}  // namespace flimflam
-}  // namespace chromium
-}  // namespace org
-
-namespace org {
-namespace chromium {
-namespace flimflam {
-
-// Interface proxy for org::chromium::flimflam::IPConfig.
-class IPConfigProxy final : public IPConfigProxyInterface {
- public:
-  IPConfigProxy(
-      const scoped_refptr<dbus::Bus>& bus,
-      const dbus::ObjectPath& object_path) :
-          bus_{bus},
-          object_path_{object_path},
-          dbus_object_proxy_{
-              bus_->GetObjectProxy(service_name_, object_path_)} {
-  }
-
-  ~IPConfigProxy() override {
-    bus_->RemoveObjectProxy(
-        service_name_, object_path_, base::Bind(&base::DoNothing));
-  }
-
-  void RegisterPropertyChangedSignalHandler(
-      const base::Callback<void(const std::string&,
-                                const chromeos::Any&)>& signal_callback,
-      dbus::ObjectProxy::OnConnectedCallback on_connected_callback) override {
-    chromeos::dbus_utils::ConnectToSignal(
-        dbus_object_proxy_,
-        "org.chromium.flimflam.IPConfig",
-        "PropertyChanged",
-        signal_callback,
-        on_connected_callback);
-  }
-
-  void ReleaseObjectProxy(const base::Closure& callback) {
-    bus_->RemoveObjectProxy(service_name_, object_path_, callback);
-  }
-
-  const dbus::ObjectPath& GetObjectPath() const {
-    return object_path_;
-  }
-
-  dbus::ObjectProxy* GetObjectProxy() const { return dbus_object_proxy_; }
-
-  bool GetProperties(
-      chromeos::VariantDictionary* out_1,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.IPConfig",
-        "GetProperties",
-        error);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error, out_1);
-  }
-
-  void GetPropertiesAsync(
-      const base::Callback<void(const chromeos::VariantDictionary&)>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.IPConfig",
-        "GetProperties",
-        success_callback,
-        error_callback);
-  }
-
-  bool SetProperty(
-      const std::string& in_1,
-      const chromeos::Any& in_2,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.IPConfig",
-        "SetProperty",
-        error,
-        in_1,
-        in_2);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error);
-  }
-
-  void SetPropertyAsync(
-      const std::string& in_1,
-      const chromeos::Any& in_2,
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.IPConfig",
-        "SetProperty",
-        success_callback,
-        error_callback,
-        in_1,
-        in_2);
-  }
-
-  bool ClearProperty(
-      const std::string& in_1,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.IPConfig",
-        "ClearProperty",
-        error,
-        in_1);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error);
-  }
-
-  void ClearPropertyAsync(
-      const std::string& in_1,
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.IPConfig",
-        "ClearProperty",
-        success_callback,
-        error_callback,
-        in_1);
-  }
-
-  bool Remove(
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.IPConfig",
-        "Remove",
-        error);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error);
-  }
-
-  void RemoveAsync(
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.IPConfig",
-        "Remove",
-        success_callback,
-        error_callback);
-  }
-
-  bool Refresh(
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.IPConfig",
-        "Refresh",
-        error);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error);
-  }
-
-  void RefreshAsync(
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.IPConfig",
-        "Refresh",
-        success_callback,
-        error_callback);
-  }
-
- private:
-  scoped_refptr<dbus::Bus> bus_;
-  const std::string service_name_{"org.chromium.flimflam"};
-  dbus::ObjectPath object_path_;
-  dbus::ObjectProxy* dbus_object_proxy_;
-
-  DISALLOW_COPY_AND_ASSIGN(IPConfigProxy);
-};
-
-}  // namespace flimflam
-}  // namespace chromium
-}  // namespace org
-
-namespace org {
-namespace chromium {
-namespace flimflam {
-
-// Abstract interface proxy for org::chromium::flimflam::Manager.
-class ManagerProxyInterface {
- public:
-  virtual ~ManagerProxyInterface() = default;
-
-  virtual bool GetProperties(
-      chromeos::VariantDictionary* out_1,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void GetPropertiesAsync(
-      const base::Callback<void(const chromeos::VariantDictionary&)>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual bool SetProperty(
-      const std::string& in_1,
-      const chromeos::Any& in_2,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void SetPropertyAsync(
-      const std::string& in_1,
-      const chromeos::Any& in_2,
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual bool GetState(
-      std::string* out_1,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void GetStateAsync(
-      const base::Callback<void(const std::string&)>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual bool CreateProfile(
-      const std::string& in_1,
-      dbus::ObjectPath* out_2,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void CreateProfileAsync(
-      const std::string& in_1,
-      const base::Callback<void(const dbus::ObjectPath&)>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual bool RemoveProfile(
-      const std::string& in_1,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void RemoveProfileAsync(
-      const std::string& in_1,
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual bool PushProfile(
-      const std::string& in_1,
-      dbus::ObjectPath* out_2,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void PushProfileAsync(
-      const std::string& in_1,
-      const base::Callback<void(const dbus::ObjectPath&)>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual bool InsertUserProfile(
-      const std::string& in_1,
-      const std::string& in_2,
-      dbus::ObjectPath* out_3,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void InsertUserProfileAsync(
-      const std::string& in_1,
-      const std::string& in_2,
-      const base::Callback<void(const dbus::ObjectPath&)>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual bool PopProfile(
-      const std::string& in_1,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void PopProfileAsync(
-      const std::string& in_1,
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual bool PopAnyProfile(
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void PopAnyProfileAsync(
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual bool PopAllUserProfiles(
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void PopAllUserProfilesAsync(
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual bool RecheckPortal(
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void RecheckPortalAsync(
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual bool RequestScan(
-      const std::string& in_1,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void RequestScanAsync(
-      const std::string& in_1,
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual bool EnableTechnology(
-      const std::string& in_1,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void EnableTechnologyAsync(
-      const std::string& in_1,
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual bool DisableTechnology(
-      const std::string& in_1,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void DisableTechnologyAsync(
-      const std::string& in_1,
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual bool GetService(
-      const chromeos::VariantDictionary& in_1,
-      dbus::ObjectPath* out_2,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void GetServiceAsync(
-      const chromeos::VariantDictionary& in_1,
-      const base::Callback<void(const dbus::ObjectPath&)>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual bool GetWifiService(
-      const chromeos::VariantDictionary& in_1,
-      dbus::ObjectPath* out_2,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void GetWifiServiceAsync(
-      const chromeos::VariantDictionary& in_1,
-      const base::Callback<void(const dbus::ObjectPath&)>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual bool ConfigureService(
-      const chromeos::VariantDictionary& in_1,
-      dbus::ObjectPath* out_2,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void ConfigureServiceAsync(
-      const chromeos::VariantDictionary& in_1,
-      const base::Callback<void(const dbus::ObjectPath&)>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual bool ConfigureServiceForProfile(
-      const dbus::ObjectPath& in_1,
-      const chromeos::VariantDictionary& in_2,
-      dbus::ObjectPath* out_3,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void ConfigureServiceForProfileAsync(
-      const dbus::ObjectPath& in_1,
-      const chromeos::VariantDictionary& in_2,
-      const base::Callback<void(const dbus::ObjectPath&)>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual bool FindMatchingService(
-      const chromeos::VariantDictionary& in_1,
-      dbus::ObjectPath* out_2,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void FindMatchingServiceAsync(
-      const chromeos::VariantDictionary& in_1,
-      const base::Callback<void(const dbus::ObjectPath&)>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual bool GetVPNService(
-      const chromeos::VariantDictionary& in_1,
-      dbus::ObjectPath* out_2,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void GetVPNServiceAsync(
-      const chromeos::VariantDictionary& in_1,
-      const base::Callback<void(const dbus::ObjectPath&)>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual bool GetDebugLevel(
-      int32_t* out_1,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void GetDebugLevelAsync(
-      const base::Callback<void(int32_t)>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual bool SetDebugLevel(
-      int32_t in_1,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void SetDebugLevelAsync(
-      int32_t in_1,
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual bool GetServiceOrder(
-      std::string* out_1,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void GetServiceOrderAsync(
-      const base::Callback<void(const std::string&)>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual bool SetServiceOrder(
-      const std::string& in_1,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void SetServiceOrderAsync(
-      const std::string& in_1,
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual bool GetDebugTags(
-      std::string* out_1,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void GetDebugTagsAsync(
-      const base::Callback<void(const std::string&)>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual bool SetDebugTags(
-      const std::string& in_1,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void SetDebugTagsAsync(
-      const std::string& in_1,
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual bool ListDebugTags(
-      std::string* out_1,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void ListDebugTagsAsync(
-      const base::Callback<void(const std::string&)>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual bool GetNetworksForGeolocation(
-      chromeos::VariantDictionary* out_1,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void GetNetworksForGeolocationAsync(
-      const base::Callback<void(const chromeos::VariantDictionary&)>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual bool VerifyDestination(
-      const std::string& in_certificate,
-      const std::string& in_public_key,
-      const std::string& in_nonce,
-      const std::string& in_signed_data,
-      const std::string& in_destination_udn,
-      const std::string& in_hotspot_ssid,
-      const std::string& in_hotspot_bssid,
-      bool* out_8,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void VerifyDestinationAsync(
-      const std::string& in_certificate,
-      const std::string& in_public_key,
-      const std::string& in_nonce,
-      const std::string& in_signed_data,
-      const std::string& in_destination_udn,
-      const std::string& in_hotspot_ssid,
-      const std::string& in_hotspot_bssid,
-      const base::Callback<void(bool)>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual bool VerifyAndEncryptCredentials(
-      const std::string& in_certificate,
-      const std::string& in_public_key,
-      const std::string& in_nonce,
-      const std::string& in_signed_data,
-      const std::string& in_destination_udn,
-      const std::string& in_hotspot_ssid,
-      const std::string& in_hotspot_bssid,
-      const dbus::ObjectPath& in_network,
-      std::string* out_9,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void VerifyAndEncryptCredentialsAsync(
-      const std::string& in_certificate,
-      const std::string& in_public_key,
-      const std::string& in_nonce,
-      const std::string& in_signed_data,
-      const std::string& in_destination_udn,
-      const std::string& in_hotspot_ssid,
-      const std::string& in_hotspot_bssid,
-      const dbus::ObjectPath& in_network,
-      const base::Callback<void(const std::string&)>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual bool VerifyAndEncryptData(
-      const std::string& in_certificate,
-      const std::string& in_public_key,
-      const std::string& in_nonce,
-      const std::string& in_signed_data,
-      const std::string& in_destination_udn,
-      const std::string& in_hotspot_ssid,
-      const std::string& in_hotspot_bssid,
-      const std::string& in_data,
-      std::string* out_9,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void VerifyAndEncryptDataAsync(
-      const std::string& in_certificate,
-      const std::string& in_public_key,
-      const std::string& in_nonce,
-      const std::string& in_signed_data,
-      const std::string& in_destination_udn,
-      const std::string& in_hotspot_ssid,
-      const std::string& in_hotspot_bssid,
-      const std::string& in_data,
-      const base::Callback<void(const std::string&)>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual bool ConnectToBestServices(
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void ConnectToBestServicesAsync(
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual bool CreateConnectivityReport(
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void CreateConnectivityReportAsync(
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual bool ClaimInterface(
-      const std::string& in_claimer_name,
-      const std::string& in_interface_name,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void ClaimInterfaceAsync(
-      const std::string& in_claimer_name,
-      const std::string& in_interface_name,
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual bool ReleaseInterface(
-      const std::string& in_claimer_name,
-      const std::string& in_interface_name,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void ReleaseInterfaceAsync(
-      const std::string& in_claimer_name,
-      const std::string& in_interface_name,
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual bool SetSchedScan(
-      bool in_1,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void SetSchedScanAsync(
-      bool in_1,
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void RegisterPropertyChangedSignalHandler(
-      const base::Callback<void(const std::string&,
-                                const chromeos::Any&)>& signal_callback,
-      dbus::ObjectProxy::OnConnectedCallback on_connected_callback) = 0;
-
-  virtual void RegisterStateChangedSignalHandler(
-      const base::Callback<void(const std::string&)>& signal_callback,
-      dbus::ObjectProxy::OnConnectedCallback on_connected_callback) = 0;
-};
-
-}  // namespace flimflam
-}  // namespace chromium
-}  // namespace org
-
-namespace org {
-namespace chromium {
-namespace flimflam {
-
-// Interface proxy for org::chromium::flimflam::Manager.
-class ManagerProxy final : public ManagerProxyInterface {
- public:
-  ManagerProxy(const scoped_refptr<dbus::Bus>& bus) :
-      bus_{bus},
-      dbus_object_proxy_{
-          bus_->GetObjectProxy(service_name_, object_path_)} {
-  }
-
-  ~ManagerProxy() override {
-    bus_->RemoveObjectProxy(
-        service_name_, object_path_, base::Bind(&base::DoNothing));
-  }
-
-  void RegisterPropertyChangedSignalHandler(
-      const base::Callback<void(const std::string&,
-                                const chromeos::Any&)>& signal_callback,
-      dbus::ObjectProxy::OnConnectedCallback on_connected_callback) override {
-    chromeos::dbus_utils::ConnectToSignal(
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Manager",
-        "PropertyChanged",
-        signal_callback,
-        on_connected_callback);
-  }
-
-  void RegisterStateChangedSignalHandler(
-      const base::Callback<void(const std::string&)>& signal_callback,
-      dbus::ObjectProxy::OnConnectedCallback on_connected_callback) override {
-    chromeos::dbus_utils::ConnectToSignal(
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Manager",
-        "StateChanged",
-        signal_callback,
-        on_connected_callback);
-  }
-
-  void ReleaseObjectProxy(const base::Closure& callback) {
-    bus_->RemoveObjectProxy(service_name_, object_path_, callback);
-  }
-
-  const dbus::ObjectPath& GetObjectPath() const {
-    return object_path_;
-  }
-
-  dbus::ObjectProxy* GetObjectProxy() const { return dbus_object_proxy_; }
-
-  bool GetProperties(
-      chromeos::VariantDictionary* out_1,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Manager",
-        "GetProperties",
-        error);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error, out_1);
-  }
-
-  void GetPropertiesAsync(
-      const base::Callback<void(const chromeos::VariantDictionary&)>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Manager",
-        "GetProperties",
-        success_callback,
-        error_callback);
-  }
-
-  bool SetProperty(
-      const std::string& in_1,
-      const chromeos::Any& in_2,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Manager",
-        "SetProperty",
-        error,
-        in_1,
-        in_2);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error);
-  }
-
-  void SetPropertyAsync(
-      const std::string& in_1,
-      const chromeos::Any& in_2,
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Manager",
-        "SetProperty",
-        success_callback,
-        error_callback,
-        in_1,
-        in_2);
-  }
-
-  bool GetState(
-      std::string* out_1,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Manager",
-        "GetState",
-        error);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error, out_1);
-  }
-
-  void GetStateAsync(
-      const base::Callback<void(const std::string&)>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Manager",
-        "GetState",
-        success_callback,
-        error_callback);
-  }
-
-  bool CreateProfile(
-      const std::string& in_1,
-      dbus::ObjectPath* out_2,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Manager",
-        "CreateProfile",
-        error,
-        in_1);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error, out_2);
-  }
-
-  void CreateProfileAsync(
-      const std::string& in_1,
-      const base::Callback<void(const dbus::ObjectPath&)>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Manager",
-        "CreateProfile",
-        success_callback,
-        error_callback,
-        in_1);
-  }
-
-  bool RemoveProfile(
-      const std::string& in_1,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Manager",
-        "RemoveProfile",
-        error,
-        in_1);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error);
-  }
-
-  void RemoveProfileAsync(
-      const std::string& in_1,
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Manager",
-        "RemoveProfile",
-        success_callback,
-        error_callback,
-        in_1);
-  }
-
-  bool PushProfile(
-      const std::string& in_1,
-      dbus::ObjectPath* out_2,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Manager",
-        "PushProfile",
-        error,
-        in_1);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error, out_2);
-  }
-
-  void PushProfileAsync(
-      const std::string& in_1,
-      const base::Callback<void(const dbus::ObjectPath&)>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Manager",
-        "PushProfile",
-        success_callback,
-        error_callback,
-        in_1);
-  }
-
-  bool InsertUserProfile(
-      const std::string& in_1,
-      const std::string& in_2,
-      dbus::ObjectPath* out_3,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Manager",
-        "InsertUserProfile",
-        error,
-        in_1,
-        in_2);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error, out_3);
-  }
-
-  void InsertUserProfileAsync(
-      const std::string& in_1,
-      const std::string& in_2,
-      const base::Callback<void(const dbus::ObjectPath&)>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Manager",
-        "InsertUserProfile",
-        success_callback,
-        error_callback,
-        in_1,
-        in_2);
-  }
-
-  bool PopProfile(
-      const std::string& in_1,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Manager",
-        "PopProfile",
-        error,
-        in_1);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error);
-  }
-
-  void PopProfileAsync(
-      const std::string& in_1,
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Manager",
-        "PopProfile",
-        success_callback,
-        error_callback,
-        in_1);
-  }
-
-  bool PopAnyProfile(
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Manager",
-        "PopAnyProfile",
-        error);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error);
-  }
-
-  void PopAnyProfileAsync(
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Manager",
-        "PopAnyProfile",
-        success_callback,
-        error_callback);
-  }
-
-  bool PopAllUserProfiles(
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Manager",
-        "PopAllUserProfiles",
-        error);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error);
-  }
-
-  void PopAllUserProfilesAsync(
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Manager",
-        "PopAllUserProfiles",
-        success_callback,
-        error_callback);
-  }
-
-  bool RecheckPortal(
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Manager",
-        "RecheckPortal",
-        error);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error);
-  }
-
-  void RecheckPortalAsync(
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Manager",
-        "RecheckPortal",
-        success_callback,
-        error_callback);
-  }
-
-  bool RequestScan(
-      const std::string& in_1,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Manager",
-        "RequestScan",
-        error,
-        in_1);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error);
-  }
-
-  void RequestScanAsync(
-      const std::string& in_1,
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Manager",
-        "RequestScan",
-        success_callback,
-        error_callback,
-        in_1);
-  }
-
-  bool EnableTechnology(
-      const std::string& in_1,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Manager",
-        "EnableTechnology",
-        error,
-        in_1);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error);
-  }
-
-  void EnableTechnologyAsync(
-      const std::string& in_1,
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Manager",
-        "EnableTechnology",
-        success_callback,
-        error_callback,
-        in_1);
-  }
-
-  bool DisableTechnology(
-      const std::string& in_1,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Manager",
-        "DisableTechnology",
-        error,
-        in_1);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error);
-  }
-
-  void DisableTechnologyAsync(
-      const std::string& in_1,
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Manager",
-        "DisableTechnology",
-        success_callback,
-        error_callback,
-        in_1);
-  }
-
-  bool GetService(
-      const chromeos::VariantDictionary& in_1,
-      dbus::ObjectPath* out_2,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Manager",
-        "GetService",
-        error,
-        in_1);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error, out_2);
-  }
-
-  void GetServiceAsync(
-      const chromeos::VariantDictionary& in_1,
-      const base::Callback<void(const dbus::ObjectPath&)>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Manager",
-        "GetService",
-        success_callback,
-        error_callback,
-        in_1);
-  }
-
-  bool GetWifiService(
-      const chromeos::VariantDictionary& in_1,
-      dbus::ObjectPath* out_2,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Manager",
-        "GetWifiService",
-        error,
-        in_1);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error, out_2);
-  }
-
-  void GetWifiServiceAsync(
-      const chromeos::VariantDictionary& in_1,
-      const base::Callback<void(const dbus::ObjectPath&)>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Manager",
-        "GetWifiService",
-        success_callback,
-        error_callback,
-        in_1);
-  }
-
-  bool ConfigureService(
-      const chromeos::VariantDictionary& in_1,
-      dbus::ObjectPath* out_2,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Manager",
-        "ConfigureService",
-        error,
-        in_1);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error, out_2);
-  }
-
-  void ConfigureServiceAsync(
-      const chromeos::VariantDictionary& in_1,
-      const base::Callback<void(const dbus::ObjectPath&)>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Manager",
-        "ConfigureService",
-        success_callback,
-        error_callback,
-        in_1);
-  }
-
-  bool ConfigureServiceForProfile(
-      const dbus::ObjectPath& in_1,
-      const chromeos::VariantDictionary& in_2,
-      dbus::ObjectPath* out_3,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Manager",
-        "ConfigureServiceForProfile",
-        error,
-        in_1,
-        in_2);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error, out_3);
-  }
-
-  void ConfigureServiceForProfileAsync(
-      const dbus::ObjectPath& in_1,
-      const chromeos::VariantDictionary& in_2,
-      const base::Callback<void(const dbus::ObjectPath&)>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Manager",
-        "ConfigureServiceForProfile",
-        success_callback,
-        error_callback,
-        in_1,
-        in_2);
-  }
-
-  bool FindMatchingService(
-      const chromeos::VariantDictionary& in_1,
-      dbus::ObjectPath* out_2,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Manager",
-        "FindMatchingService",
-        error,
-        in_1);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error, out_2);
-  }
-
-  void FindMatchingServiceAsync(
-      const chromeos::VariantDictionary& in_1,
-      const base::Callback<void(const dbus::ObjectPath&)>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Manager",
-        "FindMatchingService",
-        success_callback,
-        error_callback,
-        in_1);
-  }
-
-  bool GetVPNService(
-      const chromeos::VariantDictionary& in_1,
-      dbus::ObjectPath* out_2,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Manager",
-        "GetVPNService",
-        error,
-        in_1);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error, out_2);
-  }
-
-  void GetVPNServiceAsync(
-      const chromeos::VariantDictionary& in_1,
-      const base::Callback<void(const dbus::ObjectPath&)>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Manager",
-        "GetVPNService",
-        success_callback,
-        error_callback,
-        in_1);
-  }
-
-  bool GetDebugLevel(
-      int32_t* out_1,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Manager",
-        "GetDebugLevel",
-        error);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error, out_1);
-  }
-
-  void GetDebugLevelAsync(
-      const base::Callback<void(int32_t)>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Manager",
-        "GetDebugLevel",
-        success_callback,
-        error_callback);
-  }
-
-  bool SetDebugLevel(
-      int32_t in_1,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Manager",
-        "SetDebugLevel",
-        error,
-        in_1);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error);
-  }
-
-  void SetDebugLevelAsync(
-      int32_t in_1,
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Manager",
-        "SetDebugLevel",
-        success_callback,
-        error_callback,
-        in_1);
-  }
-
-  bool GetServiceOrder(
-      std::string* out_1,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Manager",
-        "GetServiceOrder",
-        error);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error, out_1);
-  }
-
-  void GetServiceOrderAsync(
-      const base::Callback<void(const std::string&)>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Manager",
-        "GetServiceOrder",
-        success_callback,
-        error_callback);
-  }
-
-  bool SetServiceOrder(
-      const std::string& in_1,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Manager",
-        "SetServiceOrder",
-        error,
-        in_1);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error);
-  }
-
-  void SetServiceOrderAsync(
-      const std::string& in_1,
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Manager",
-        "SetServiceOrder",
-        success_callback,
-        error_callback,
-        in_1);
-  }
-
-  bool GetDebugTags(
-      std::string* out_1,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Manager",
-        "GetDebugTags",
-        error);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error, out_1);
-  }
-
-  void GetDebugTagsAsync(
-      const base::Callback<void(const std::string&)>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Manager",
-        "GetDebugTags",
-        success_callback,
-        error_callback);
-  }
-
-  bool SetDebugTags(
-      const std::string& in_1,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Manager",
-        "SetDebugTags",
-        error,
-        in_1);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error);
-  }
-
-  void SetDebugTagsAsync(
-      const std::string& in_1,
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Manager",
-        "SetDebugTags",
-        success_callback,
-        error_callback,
-        in_1);
-  }
-
-  bool ListDebugTags(
-      std::string* out_1,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Manager",
-        "ListDebugTags",
-        error);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error, out_1);
-  }
-
-  void ListDebugTagsAsync(
-      const base::Callback<void(const std::string&)>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Manager",
-        "ListDebugTags",
-        success_callback,
-        error_callback);
-  }
-
-  bool GetNetworksForGeolocation(
-      chromeos::VariantDictionary* out_1,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Manager",
-        "GetNetworksForGeolocation",
-        error);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error, out_1);
-  }
-
-  void GetNetworksForGeolocationAsync(
-      const base::Callback<void(const chromeos::VariantDictionary&)>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Manager",
-        "GetNetworksForGeolocation",
-        success_callback,
-        error_callback);
-  }
-
-  bool VerifyDestination(
-      const std::string& in_certificate,
-      const std::string& in_public_key,
-      const std::string& in_nonce,
-      const std::string& in_signed_data,
-      const std::string& in_destination_udn,
-      const std::string& in_hotspot_ssid,
-      const std::string& in_hotspot_bssid,
-      bool* out_8,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Manager",
-        "VerifyDestination",
-        error,
-        in_certificate,
-        in_public_key,
-        in_nonce,
-        in_signed_data,
-        in_destination_udn,
-        in_hotspot_ssid,
-        in_hotspot_bssid);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error, out_8);
-  }
-
-  void VerifyDestinationAsync(
-      const std::string& in_certificate,
-      const std::string& in_public_key,
-      const std::string& in_nonce,
-      const std::string& in_signed_data,
-      const std::string& in_destination_udn,
-      const std::string& in_hotspot_ssid,
-      const std::string& in_hotspot_bssid,
-      const base::Callback<void(bool)>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Manager",
-        "VerifyDestination",
-        success_callback,
-        error_callback,
-        in_certificate,
-        in_public_key,
-        in_nonce,
-        in_signed_data,
-        in_destination_udn,
-        in_hotspot_ssid,
-        in_hotspot_bssid);
-  }
-
-  bool VerifyAndEncryptCredentials(
-      const std::string& in_certificate,
-      const std::string& in_public_key,
-      const std::string& in_nonce,
-      const std::string& in_signed_data,
-      const std::string& in_destination_udn,
-      const std::string& in_hotspot_ssid,
-      const std::string& in_hotspot_bssid,
-      const dbus::ObjectPath& in_network,
-      std::string* out_9,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Manager",
-        "VerifyAndEncryptCredentials",
-        error,
-        in_certificate,
-        in_public_key,
-        in_nonce,
-        in_signed_data,
-        in_destination_udn,
-        in_hotspot_ssid,
-        in_hotspot_bssid,
-        in_network);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error, out_9);
-  }
-
-  void VerifyAndEncryptCredentialsAsync(
-      const std::string& in_certificate,
-      const std::string& in_public_key,
-      const std::string& in_nonce,
-      const std::string& in_signed_data,
-      const std::string& in_destination_udn,
-      const std::string& in_hotspot_ssid,
-      const std::string& in_hotspot_bssid,
-      const dbus::ObjectPath& in_network,
-      const base::Callback<void(const std::string&)>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Manager",
-        "VerifyAndEncryptCredentials",
-        success_callback,
-        error_callback,
-        in_certificate,
-        in_public_key,
-        in_nonce,
-        in_signed_data,
-        in_destination_udn,
-        in_hotspot_ssid,
-        in_hotspot_bssid,
-        in_network);
-  }
-
-  bool VerifyAndEncryptData(
-      const std::string& in_certificate,
-      const std::string& in_public_key,
-      const std::string& in_nonce,
-      const std::string& in_signed_data,
-      const std::string& in_destination_udn,
-      const std::string& in_hotspot_ssid,
-      const std::string& in_hotspot_bssid,
-      const std::string& in_data,
-      std::string* out_9,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Manager",
-        "VerifyAndEncryptData",
-        error,
-        in_certificate,
-        in_public_key,
-        in_nonce,
-        in_signed_data,
-        in_destination_udn,
-        in_hotspot_ssid,
-        in_hotspot_bssid,
-        in_data);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error, out_9);
-  }
-
-  void VerifyAndEncryptDataAsync(
-      const std::string& in_certificate,
-      const std::string& in_public_key,
-      const std::string& in_nonce,
-      const std::string& in_signed_data,
-      const std::string& in_destination_udn,
-      const std::string& in_hotspot_ssid,
-      const std::string& in_hotspot_bssid,
-      const std::string& in_data,
-      const base::Callback<void(const std::string&)>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Manager",
-        "VerifyAndEncryptData",
-        success_callback,
-        error_callback,
-        in_certificate,
-        in_public_key,
-        in_nonce,
-        in_signed_data,
-        in_destination_udn,
-        in_hotspot_ssid,
-        in_hotspot_bssid,
-        in_data);
-  }
-
-  bool ConnectToBestServices(
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Manager",
-        "ConnectToBestServices",
-        error);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error);
-  }
-
-  void ConnectToBestServicesAsync(
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Manager",
-        "ConnectToBestServices",
-        success_callback,
-        error_callback);
-  }
-
-  bool CreateConnectivityReport(
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Manager",
-        "CreateConnectivityReport",
-        error);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error);
-  }
-
-  void CreateConnectivityReportAsync(
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Manager",
-        "CreateConnectivityReport",
-        success_callback,
-        error_callback);
-  }
-
-  bool ClaimInterface(
-      const std::string& in_claimer_name,
-      const std::string& in_interface_name,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Manager",
-        "ClaimInterface",
-        error,
-        in_claimer_name,
-        in_interface_name);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error);
-  }
-
-  void ClaimInterfaceAsync(
-      const std::string& in_claimer_name,
-      const std::string& in_interface_name,
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Manager",
-        "ClaimInterface",
-        success_callback,
-        error_callback,
-        in_claimer_name,
-        in_interface_name);
-  }
-
-  bool ReleaseInterface(
-      const std::string& in_claimer_name,
-      const std::string& in_interface_name,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Manager",
-        "ReleaseInterface",
-        error,
-        in_claimer_name,
-        in_interface_name);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error);
-  }
-
-  void ReleaseInterfaceAsync(
-      const std::string& in_claimer_name,
-      const std::string& in_interface_name,
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Manager",
-        "ReleaseInterface",
-        success_callback,
-        error_callback,
-        in_claimer_name,
-        in_interface_name);
-  }
-
-  bool SetSchedScan(
-      bool in_1,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Manager",
-        "SetSchedScan",
-        error,
-        in_1);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error);
-  }
-
-  void SetSchedScanAsync(
-      bool in_1,
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Manager",
-        "SetSchedScan",
-        success_callback,
-        error_callback,
-        in_1);
-  }
-
- private:
-  scoped_refptr<dbus::Bus> bus_;
-  const std::string service_name_{"org.chromium.flimflam"};
-  const dbus::ObjectPath object_path_{"/"};
-  dbus::ObjectProxy* dbus_object_proxy_;
-
-  DISALLOW_COPY_AND_ASSIGN(ManagerProxy);
-};
-
-}  // namespace flimflam
-}  // namespace chromium
-}  // namespace org
-
-namespace org {
-namespace chromium {
-namespace flimflam {
-
-// Abstract interface proxy for org::chromium::flimflam::Profile.
-class ProfileProxyInterface {
- public:
-  virtual ~ProfileProxyInterface() = default;
-
-  virtual bool GetProperties(
-      chromeos::VariantDictionary* out_1,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void GetPropertiesAsync(
-      const base::Callback<void(const chromeos::VariantDictionary&)>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual bool SetProperty(
-      const std::string& in_1,
-      const chromeos::Any& in_2,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void SetPropertyAsync(
-      const std::string& in_1,
-      const chromeos::Any& in_2,
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual bool GetEntry(
-      const std::string& in_1,
-      chromeos::VariantDictionary* out_2,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void GetEntryAsync(
-      const std::string& in_1,
-      const base::Callback<void(const chromeos::VariantDictionary&)>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual bool DeleteEntry(
-      const std::string& in_1,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void DeleteEntryAsync(
-      const std::string& in_1,
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void RegisterPropertyChangedSignalHandler(
-      const base::Callback<void(const std::string&,
-                                const chromeos::Any&)>& signal_callback,
-      dbus::ObjectProxy::OnConnectedCallback on_connected_callback) = 0;
-};
-
-}  // namespace flimflam
-}  // namespace chromium
-}  // namespace org
-
-namespace org {
-namespace chromium {
-namespace flimflam {
-
-// Interface proxy for org::chromium::flimflam::Profile.
-class ProfileProxy final : public ProfileProxyInterface {
- public:
-  ProfileProxy(
-      const scoped_refptr<dbus::Bus>& bus,
-      const dbus::ObjectPath& object_path) :
-          bus_{bus},
-          object_path_{object_path},
-          dbus_object_proxy_{
-              bus_->GetObjectProxy(service_name_, object_path_)} {
-  }
-
-  ~ProfileProxy() override {
-    bus_->RemoveObjectProxy(
-        service_name_, object_path_, base::Bind(&base::DoNothing));
-  }
-
-  void RegisterPropertyChangedSignalHandler(
-      const base::Callback<void(const std::string&,
-                                const chromeos::Any&)>& signal_callback,
-      dbus::ObjectProxy::OnConnectedCallback on_connected_callback) override {
-    chromeos::dbus_utils::ConnectToSignal(
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Profile",
-        "PropertyChanged",
-        signal_callback,
-        on_connected_callback);
-  }
-
-  void ReleaseObjectProxy(const base::Closure& callback) {
-    bus_->RemoveObjectProxy(service_name_, object_path_, callback);
-  }
-
-  const dbus::ObjectPath& GetObjectPath() const {
-    return object_path_;
-  }
-
-  dbus::ObjectProxy* GetObjectProxy() const { return dbus_object_proxy_; }
-
-  bool GetProperties(
-      chromeos::VariantDictionary* out_1,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Profile",
-        "GetProperties",
-        error);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error, out_1);
-  }
-
-  void GetPropertiesAsync(
-      const base::Callback<void(const chromeos::VariantDictionary&)>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Profile",
-        "GetProperties",
-        success_callback,
-        error_callback);
-  }
-
-  bool SetProperty(
-      const std::string& in_1,
-      const chromeos::Any& in_2,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Profile",
-        "SetProperty",
-        error,
-        in_1,
-        in_2);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error);
-  }
-
-  void SetPropertyAsync(
-      const std::string& in_1,
-      const chromeos::Any& in_2,
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Profile",
-        "SetProperty",
-        success_callback,
-        error_callback,
-        in_1,
-        in_2);
-  }
-
-  bool GetEntry(
-      const std::string& in_1,
-      chromeos::VariantDictionary* out_2,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Profile",
-        "GetEntry",
-        error,
-        in_1);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error, out_2);
-  }
-
-  void GetEntryAsync(
-      const std::string& in_1,
-      const base::Callback<void(const chromeos::VariantDictionary&)>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Profile",
-        "GetEntry",
-        success_callback,
-        error_callback,
-        in_1);
-  }
-
-  bool DeleteEntry(
-      const std::string& in_1,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Profile",
-        "DeleteEntry",
-        error,
-        in_1);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error);
-  }
-
-  void DeleteEntryAsync(
-      const std::string& in_1,
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Profile",
-        "DeleteEntry",
-        success_callback,
-        error_callback,
-        in_1);
-  }
-
- private:
-  scoped_refptr<dbus::Bus> bus_;
-  const std::string service_name_{"org.chromium.flimflam"};
-  dbus::ObjectPath object_path_;
-  dbus::ObjectProxy* dbus_object_proxy_;
-
-  DISALLOW_COPY_AND_ASSIGN(ProfileProxy);
-};
-
-}  // namespace flimflam
-}  // namespace chromium
-}  // namespace org
-
-namespace org {
-namespace chromium {
-namespace flimflam {
-
-// Abstract interface proxy for org::chromium::flimflam::Service.
-class ServiceProxyInterface {
- public:
-  virtual ~ServiceProxyInterface() = default;
-
-  virtual bool GetProperties(
-      chromeos::VariantDictionary* out_1,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void GetPropertiesAsync(
-      const base::Callback<void(const chromeos::VariantDictionary&)>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual bool SetProperty(
-      const std::string& in_1,
-      const chromeos::Any& in_2,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void SetPropertyAsync(
-      const std::string& in_1,
-      const chromeos::Any& in_2,
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual bool SetProperties(
-      const chromeos::VariantDictionary& in_1,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void SetPropertiesAsync(
-      const chromeos::VariantDictionary& in_1,
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual bool ClearProperty(
-      const std::string& in_1,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void ClearPropertyAsync(
-      const std::string& in_1,
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual bool ClearProperties(
-      const std::vector<std::string>& in_1,
-      std::vector<bool>* out_2,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void ClearPropertiesAsync(
-      const std::vector<std::string>& in_1,
-      const base::Callback<void(const std::vector<bool>&)>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual bool Connect(
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void ConnectAsync(
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual bool Disconnect(
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void DisconnectAsync(
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual bool Remove(
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void RemoveAsync(
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual bool ActivateCellularModem(
-      const std::string& in_1,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void ActivateCellularModemAsync(
-      const std::string& in_1,
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual bool CompleteCellularActivation(
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void CompleteCellularActivationAsync(
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual bool GetLoadableProfileEntries(
-      std::map<dbus::ObjectPath, std::string>* out_1,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void GetLoadableProfileEntriesAsync(
-      const base::Callback<void(const std::map<dbus::ObjectPath, std::string>&)>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void RegisterPropertyChangedSignalHandler(
-      const base::Callback<void(const std::string&,
-                                const chromeos::Any&)>& signal_callback,
-      dbus::ObjectProxy::OnConnectedCallback on_connected_callback) = 0;
-};
-
-}  // namespace flimflam
-}  // namespace chromium
-}  // namespace org
-
-namespace org {
-namespace chromium {
-namespace flimflam {
-
-// Interface proxy for org::chromium::flimflam::Service.
-class ServiceProxy final : public ServiceProxyInterface {
- public:
-  ServiceProxy(
-      const scoped_refptr<dbus::Bus>& bus,
-      const dbus::ObjectPath& object_path) :
-          bus_{bus},
-          object_path_{object_path},
-          dbus_object_proxy_{
-              bus_->GetObjectProxy(service_name_, object_path_)} {
-  }
-
-  ~ServiceProxy() override {
-    bus_->RemoveObjectProxy(
-        service_name_, object_path_, base::Bind(&base::DoNothing));
-  }
-
-  void RegisterPropertyChangedSignalHandler(
-      const base::Callback<void(const std::string&,
-                                const chromeos::Any&)>& signal_callback,
-      dbus::ObjectProxy::OnConnectedCallback on_connected_callback) override {
-    chromeos::dbus_utils::ConnectToSignal(
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Service",
-        "PropertyChanged",
-        signal_callback,
-        on_connected_callback);
-  }
-
-  void ReleaseObjectProxy(const base::Closure& callback) {
-    bus_->RemoveObjectProxy(service_name_, object_path_, callback);
-  }
-
-  const dbus::ObjectPath& GetObjectPath() const {
-    return object_path_;
-  }
-
-  dbus::ObjectProxy* GetObjectProxy() const { return dbus_object_proxy_; }
-
-  bool GetProperties(
-      chromeos::VariantDictionary* out_1,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Service",
-        "GetProperties",
-        error);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error, out_1);
-  }
-
-  void GetPropertiesAsync(
-      const base::Callback<void(const chromeos::VariantDictionary&)>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Service",
-        "GetProperties",
-        success_callback,
-        error_callback);
-  }
-
-  bool SetProperty(
-      const std::string& in_1,
-      const chromeos::Any& in_2,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Service",
-        "SetProperty",
-        error,
-        in_1,
-        in_2);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error);
-  }
-
-  void SetPropertyAsync(
-      const std::string& in_1,
-      const chromeos::Any& in_2,
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Service",
-        "SetProperty",
-        success_callback,
-        error_callback,
-        in_1,
-        in_2);
-  }
-
-  bool SetProperties(
-      const chromeos::VariantDictionary& in_1,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Service",
-        "SetProperties",
-        error,
-        in_1);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error);
-  }
-
-  void SetPropertiesAsync(
-      const chromeos::VariantDictionary& in_1,
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Service",
-        "SetProperties",
-        success_callback,
-        error_callback,
-        in_1);
-  }
-
-  bool ClearProperty(
-      const std::string& in_1,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Service",
-        "ClearProperty",
-        error,
-        in_1);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error);
-  }
-
-  void ClearPropertyAsync(
-      const std::string& in_1,
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Service",
-        "ClearProperty",
-        success_callback,
-        error_callback,
-        in_1);
-  }
-
-  bool ClearProperties(
-      const std::vector<std::string>& in_1,
-      std::vector<bool>* out_2,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Service",
-        "ClearProperties",
-        error,
-        in_1);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error, out_2);
-  }
-
-  void ClearPropertiesAsync(
-      const std::vector<std::string>& in_1,
-      const base::Callback<void(const std::vector<bool>&)>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Service",
-        "ClearProperties",
-        success_callback,
-        error_callback,
-        in_1);
-  }
-
-  bool Connect(
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Service",
-        "Connect",
-        error);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error);
-  }
-
-  void ConnectAsync(
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Service",
-        "Connect",
-        success_callback,
-        error_callback);
-  }
-
-  bool Disconnect(
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Service",
-        "Disconnect",
-        error);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error);
-  }
-
-  void DisconnectAsync(
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Service",
-        "Disconnect",
-        success_callback,
-        error_callback);
-  }
-
-  bool Remove(
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Service",
-        "Remove",
-        error);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error);
-  }
-
-  void RemoveAsync(
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Service",
-        "Remove",
-        success_callback,
-        error_callback);
-  }
-
-  bool ActivateCellularModem(
-      const std::string& in_1,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Service",
-        "ActivateCellularModem",
-        error,
-        in_1);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error);
-  }
-
-  void ActivateCellularModemAsync(
-      const std::string& in_1,
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Service",
-        "ActivateCellularModem",
-        success_callback,
-        error_callback,
-        in_1);
-  }
-
-  bool CompleteCellularActivation(
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Service",
-        "CompleteCellularActivation",
-        error);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error);
-  }
-
-  void CompleteCellularActivationAsync(
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Service",
-        "CompleteCellularActivation",
-        success_callback,
-        error_callback);
-  }
-
-  bool GetLoadableProfileEntries(
-      std::map<dbus::ObjectPath, std::string>* out_1,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Service",
-        "GetLoadableProfileEntries",
-        error);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error, out_1);
-  }
-
-  void GetLoadableProfileEntriesAsync(
-      const base::Callback<void(const std::map<dbus::ObjectPath, std::string>&)>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Service",
-        "GetLoadableProfileEntries",
-        success_callback,
-        error_callback);
-  }
-
- private:
-  scoped_refptr<dbus::Bus> bus_;
-  const std::string service_name_{"org.chromium.flimflam"};
-  dbus::ObjectPath object_path_;
-  dbus::ObjectProxy* dbus_object_proxy_;
-
-  DISALLOW_COPY_AND_ASSIGN(ServiceProxy);
-};
-
-}  // namespace flimflam
-}  // namespace chromium
-}  // namespace org
-
-namespace org {
-namespace chromium {
-namespace flimflam {
-
-// Abstract interface proxy for org::chromium::flimflam::Task.
-class TaskProxyInterface {
- public:
-  virtual ~TaskProxyInterface() = default;
-
-  virtual bool getsec(
-      std::string* out_1,
-      std::string* out_2,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void getsecAsync(
-      const base::Callback<void(const std::string&, const std::string&)>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual bool notify(
-      const std::string& in_1,
-      const std::map<std::string, std::string>& in_2,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void notifyAsync(
-      const std::string& in_1,
-      const std::map<std::string, std::string>& in_2,
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-};
-
-}  // namespace flimflam
-}  // namespace chromium
-}  // namespace org
-
-namespace org {
-namespace chromium {
-namespace flimflam {
-
-// Interface proxy for org::chromium::flimflam::Task.
-class TaskProxy final : public TaskProxyInterface {
- public:
-  TaskProxy(
-      const scoped_refptr<dbus::Bus>& bus,
-      const dbus::ObjectPath& object_path) :
-          bus_{bus},
-          object_path_{object_path},
-          dbus_object_proxy_{
-              bus_->GetObjectProxy(service_name_, object_path_)} {
-  }
-
-  ~TaskProxy() override {
-    bus_->RemoveObjectProxy(
-        service_name_, object_path_, base::Bind(&base::DoNothing));
-  }
-
-  void ReleaseObjectProxy(const base::Closure& callback) {
-    bus_->RemoveObjectProxy(service_name_, object_path_, callback);
-  }
-
-  const dbus::ObjectPath& GetObjectPath() const {
-    return object_path_;
-  }
-
-  dbus::ObjectProxy* GetObjectProxy() const { return dbus_object_proxy_; }
-
-  bool getsec(
-      std::string* out_1,
-      std::string* out_2,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Task",
-        "getsec",
-        error);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error, out_1, out_2);
-  }
-
-  void getsecAsync(
-      const base::Callback<void(const std::string&, const std::string&)>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Task",
-        "getsec",
-        success_callback,
-        error_callback);
-  }
-
-  bool notify(
-      const std::string& in_1,
-      const std::map<std::string, std::string>& in_2,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Task",
-        "notify",
-        error,
-        in_1,
-        in_2);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error);
-  }
-
-  void notifyAsync(
-      const std::string& in_1,
-      const std::map<std::string, std::string>& in_2,
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.Task",
-        "notify",
-        success_callback,
-        error_callback,
-        in_1,
-        in_2);
-  }
-
- private:
-  scoped_refptr<dbus::Bus> bus_;
-  const std::string service_name_{"org.chromium.flimflam"};
-  dbus::ObjectPath object_path_;
-  dbus::ObjectProxy* dbus_object_proxy_;
-
-  DISALLOW_COPY_AND_ASSIGN(TaskProxy);
-};
-
-}  // namespace flimflam
-}  // namespace chromium
-}  // namespace org
-
-namespace org {
-namespace chromium {
-namespace flimflam {
-
-// Abstract interface proxy for org::chromium::flimflam::ThirdPartyVpn.
-class ThirdPartyVpnProxyInterface {
- public:
-  virtual ~ThirdPartyVpnProxyInterface() = default;
-
-  virtual bool SetParameters(
-      const std::map<std::string, std::string>& in_parameters,
-      std::string* out_warning,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void SetParametersAsync(
-      const std::map<std::string, std::string>& in_parameters,
-      const base::Callback<void(const std::string& /*warning*/)>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual bool UpdateConnectionState(
-      uint32_t in_connection_state,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void UpdateConnectionStateAsync(
-      uint32_t in_connection_state,
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual bool SendPacket(
-      const std::vector<uint8_t>& in_ip_packet,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void SendPacketAsync(
-      const std::vector<uint8_t>& in_ip_packet,
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
-
-  virtual void RegisterOnPacketReceivedSignalHandler(
-      const base::Callback<void(const std::vector<uint8_t>&)>& signal_callback,
-      dbus::ObjectProxy::OnConnectedCallback on_connected_callback) = 0;
-
-  virtual void RegisterOnPlatformMessageSignalHandler(
-      const base::Callback<void(uint32_t)>& signal_callback,
-      dbus::ObjectProxy::OnConnectedCallback on_connected_callback) = 0;
-};
-
-}  // namespace flimflam
-}  // namespace chromium
-}  // namespace org
-
-namespace org {
-namespace chromium {
-namespace flimflam {
-
-// Interface proxy for org::chromium::flimflam::ThirdPartyVpn.
-class ThirdPartyVpnProxy final : public ThirdPartyVpnProxyInterface {
- public:
-  ThirdPartyVpnProxy(
-      const scoped_refptr<dbus::Bus>& bus,
-      const dbus::ObjectPath& object_path) :
-          bus_{bus},
-          object_path_{object_path},
-          dbus_object_proxy_{
-              bus_->GetObjectProxy(service_name_, object_path_)} {
-  }
-
-  ~ThirdPartyVpnProxy() override {
-    bus_->RemoveObjectProxy(
-        service_name_, object_path_, base::Bind(&base::DoNothing));
-  }
-
-  void RegisterOnPacketReceivedSignalHandler(
-      const base::Callback<void(const std::vector<uint8_t>&)>& signal_callback,
-      dbus::ObjectProxy::OnConnectedCallback on_connected_callback) override {
-    chromeos::dbus_utils::ConnectToSignal(
-        dbus_object_proxy_,
-        "org.chromium.flimflam.ThirdPartyVpn",
-        "OnPacketReceived",
-        signal_callback,
-        on_connected_callback);
-  }
-
-  void RegisterOnPlatformMessageSignalHandler(
-      const base::Callback<void(uint32_t)>& signal_callback,
-      dbus::ObjectProxy::OnConnectedCallback on_connected_callback) override {
-    chromeos::dbus_utils::ConnectToSignal(
-        dbus_object_proxy_,
-        "org.chromium.flimflam.ThirdPartyVpn",
-        "OnPlatformMessage",
-        signal_callback,
-        on_connected_callback);
-  }
-
-  void ReleaseObjectProxy(const base::Closure& callback) {
-    bus_->RemoveObjectProxy(service_name_, object_path_, callback);
-  }
-
-  const dbus::ObjectPath& GetObjectPath() const {
-    return object_path_;
-  }
-
-  dbus::ObjectProxy* GetObjectProxy() const { return dbus_object_proxy_; }
-
-  bool SetParameters(
-      const std::map<std::string, std::string>& in_parameters,
-      std::string* out_warning,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.ThirdPartyVpn",
-        "SetParameters",
-        error,
-        in_parameters);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error, out_warning);
-  }
-
-  void SetParametersAsync(
-      const std::map<std::string, std::string>& in_parameters,
-      const base::Callback<void(const std::string& /*warning*/)>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.ThirdPartyVpn",
-        "SetParameters",
-        success_callback,
-        error_callback,
-        in_parameters);
-  }
-
-  bool UpdateConnectionState(
-      uint32_t in_connection_state,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.ThirdPartyVpn",
-        "UpdateConnectionState",
-        error,
-        in_connection_state);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error);
-  }
-
-  void UpdateConnectionStateAsync(
-      uint32_t in_connection_state,
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.ThirdPartyVpn",
-        "UpdateConnectionState",
-        success_callback,
-        error_callback,
-        in_connection_state);
-  }
-
-  bool SendPacket(
-      const std::vector<uint8_t>& in_ip_packet,
-      chromeos::ErrorPtr* error,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    auto response = chromeos::dbus_utils::CallMethodAndBlockWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.ThirdPartyVpn",
-        "SendPacket",
-        error,
-        in_ip_packet);
-    return response && chromeos::dbus_utils::ExtractMethodCallResults(
-        response.get(), error);
-  }
-
-  void SendPacketAsync(
-      const std::vector<uint8_t>& in_ip_packet,
-      const base::Callback<void()>& success_callback,
-      const base::Callback<void(chromeos::Error*)>& error_callback,
-      int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
-    chromeos::dbus_utils::CallMethodWithTimeout(
-        timeout_ms,
-        dbus_object_proxy_,
-        "org.chromium.flimflam.ThirdPartyVpn",
-        "SendPacket",
-        success_callback,
-        error_callback,
-        in_ip_packet);
-  }
-
- private:
-  scoped_refptr<dbus::Bus> bus_;
-  const std::string service_name_{"org.chromium.flimflam"};
-  dbus::ObjectPath object_path_;
-  dbus::ObjectProxy* dbus_object_proxy_;
-
-  DISALLOW_COPY_AND_ASSIGN(ThirdPartyVpnProxy);
-};
-
-}  // namespace flimflam
-}  // namespace chromium
-}  // namespace org
-
-#endif  // ____CHROMEOS_DBUS_BINDING___BUILD_LINK_VAR_CACHE_PORTAGE_CHROMEOS_BASE_SHILL_OUT_DEFAULT_GEN_INCLUDE_SHILL_DBUS_PROXIES_H
diff --git a/include/shill/dbus-proxy-mocks.h b/include/shill/dbus-proxy-mocks.h
deleted file mode 100644
index 0f2eb21..0000000
--- a/include/shill/dbus-proxy-mocks.h
+++ /dev/null
@@ -1,946 +0,0 @@
-// Automatic generation of D-Bus interface mock proxies for:
-//  - org.chromium.flimflam.Device
-//  - org.chromium.flimflam.IPConfig
-//  - org.chromium.flimflam.Manager
-//  - org.chromium.flimflam.Profile
-//  - org.chromium.flimflam.Service
-//  - org.chromium.flimflam.Task
-//  - org.chromium.flimflam.ThirdPartyVpn
-#ifndef ____CHROMEOS_DBUS_BINDING___BUILD_LINK_VAR_CACHE_PORTAGE_CHROMEOS_BASE_SHILL_OUT_DEFAULT_GEN_INCLUDE_SHILL_DBUS_PROXY_MOCKS_H
-#define ____CHROMEOS_DBUS_BINDING___BUILD_LINK_VAR_CACHE_PORTAGE_CHROMEOS_BASE_SHILL_OUT_DEFAULT_GEN_INCLUDE_SHILL_DBUS_PROXY_MOCKS_H
-#include <string>
-#include <vector>
-
-#include <base/callback_forward.h>
-#include <base/logging.h>
-#include <base/macros.h>
-#include <chromeos/any.h>
-#include <chromeos/errors/error.h>
-#include <chromeos/variant_dictionary.h>
-#include <gmock/gmock.h>
-
-#include "shill/dbus-proxies.h"
-
-namespace org {
-namespace chromium {
-namespace flimflam {
-
-// Mock object for DeviceProxyInterface.
-class DeviceProxyMock : public DeviceProxyInterface {
- public:
-  DeviceProxyMock() = default;
-
-  MOCK_METHOD3(AddWakeOnPacketConnection,
-               bool(const std::string& /*in_ip_endpoint*/,
-                    chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD4(AddWakeOnPacketConnectionAsync,
-               void(const std::string& /*in_ip_endpoint*/,
-                    const base::Callback<void()>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD3(RemoveWakeOnPacketConnection,
-               bool(const std::string& /*in_ip_endpoint*/,
-                    chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD4(RemoveWakeOnPacketConnectionAsync,
-               void(const std::string& /*in_ip_endpoint*/,
-                    const base::Callback<void()>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD2(RemoveAllWakeOnPacketConnections,
-               bool(chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD3(RemoveAllWakeOnPacketConnectionsAsync,
-               void(const base::Callback<void()>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD3(GetProperties,
-               bool(chromeos::VariantDictionary*,
-                    chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD3(GetPropertiesAsync,
-               void(const base::Callback<void(const chromeos::VariantDictionary&)>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD4(SetProperty,
-               bool(const std::string&,
-                    const chromeos::Any&,
-                    chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD5(SetPropertyAsync,
-               void(const std::string&,
-                    const chromeos::Any&,
-                    const base::Callback<void()>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD3(ClearProperty,
-               bool(const std::string&,
-                    chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD4(ClearPropertyAsync,
-               void(const std::string&,
-                    const base::Callback<void()>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD2(Enable,
-               bool(chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD3(EnableAsync,
-               void(const base::Callback<void()>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD2(Disable,
-               bool(chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD3(DisableAsync,
-               void(const base::Callback<void()>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD2(ProposeScan,
-               bool(chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD3(ProposeScanAsync,
-               void(const base::Callback<void()>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD4(AddIPConfig,
-               bool(const std::string&,
-                    dbus::ObjectPath*,
-                    chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD4(AddIPConfigAsync,
-               void(const std::string&,
-                    const base::Callback<void(const dbus::ObjectPath&)>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD3(Register,
-               bool(const std::string&,
-                    chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD4(RegisterAsync,
-               void(const std::string&,
-                    const base::Callback<void()>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD4(RequirePin,
-               bool(const std::string&,
-                    bool,
-                    chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD5(RequirePinAsync,
-               void(const std::string&,
-                    bool,
-                    const base::Callback<void()>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD3(EnterPin,
-               bool(const std::string&,
-                    chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD4(EnterPinAsync,
-               void(const std::string&,
-                    const base::Callback<void()>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD4(UnblockPin,
-               bool(const std::string&,
-                    const std::string&,
-                    chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD5(UnblockPinAsync,
-               void(const std::string&,
-                    const std::string&,
-                    const base::Callback<void()>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD4(ChangePin,
-               bool(const std::string&,
-                    const std::string&,
-                    chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD5(ChangePinAsync,
-               void(const std::string&,
-                    const std::string&,
-                    const base::Callback<void()>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD5(PerformTDLSOperation,
-               bool(const std::string&,
-                    const std::string&,
-                    std::string*,
-                    chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD5(PerformTDLSOperationAsync,
-               void(const std::string&,
-                    const std::string&,
-                    const base::Callback<void(const std::string&)>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD2(Reset,
-               bool(chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD3(ResetAsync,
-               void(const base::Callback<void()>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD2(ResetByteCounters,
-               bool(chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD3(ResetByteCountersAsync,
-               void(const base::Callback<void()>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD3(SetCarrier,
-               bool(const std::string&,
-                    chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD4(SetCarrierAsync,
-               void(const std::string&,
-                    const base::Callback<void()>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD3(RequestRoam,
-               bool(const std::string&,
-                    chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD4(RequestRoamAsync,
-               void(const std::string&,
-                    const base::Callback<void()>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD2(RegisterPropertyChangedSignalHandler,
-               void(const base::Callback<void(const std::string&,
-                                              const chromeos::Any&)>& /*signal_callback*/,
-                    dbus::ObjectProxy::OnConnectedCallback /*on_connected_callback*/));
-
- private:
-  DISALLOW_COPY_AND_ASSIGN(DeviceProxyMock);
-};
-}  // namespace flimflam
-}  // namespace chromium
-}  // namespace org
-
-namespace org {
-namespace chromium {
-namespace flimflam {
-
-// Mock object for IPConfigProxyInterface.
-class IPConfigProxyMock : public IPConfigProxyInterface {
- public:
-  IPConfigProxyMock() = default;
-
-  MOCK_METHOD3(GetProperties,
-               bool(chromeos::VariantDictionary*,
-                    chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD3(GetPropertiesAsync,
-               void(const base::Callback<void(const chromeos::VariantDictionary&)>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD4(SetProperty,
-               bool(const std::string&,
-                    const chromeos::Any&,
-                    chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD5(SetPropertyAsync,
-               void(const std::string&,
-                    const chromeos::Any&,
-                    const base::Callback<void()>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD3(ClearProperty,
-               bool(const std::string&,
-                    chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD4(ClearPropertyAsync,
-               void(const std::string&,
-                    const base::Callback<void()>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD2(Remove,
-               bool(chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD3(RemoveAsync,
-               void(const base::Callback<void()>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD2(Refresh,
-               bool(chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD3(RefreshAsync,
-               void(const base::Callback<void()>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD2(RegisterPropertyChangedSignalHandler,
-               void(const base::Callback<void(const std::string&,
-                                              const chromeos::Any&)>& /*signal_callback*/,
-                    dbus::ObjectProxy::OnConnectedCallback /*on_connected_callback*/));
-
- private:
-  DISALLOW_COPY_AND_ASSIGN(IPConfigProxyMock);
-};
-}  // namespace flimflam
-}  // namespace chromium
-}  // namespace org
-
-namespace org {
-namespace chromium {
-namespace flimflam {
-
-// Mock object for ManagerProxyInterface.
-class ManagerProxyMock : public ManagerProxyInterface {
- public:
-  ManagerProxyMock() = default;
-
-  MOCK_METHOD3(GetProperties,
-               bool(chromeos::VariantDictionary*,
-                    chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD3(GetPropertiesAsync,
-               void(const base::Callback<void(const chromeos::VariantDictionary&)>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD4(SetProperty,
-               bool(const std::string&,
-                    const chromeos::Any&,
-                    chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD5(SetPropertyAsync,
-               void(const std::string&,
-                    const chromeos::Any&,
-                    const base::Callback<void()>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD3(GetState,
-               bool(std::string*,
-                    chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD3(GetStateAsync,
-               void(const base::Callback<void(const std::string&)>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD4(CreateProfile,
-               bool(const std::string&,
-                    dbus::ObjectPath*,
-                    chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD4(CreateProfileAsync,
-               void(const std::string&,
-                    const base::Callback<void(const dbus::ObjectPath&)>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD3(RemoveProfile,
-               bool(const std::string&,
-                    chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD4(RemoveProfileAsync,
-               void(const std::string&,
-                    const base::Callback<void()>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD4(PushProfile,
-               bool(const std::string&,
-                    dbus::ObjectPath*,
-                    chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD4(PushProfileAsync,
-               void(const std::string&,
-                    const base::Callback<void(const dbus::ObjectPath&)>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD5(InsertUserProfile,
-               bool(const std::string&,
-                    const std::string&,
-                    dbus::ObjectPath*,
-                    chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD5(InsertUserProfileAsync,
-               void(const std::string&,
-                    const std::string&,
-                    const base::Callback<void(const dbus::ObjectPath&)>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD3(PopProfile,
-               bool(const std::string&,
-                    chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD4(PopProfileAsync,
-               void(const std::string&,
-                    const base::Callback<void()>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD2(PopAnyProfile,
-               bool(chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD3(PopAnyProfileAsync,
-               void(const base::Callback<void()>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD2(PopAllUserProfiles,
-               bool(chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD3(PopAllUserProfilesAsync,
-               void(const base::Callback<void()>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD2(RecheckPortal,
-               bool(chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD3(RecheckPortalAsync,
-               void(const base::Callback<void()>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD3(RequestScan,
-               bool(const std::string&,
-                    chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD4(RequestScanAsync,
-               void(const std::string&,
-                    const base::Callback<void()>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD3(EnableTechnology,
-               bool(const std::string&,
-                    chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD4(EnableTechnologyAsync,
-               void(const std::string&,
-                    const base::Callback<void()>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD3(DisableTechnology,
-               bool(const std::string&,
-                    chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD4(DisableTechnologyAsync,
-               void(const std::string&,
-                    const base::Callback<void()>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD4(GetService,
-               bool(const chromeos::VariantDictionary&,
-                    dbus::ObjectPath*,
-                    chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD4(GetServiceAsync,
-               void(const chromeos::VariantDictionary&,
-                    const base::Callback<void(const dbus::ObjectPath&)>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD4(GetWifiService,
-               bool(const chromeos::VariantDictionary&,
-                    dbus::ObjectPath*,
-                    chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD4(GetWifiServiceAsync,
-               void(const chromeos::VariantDictionary&,
-                    const base::Callback<void(const dbus::ObjectPath&)>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD4(ConfigureService,
-               bool(const chromeos::VariantDictionary&,
-                    dbus::ObjectPath*,
-                    chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD4(ConfigureServiceAsync,
-               void(const chromeos::VariantDictionary&,
-                    const base::Callback<void(const dbus::ObjectPath&)>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD5(ConfigureServiceForProfile,
-               bool(const dbus::ObjectPath&,
-                    const chromeos::VariantDictionary&,
-                    dbus::ObjectPath*,
-                    chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD5(ConfigureServiceForProfileAsync,
-               void(const dbus::ObjectPath&,
-                    const chromeos::VariantDictionary&,
-                    const base::Callback<void(const dbus::ObjectPath&)>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD4(FindMatchingService,
-               bool(const chromeos::VariantDictionary&,
-                    dbus::ObjectPath*,
-                    chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD4(FindMatchingServiceAsync,
-               void(const chromeos::VariantDictionary&,
-                    const base::Callback<void(const dbus::ObjectPath&)>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD4(GetVPNService,
-               bool(const chromeos::VariantDictionary&,
-                    dbus::ObjectPath*,
-                    chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD4(GetVPNServiceAsync,
-               void(const chromeos::VariantDictionary&,
-                    const base::Callback<void(const dbus::ObjectPath&)>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD3(GetDebugLevel,
-               bool(int32_t*,
-                    chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD3(GetDebugLevelAsync,
-               void(const base::Callback<void(int32_t)>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD3(SetDebugLevel,
-               bool(int32_t,
-                    chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD4(SetDebugLevelAsync,
-               void(int32_t,
-                    const base::Callback<void()>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD3(GetServiceOrder,
-               bool(std::string*,
-                    chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD3(GetServiceOrderAsync,
-               void(const base::Callback<void(const std::string&)>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD3(SetServiceOrder,
-               bool(const std::string&,
-                    chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD4(SetServiceOrderAsync,
-               void(const std::string&,
-                    const base::Callback<void()>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD3(GetDebugTags,
-               bool(std::string*,
-                    chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD3(GetDebugTagsAsync,
-               void(const base::Callback<void(const std::string&)>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD3(SetDebugTags,
-               bool(const std::string&,
-                    chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD4(SetDebugTagsAsync,
-               void(const std::string&,
-                    const base::Callback<void()>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD3(ListDebugTags,
-               bool(std::string*,
-                    chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD3(ListDebugTagsAsync,
-               void(const base::Callback<void(const std::string&)>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD3(GetNetworksForGeolocation,
-               bool(chromeos::VariantDictionary*,
-                    chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD3(GetNetworksForGeolocationAsync,
-               void(const base::Callback<void(const chromeos::VariantDictionary&)>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD10(VerifyDestination,
-                bool(const std::string& /*in_certificate*/,
-                     const std::string& /*in_public_key*/,
-                     const std::string& /*in_nonce*/,
-                     const std::string& /*in_signed_data*/,
-                     const std::string& /*in_destination_udn*/,
-                     const std::string& /*in_hotspot_ssid*/,
-                     const std::string& /*in_hotspot_bssid*/,
-                     bool*,
-                     chromeos::ErrorPtr* /*error*/,
-                     int /*timeout_ms*/));
-  MOCK_METHOD10(VerifyDestinationAsync,
-                void(const std::string& /*in_certificate*/,
-                     const std::string& /*in_public_key*/,
-                     const std::string& /*in_nonce*/,
-                     const std::string& /*in_signed_data*/,
-                     const std::string& /*in_destination_udn*/,
-                     const std::string& /*in_hotspot_ssid*/,
-                     const std::string& /*in_hotspot_bssid*/,
-                     const base::Callback<void(bool)>& /*success_callback*/,
-                     const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                     int /*timeout_ms*/));
-  bool VerifyAndEncryptCredentials(const std::string& /*in_certificate*/,
-                                   const std::string& /*in_public_key*/,
-                                   const std::string& /*in_nonce*/,
-                                   const std::string& /*in_signed_data*/,
-                                   const std::string& /*in_destination_udn*/,
-                                   const std::string& /*in_hotspot_ssid*/,
-                                   const std::string& /*in_hotspot_bssid*/,
-                                   const dbus::ObjectPath& /*in_network*/,
-                                   std::string*,
-                                   chromeos::ErrorPtr* /*error*/,
-                                   int /*timeout_ms*/) override {
-    LOG(WARNING) << "VerifyAndEncryptCredentials(): gmock can't handle methods with 11 arguments. You can override this method in a subclass if you need to.";
-    return false;
-  }
-  void VerifyAndEncryptCredentialsAsync(const std::string& /*in_certificate*/,
-                                        const std::string& /*in_public_key*/,
-                                        const std::string& /*in_nonce*/,
-                                        const std::string& /*in_signed_data*/,
-                                        const std::string& /*in_destination_udn*/,
-                                        const std::string& /*in_hotspot_ssid*/,
-                                        const std::string& /*in_hotspot_bssid*/,
-                                        const dbus::ObjectPath& /*in_network*/,
-                                        const base::Callback<void(const std::string&)>& /*success_callback*/,
-                                        const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                                        int /*timeout_ms*/) override {
-    LOG(WARNING) << "VerifyAndEncryptCredentialsAsync(): gmock can't handle methods with 11 arguments. You can override this method in a subclass if you need to.";
-  }
-  bool VerifyAndEncryptData(const std::string& /*in_certificate*/,
-                            const std::string& /*in_public_key*/,
-                            const std::string& /*in_nonce*/,
-                            const std::string& /*in_signed_data*/,
-                            const std::string& /*in_destination_udn*/,
-                            const std::string& /*in_hotspot_ssid*/,
-                            const std::string& /*in_hotspot_bssid*/,
-                            const std::string& /*in_data*/,
-                            std::string*,
-                            chromeos::ErrorPtr* /*error*/,
-                            int /*timeout_ms*/) override {
-    LOG(WARNING) << "VerifyAndEncryptData(): gmock can't handle methods with 11 arguments. You can override this method in a subclass if you need to.";
-    return false;
-  }
-  void VerifyAndEncryptDataAsync(const std::string& /*in_certificate*/,
-                                 const std::string& /*in_public_key*/,
-                                 const std::string& /*in_nonce*/,
-                                 const std::string& /*in_signed_data*/,
-                                 const std::string& /*in_destination_udn*/,
-                                 const std::string& /*in_hotspot_ssid*/,
-                                 const std::string& /*in_hotspot_bssid*/,
-                                 const std::string& /*in_data*/,
-                                 const base::Callback<void(const std::string&)>& /*success_callback*/,
-                                 const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                                 int /*timeout_ms*/) override {
-    LOG(WARNING) << "VerifyAndEncryptDataAsync(): gmock can't handle methods with 11 arguments. You can override this method in a subclass if you need to.";
-  }
-  MOCK_METHOD2(ConnectToBestServices,
-               bool(chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD3(ConnectToBestServicesAsync,
-               void(const base::Callback<void()>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD2(CreateConnectivityReport,
-               bool(chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD3(CreateConnectivityReportAsync,
-               void(const base::Callback<void()>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD4(ClaimInterface,
-               bool(const std::string& /*in_claimer_name*/,
-                    const std::string& /*in_interface_name*/,
-                    chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD5(ClaimInterfaceAsync,
-               void(const std::string& /*in_claimer_name*/,
-                    const std::string& /*in_interface_name*/,
-                    const base::Callback<void()>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD4(ReleaseInterface,
-               bool(const std::string& /*in_claimer_name*/,
-                    const std::string& /*in_interface_name*/,
-                    chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD5(ReleaseInterfaceAsync,
-               void(const std::string& /*in_claimer_name*/,
-                    const std::string& /*in_interface_name*/,
-                    const base::Callback<void()>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD3(SetSchedScan,
-               bool(bool,
-                    chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD4(SetSchedScanAsync,
-               void(bool,
-                    const base::Callback<void()>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD2(RegisterPropertyChangedSignalHandler,
-               void(const base::Callback<void(const std::string&,
-                                              const chromeos::Any&)>& /*signal_callback*/,
-                    dbus::ObjectProxy::OnConnectedCallback /*on_connected_callback*/));
-  MOCK_METHOD2(RegisterStateChangedSignalHandler,
-               void(const base::Callback<void(const std::string&)>& /*signal_callback*/,
-                    dbus::ObjectProxy::OnConnectedCallback /*on_connected_callback*/));
-
- private:
-  DISALLOW_COPY_AND_ASSIGN(ManagerProxyMock);
-};
-}  // namespace flimflam
-}  // namespace chromium
-}  // namespace org
-
-namespace org {
-namespace chromium {
-namespace flimflam {
-
-// Mock object for ProfileProxyInterface.
-class ProfileProxyMock : public ProfileProxyInterface {
- public:
-  ProfileProxyMock() = default;
-
-  MOCK_METHOD3(GetProperties,
-               bool(chromeos::VariantDictionary*,
-                    chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD3(GetPropertiesAsync,
-               void(const base::Callback<void(const chromeos::VariantDictionary&)>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD4(SetProperty,
-               bool(const std::string&,
-                    const chromeos::Any&,
-                    chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD5(SetPropertyAsync,
-               void(const std::string&,
-                    const chromeos::Any&,
-                    const base::Callback<void()>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD4(GetEntry,
-               bool(const std::string&,
-                    chromeos::VariantDictionary*,
-                    chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD4(GetEntryAsync,
-               void(const std::string&,
-                    const base::Callback<void(const chromeos::VariantDictionary&)>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD3(DeleteEntry,
-               bool(const std::string&,
-                    chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD4(DeleteEntryAsync,
-               void(const std::string&,
-                    const base::Callback<void()>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD2(RegisterPropertyChangedSignalHandler,
-               void(const base::Callback<void(const std::string&,
-                                              const chromeos::Any&)>& /*signal_callback*/,
-                    dbus::ObjectProxy::OnConnectedCallback /*on_connected_callback*/));
-
- private:
-  DISALLOW_COPY_AND_ASSIGN(ProfileProxyMock);
-};
-}  // namespace flimflam
-}  // namespace chromium
-}  // namespace org
-
-namespace org {
-namespace chromium {
-namespace flimflam {
-
-// Mock object for ServiceProxyInterface.
-class ServiceProxyMock : public ServiceProxyInterface {
- public:
-  ServiceProxyMock() = default;
-
-  MOCK_METHOD3(GetProperties,
-               bool(chromeos::VariantDictionary*,
-                    chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD3(GetPropertiesAsync,
-               void(const base::Callback<void(const chromeos::VariantDictionary&)>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD4(SetProperty,
-               bool(const std::string&,
-                    const chromeos::Any&,
-                    chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD5(SetPropertyAsync,
-               void(const std::string&,
-                    const chromeos::Any&,
-                    const base::Callback<void()>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD3(SetProperties,
-               bool(const chromeos::VariantDictionary&,
-                    chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD4(SetPropertiesAsync,
-               void(const chromeos::VariantDictionary&,
-                    const base::Callback<void()>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD3(ClearProperty,
-               bool(const std::string&,
-                    chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD4(ClearPropertyAsync,
-               void(const std::string&,
-                    const base::Callback<void()>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD4(ClearProperties,
-               bool(const std::vector<std::string>&,
-                    std::vector<bool>*,
-                    chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD4(ClearPropertiesAsync,
-               void(const std::vector<std::string>&,
-                    const base::Callback<void(const std::vector<bool>&)>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD2(Connect,
-               bool(chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD3(ConnectAsync,
-               void(const base::Callback<void()>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD2(Disconnect,
-               bool(chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD3(DisconnectAsync,
-               void(const base::Callback<void()>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD2(Remove,
-               bool(chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD3(RemoveAsync,
-               void(const base::Callback<void()>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD3(ActivateCellularModem,
-               bool(const std::string&,
-                    chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD4(ActivateCellularModemAsync,
-               void(const std::string&,
-                    const base::Callback<void()>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD2(CompleteCellularActivation,
-               bool(chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD3(CompleteCellularActivationAsync,
-               void(const base::Callback<void()>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD3(GetLoadableProfileEntries,
-               bool(std::map<dbus::ObjectPath, std::string>*,
-                    chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD3(GetLoadableProfileEntriesAsync,
-               void(const base::Callback<void(const std::map<dbus::ObjectPath, std::string>&)>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD2(RegisterPropertyChangedSignalHandler,
-               void(const base::Callback<void(const std::string&,
-                                              const chromeos::Any&)>& /*signal_callback*/,
-                    dbus::ObjectProxy::OnConnectedCallback /*on_connected_callback*/));
-
- private:
-  DISALLOW_COPY_AND_ASSIGN(ServiceProxyMock);
-};
-}  // namespace flimflam
-}  // namespace chromium
-}  // namespace org
-
-namespace org {
-namespace chromium {
-namespace flimflam {
-
-// Mock object for TaskProxyInterface.
-class TaskProxyMock : public TaskProxyInterface {
- public:
-  TaskProxyMock() = default;
-
-  MOCK_METHOD4(getsec,
-               bool(std::string*,
-                    std::string*,
-                    chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD3(getsecAsync,
-               void(const base::Callback<void(const std::string&, const std::string&)>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD4(notify,
-               bool(const std::string&,
-                    const std::map<std::string, std::string>&,
-                    chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD5(notifyAsync,
-               void(const std::string&,
-                    const std::map<std::string, std::string>&,
-                    const base::Callback<void()>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-
- private:
-  DISALLOW_COPY_AND_ASSIGN(TaskProxyMock);
-};
-}  // namespace flimflam
-}  // namespace chromium
-}  // namespace org
-
-namespace org {
-namespace chromium {
-namespace flimflam {
-
-// Mock object for ThirdPartyVpnProxyInterface.
-class ThirdPartyVpnProxyMock : public ThirdPartyVpnProxyInterface {
- public:
-  ThirdPartyVpnProxyMock() = default;
-
-  MOCK_METHOD4(SetParameters,
-               bool(const std::map<std::string, std::string>& /*in_parameters*/,
-                    std::string* /*out_warning*/,
-                    chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD4(SetParametersAsync,
-               void(const std::map<std::string, std::string>& /*in_parameters*/,
-                    const base::Callback<void(const std::string& /*warning*/)>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD3(UpdateConnectionState,
-               bool(uint32_t /*in_connection_state*/,
-                    chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD4(UpdateConnectionStateAsync,
-               void(uint32_t /*in_connection_state*/,
-                    const base::Callback<void()>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD3(SendPacket,
-               bool(const std::vector<uint8_t>& /*in_ip_packet*/,
-                    chromeos::ErrorPtr* /*error*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD4(SendPacketAsync,
-               void(const std::vector<uint8_t>& /*in_ip_packet*/,
-                    const base::Callback<void()>& /*success_callback*/,
-                    const base::Callback<void(chromeos::Error*)>& /*error_callback*/,
-                    int /*timeout_ms*/));
-  MOCK_METHOD2(RegisterOnPacketReceivedSignalHandler,
-               void(const base::Callback<void(const std::vector<uint8_t>&)>& /*signal_callback*/,
-                    dbus::ObjectProxy::OnConnectedCallback /*on_connected_callback*/));
-  MOCK_METHOD2(RegisterOnPlatformMessageSignalHandler,
-               void(const base::Callback<void(uint32_t)>& /*signal_callback*/,
-                    dbus::ObjectProxy::OnConnectedCallback /*on_connected_callback*/));
-
- private:
-  DISALLOW_COPY_AND_ASSIGN(ThirdPartyVpnProxyMock);
-};
-}  // namespace flimflam
-}  // namespace chromium
-}  // namespace org
-
-#endif  // ____CHROMEOS_DBUS_BINDING___BUILD_LINK_VAR_CACHE_PORTAGE_CHROMEOS_BASE_SHILL_OUT_DEFAULT_GEN_INCLUDE_SHILL_DBUS_PROXY_MOCKS_H
