| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/extension_function.h" | 5 #include "extensions/browser/extension_function.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 void ExtensionFunction::SetError(const std::string& error) { | 327 void ExtensionFunction::SetError(const std::string& error) { |
| 328 error_ = error; | 328 error_ = error; |
| 329 } | 329 } |
| 330 | 330 |
| 331 bool ExtensionFunction::user_gesture() const { | 331 bool ExtensionFunction::user_gesture() const { |
| 332 return user_gesture_ || UserGestureForTests::GetInstance()->HaveGesture(); | 332 return user_gesture_ || UserGestureForTests::GetInstance()->HaveGesture(); |
| 333 } | 333 } |
| 334 | 334 |
| 335 ExtensionFunction::ResponseValue ExtensionFunction::NoArguments() { | 335 ExtensionFunction::ResponseValue ExtensionFunction::NoArguments() { |
| 336 return ResponseValue(new ArgumentListResponseValue( | 336 return ResponseValue(new ArgumentListResponseValue( |
| 337 name(), "NoArguments", this, base::WrapUnique(new base::ListValue()))); | 337 name(), "NoArguments", this, base::MakeUnique<base::ListValue>())); |
| 338 } | 338 } |
| 339 | 339 |
| 340 ExtensionFunction::ResponseValue ExtensionFunction::OneArgument( | 340 ExtensionFunction::ResponseValue ExtensionFunction::OneArgument( |
| 341 std::unique_ptr<base::Value> arg) { | 341 std::unique_ptr<base::Value> arg) { |
| 342 std::unique_ptr<base::ListValue> args(new base::ListValue()); | 342 std::unique_ptr<base::ListValue> args(new base::ListValue()); |
| 343 args->Append(std::move(arg)); | 343 args->Append(std::move(arg)); |
| 344 return ResponseValue(new ArgumentListResponseValue(name(), "OneArgument", | 344 return ResponseValue(new ArgumentListResponseValue(name(), "OneArgument", |
| 345 this, std::move(args))); | 345 this, std::move(args))); |
| 346 } | 346 } |
| 347 | 347 |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 634 | 634 |
| 635 ExtensionFunction::ResponseAction SyncExtensionFunction::Run() { | 635 ExtensionFunction::ResponseAction SyncExtensionFunction::Run() { |
| 636 return RespondNow(RunSync() ? ArgumentList(std::move(results_)) | 636 return RespondNow(RunSync() ? ArgumentList(std::move(results_)) |
| 637 : Error(error_)); | 637 : Error(error_)); |
| 638 } | 638 } |
| 639 | 639 |
| 640 // static | 640 // static |
| 641 bool SyncExtensionFunction::ValidationFailure(SyncExtensionFunction* function) { | 641 bool SyncExtensionFunction::ValidationFailure(SyncExtensionFunction* function) { |
| 642 return false; | 642 return false; |
| 643 } | 643 } |
| OLD | NEW |