| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "extensions/browser/api/vpn_provider/vpn_provider_api.h" | 5 #include "extensions/browser/api/vpn_provider/vpn_provider_api.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/memory/ptr_util.h" |
| 12 #include "base/strings/string_split.h" | 13 #include "base/strings/string_split.h" |
| 13 #include "base/strings/string_util.h" | 14 #include "base/strings/string_util.h" |
| 14 #include "base/values.h" | 15 #include "base/values.h" |
| 15 #include "extensions/browser/api/vpn_provider/vpn_service.h" | 16 #include "extensions/browser/api/vpn_provider/vpn_service.h" |
| 16 #include "extensions/browser/api/vpn_provider/vpn_service_factory.h" | 17 #include "extensions/browser/api/vpn_provider/vpn_service_factory.h" |
| 17 #include "extensions/common/api/vpn_provider.h" | 18 #include "extensions/common/api/vpn_provider.h" |
| 18 #include "third_party/cros_system_api/dbus/service_constants.h" | 19 #include "third_party/cros_system_api/dbus/service_constants.h" |
| 19 | 20 |
| 20 namespace extensions { | 21 namespace extensions { |
| 21 | 22 |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 | 156 |
| 156 VpnThreadExtensionFunction::~VpnThreadExtensionFunction() { | 157 VpnThreadExtensionFunction::~VpnThreadExtensionFunction() { |
| 157 } | 158 } |
| 158 | 159 |
| 159 void VpnThreadExtensionFunction::SignalCallCompletionSuccess() { | 160 void VpnThreadExtensionFunction::SignalCallCompletionSuccess() { |
| 160 Respond(NoArguments()); | 161 Respond(NoArguments()); |
| 161 } | 162 } |
| 162 | 163 |
| 163 void VpnThreadExtensionFunction::SignalCallCompletionSuccessWithId( | 164 void VpnThreadExtensionFunction::SignalCallCompletionSuccessWithId( |
| 164 const std::string& configuration_id) { | 165 const std::string& configuration_id) { |
| 165 Respond(OneArgument(new base::StringValue(configuration_id))); | 166 Respond(OneArgument(base::MakeUnique<base::StringValue>(configuration_id))); |
| 166 } | 167 } |
| 167 | 168 |
| 168 void VpnThreadExtensionFunction::SignalCallCompletionSuccessWithWarning( | 169 void VpnThreadExtensionFunction::SignalCallCompletionSuccessWithWarning( |
| 169 const std::string& warning) { | 170 const std::string& warning) { |
| 170 if (!warning.empty()) { | 171 if (!warning.empty()) { |
| 171 WriteToConsole(content::CONSOLE_MESSAGE_LEVEL_WARNING, warning); | 172 WriteToConsole(content::CONSOLE_MESSAGE_LEVEL_WARNING, warning); |
| 172 } | 173 } |
| 173 Respond(NoArguments()); | 174 Respond(NoArguments()); |
| 174 } | 175 } |
| 175 | 176 |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 SignalCallCompletionSuccess, | 329 SignalCallCompletionSuccess, |
| 329 this), | 330 this), |
| 330 base::Bind(&VpnProviderNotifyConnectionStateChangedFunction:: | 331 base::Bind(&VpnProviderNotifyConnectionStateChangedFunction:: |
| 331 SignalCallCompletionFailure, | 332 SignalCallCompletionFailure, |
| 332 this)); | 333 this)); |
| 333 | 334 |
| 334 return RespondLater(); | 335 return RespondLater(); |
| 335 } | 336 } |
| 336 | 337 |
| 337 } // namespace extensions | 338 } // namespace extensions |
| OLD | NEW |