| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/browser/chromeos/policy/remote_commands/device_command_screensh
ot_job.h" | 5 #include "chrome/browser/chromeos/policy/remote_commands/device_command_screensh
ot_job.h" |
| 6 | 6 |
| 7 #include <fstream> | 7 #include <fstream> |
| 8 | 8 |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 } | 106 } |
| 107 | 107 |
| 108 void DeviceCommandScreenshotJob::OnSuccess() { | 108 void DeviceCommandScreenshotJob::OnSuccess() { |
| 109 base::ThreadTaskRunnerHandle::Get()->PostTask( | 109 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 110 FROM_HERE, | 110 FROM_HERE, |
| 111 base::Bind(succeeded_callback_, | 111 base::Bind(succeeded_callback_, |
| 112 base::Passed(make_scoped_ptr(new Payload(SUCCESS))))); | 112 base::Passed(make_scoped_ptr(new Payload(SUCCESS))))); |
| 113 } | 113 } |
| 114 | 114 |
| 115 void DeviceCommandScreenshotJob::OnFailure(UploadJob::ErrorCode error_code) { | 115 void DeviceCommandScreenshotJob::OnFailure(UploadJob::ErrorCode error_code) { |
| 116 ResultCode result_code; | 116 ResultCode result_code = FAILURE_CLIENT; |
| 117 switch (error_code) { | 117 switch (error_code) { |
| 118 case UploadJob::AUTHENTICATION_ERROR: | 118 case UploadJob::AUTHENTICATION_ERROR: |
| 119 result_code = FAILURE_AUTHENTICATION; | 119 result_code = FAILURE_AUTHENTICATION; |
| 120 break; | 120 break; |
| 121 case UploadJob::NETWORK_ERROR: | 121 case UploadJob::NETWORK_ERROR: |
| 122 case UploadJob::SERVER_ERROR: | 122 case UploadJob::SERVER_ERROR: |
| 123 result_code = FAILURE_SERVER; | 123 result_code = FAILURE_SERVER; |
| 124 break; | 124 break; |
| 125 case UploadJob::CONTENT_ENCODING_ERROR: | 125 case UploadJob::CONTENT_ENCODING_ERROR: |
| 126 result_code = FAILURE_CLIENT; | 126 result_code = FAILURE_CLIENT; |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 weak_ptr_factory_.GetWeakPtr(), screen), | 234 weak_ptr_factory_.GetWeakPtr(), screen), |
| 235 base::ThreadTaskRunnerHandle::Get())); | 235 base::ThreadTaskRunnerHandle::Get())); |
| 236 } | 236 } |
| 237 } | 237 } |
| 238 | 238 |
| 239 void DeviceCommandScreenshotJob::TerminateImpl() { | 239 void DeviceCommandScreenshotJob::TerminateImpl() { |
| 240 weak_ptr_factory_.InvalidateWeakPtrs(); | 240 weak_ptr_factory_.InvalidateWeakPtrs(); |
| 241 } | 241 } |
| 242 | 242 |
| 243 } // namespace policy | 243 } // namespace policy |
| OLD | NEW |