| 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 <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 557 UpdateEngineClient::EmptyUpdateCheckCallback() { | 557 UpdateEngineClient::EmptyUpdateCheckCallback() { |
| 558 return base::Bind(&EmptyUpdateCheckCallbackBody); | 558 return base::Bind(&EmptyUpdateCheckCallbackBody); |
| 559 } | 559 } |
| 560 | 560 |
| 561 // static | 561 // static |
| 562 UpdateEngineClient* UpdateEngineClient::Create( | 562 UpdateEngineClient* UpdateEngineClient::Create( |
| 563 DBusClientImplementationType type) { | 563 DBusClientImplementationType type) { |
| 564 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) | 564 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) |
| 565 return new UpdateEngineClientImpl(); | 565 return new UpdateEngineClientImpl(); |
| 566 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type); | 566 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type); |
| 567 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kTestAutoUpdateUI)) | 567 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 568 switches::kTestAutoUpdateUI)) |
| 568 return new UpdateEngineClientFakeImpl(); | 569 return new UpdateEngineClientFakeImpl(); |
| 569 else | 570 else |
| 570 return new UpdateEngineClientStubImpl(); | 571 return new UpdateEngineClientStubImpl(); |
| 571 } | 572 } |
| 572 | 573 |
| 573 // static | 574 // static |
| 574 bool UpdateEngineClient::IsTargetChannelMoreStable( | 575 bool UpdateEngineClient::IsTargetChannelMoreStable( |
| 575 const std::string& current_channel, | 576 const std::string& current_channel, |
| 576 const std::string& target_channel) { | 577 const std::string& target_channel) { |
| 577 auto cix = std::find(kReleaseChannelsList, | 578 auto cix = std::find(kReleaseChannelsList, |
| 578 kReleaseChannelsList + arraysize(kReleaseChannelsList), | 579 kReleaseChannelsList + arraysize(kReleaseChannelsList), |
| 579 current_channel); | 580 current_channel); |
| 580 auto tix = std::find(kReleaseChannelsList, | 581 auto tix = std::find(kReleaseChannelsList, |
| 581 kReleaseChannelsList + arraysize(kReleaseChannelsList), | 582 kReleaseChannelsList + arraysize(kReleaseChannelsList), |
| 582 target_channel); | 583 target_channel); |
| 583 return tix > cix; | 584 return tix > cix; |
| 584 } | 585 } |
| 585 | 586 |
| 586 } // namespace chromeos | 587 } // namespace chromeos |
| OLD | NEW |