Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "chrome/test/chromedriver/session_commands.h" | 5 #include "chrome/test/chromedriver/session_commands.h" |
| 6 | 6 |
| 7 #include <list> | 7 #include <list> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 600 } | 600 } |
| 601 std::string error_msg; | 601 std::string error_msg; |
| 602 base::FilePath upload; | 602 base::FilePath upload; |
| 603 Status status = UnzipSoleFile(upload_dir, zip_data, &upload); | 603 Status status = UnzipSoleFile(upload_dir, zip_data, &upload); |
| 604 if (status.IsError()) | 604 if (status.IsError()) |
| 605 return Status(kUnknownError, "unable to unzip 'file'", status); | 605 return Status(kUnknownError, "unable to unzip 'file'", status); |
| 606 | 606 |
| 607 value->reset(new base::StringValue(upload.value())); | 607 value->reset(new base::StringValue(upload.value())); |
| 608 return Status(kOk); | 608 return Status(kOk); |
| 609 } | 609 } |
| 610 | |
| 611 Status ExecuteIsAutoReportingEnabled( | |
| 612 Session* session, | |
| 613 const base::DictionaryValue& params, | |
| 614 scoped_ptr<base::Value>* value) { | |
| 615 value->reset(new base::FundamentalValue(session->auto_reporting_enabled)); | |
| 616 return Status(kOk); | |
| 617 } | |
| 618 | |
| 619 Status ExecuteSetAutoReportingEnabled( | |
| 620 Session* session, | |
| 621 const base::DictionaryValue& params, | |
| 622 scoped_ptr<base::Value>* value) { | |
| 623 bool enable; | |
| 624 if (!params.GetBoolean("enable", &enable)) | |
| 625 return Status(kUnknownError, "missing parameter 'enable'"); | |
| 626 session->auto_reporting_enabled = enable; | |
| 627 return ExecuteIsAutoReportingEnabled(session, params, value); | |
|
chrisgao (Use stgao instead)
2014/01/09 22:11:55
Hmm, do we want to return the new value? It seems
samuong
2014/01/16 00:29:28
I thought it might be useful for clients but you'r
| |
| 628 } | |
| OLD | NEW |