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 <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
593 UpdateEngineClient::UpdateCheckCallback | 593 UpdateEngineClient::UpdateCheckCallback |
594 UpdateEngineClient::EmptyUpdateCheckCallback() { | 594 UpdateEngineClient::EmptyUpdateCheckCallback() { |
595 return base::Bind(&EmptyUpdateCheckCallbackBody); | 595 return base::Bind(&EmptyUpdateCheckCallbackBody); |
596 } | 596 } |
597 | 597 |
598 // static | 598 // static |
599 UpdateEngineClient* UpdateEngineClient::Create( | 599 UpdateEngineClient* UpdateEngineClient::Create( |
600 DBusClientImplementationType type) { | 600 DBusClientImplementationType type) { |
601 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) | 601 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) |
602 return new UpdateEngineClientImpl(); | 602 return new UpdateEngineClientImpl(); |
603 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type); | 603 DCHECK_EQ(FAKE_DBUS_CLIENT_IMPLEMENTATION, type); |
604 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 604 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
605 switches::kTestAutoUpdateUI)) | 605 switches::kTestAutoUpdateUI)) |
606 return new UpdateEngineClientFakeImpl(); | 606 return new UpdateEngineClientFakeImpl(); |
607 else | 607 else |
608 return new UpdateEngineClientStubImpl(); | 608 return new UpdateEngineClientStubImpl(); |
609 } | 609 } |
610 | 610 |
611 // static | 611 // static |
612 bool UpdateEngineClient::IsTargetChannelMoreStable( | 612 bool UpdateEngineClient::IsTargetChannelMoreStable( |
613 const std::string& current_channel, | 613 const std::string& current_channel, |
614 const std::string& target_channel) { | 614 const std::string& target_channel) { |
615 const char** cix = std::find( | 615 const char** cix = std::find( |
616 kReleaseChannelsList, | 616 kReleaseChannelsList, |
617 kReleaseChannelsList + arraysize(kReleaseChannelsList), current_channel); | 617 kReleaseChannelsList + arraysize(kReleaseChannelsList), current_channel); |
618 const char** tix = std::find( | 618 const char** tix = std::find( |
619 kReleaseChannelsList, | 619 kReleaseChannelsList, |
620 kReleaseChannelsList + arraysize(kReleaseChannelsList), target_channel); | 620 kReleaseChannelsList + arraysize(kReleaseChannelsList), target_channel); |
621 return tix > cix; | 621 return tix > cix; |
622 } | 622 } |
623 | 623 |
624 } // namespace chromeos | 624 } // namespace chromeos |
OLD | NEW |