OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chromeos/dbus/update_engine_client.h" | 5 #include "chromeos/dbus/update_engine_client.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 // during fake AU. | 31 // during fake AU. |
32 const int kStateTransitionDownloadingDelayMs = 250; | 32 const int kStateTransitionDownloadingDelayMs = 250; |
33 | 33 |
34 // Size of parts of a "new" image which are downloaded each | 34 // Size of parts of a "new" image which are downloaded each |
35 // |kStateTransitionDownloadingDelayMs| during fake AU. | 35 // |kStateTransitionDownloadingDelayMs| during fake AU. |
36 const int64_t kDownloadSizeDelta = 1 << 19; | 36 const int64_t kDownloadSizeDelta = 1 << 19; |
37 | 37 |
38 // Returns UPDATE_STATUS_ERROR on error. | 38 // Returns UPDATE_STATUS_ERROR on error. |
39 UpdateEngineClient::UpdateStatusOperation UpdateStatusFromString( | 39 UpdateEngineClient::UpdateStatusOperation UpdateStatusFromString( |
40 const std::string& str) { | 40 const std::string& str) { |
| 41 VLOG(1) << "UpdateStatusFromString got " << str << " as input."; |
41 if (str == update_engine::kUpdateStatusIdle) | 42 if (str == update_engine::kUpdateStatusIdle) |
42 return UpdateEngineClient::UPDATE_STATUS_IDLE; | 43 return UpdateEngineClient::UPDATE_STATUS_IDLE; |
43 if (str == update_engine::kUpdateStatusCheckingForUpdate) | 44 if (str == update_engine::kUpdateStatusCheckingForUpdate) |
44 return UpdateEngineClient::UPDATE_STATUS_CHECKING_FOR_UPDATE; | 45 return UpdateEngineClient::UPDATE_STATUS_CHECKING_FOR_UPDATE; |
45 if (str == update_engine::kUpdateStatusUpdateAvailable) | 46 if (str == update_engine::kUpdateStatusUpdateAvailable) |
46 return UpdateEngineClient::UPDATE_STATUS_UPDATE_AVAILABLE; | 47 return UpdateEngineClient::UPDATE_STATUS_UPDATE_AVAILABLE; |
47 if (str == update_engine::kUpdateStatusDownloading) | 48 if (str == update_engine::kUpdateStatusDownloading) |
48 return UpdateEngineClient::UPDATE_STATUS_DOWNLOADING; | 49 return UpdateEngineClient::UPDATE_STATUS_DOWNLOADING; |
49 if (str == update_engine::kUpdateStatusVerifying) | 50 if (str == update_engine::kUpdateStatusVerifying) |
50 return UpdateEngineClient::UPDATE_STATUS_VERIFYING; | 51 return UpdateEngineClient::UPDATE_STATUS_VERIFYING; |
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
542 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) | 543 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) |
543 return new UpdateEngineClientImpl(); | 544 return new UpdateEngineClientImpl(); |
544 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type); | 545 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type); |
545 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kTestAutoUpdateUI)) | 546 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kTestAutoUpdateUI)) |
546 return new UpdateEngineClientFakeImpl(); | 547 return new UpdateEngineClientFakeImpl(); |
547 else | 548 else |
548 return new UpdateEngineClientStubImpl(); | 549 return new UpdateEngineClientStubImpl(); |
549 } | 550 } |
550 | 551 |
551 } // namespace chromeos | 552 } // namespace chromeos |
OLD | NEW |