Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(148)

Unified Diff: chromeos/dbus/update_engine_client.cc

Issue 614363002: Added Aura notification that relaunch and powerwash is required in case of downgrade. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Refactoring of SystemTrayDelegate(Windows|Linux) is delayed. Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chromeos/dbus/update_engine_client.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/dbus/update_engine_client.cc
diff --git a/chromeos/dbus/update_engine_client.cc b/chromeos/dbus/update_engine_client.cc
index ad6e7a39c05b7618ea1c6fc983c9225d528579f1..6a777b5cfca8906684835c21fe4c571446fa1197 100644
--- a/chromeos/dbus/update_engine_client.cc
+++ b/chromeos/dbus/update_engine_client.cc
@@ -4,9 +4,12 @@
#include "chromeos/dbus/update_engine_client.h"
+#include <algorithm>
+
#include "base/bind.h"
#include "base/callback.h"
#include "base/command_line.h"
+#include "base/macros.h"
#include "base/message_loop/message_loop.h"
#include "base/strings/string_util.h"
#include "chromeos/chromeos_switches.h"
@@ -24,6 +27,11 @@ const char kReleaseChannelDev[] = "dev-channel";
const char kReleaseChannelBeta[] = "beta-channel";
const char kReleaseChannelStable[] = "stable-channel";
+// List of release channels ordered by stability.
+const char* kReleaseChannelsList[] = {kReleaseChannelDev,
+ kReleaseChannelBeta,
+ kReleaseChannelStable};
+
// Delay between successive state transitions during AU.
const int kStateTransitionDefaultDelayMs = 3000;
@@ -66,9 +74,8 @@ void EmptyUpdateCheckCallbackBody(
}
bool IsValidChannel(const std::string& channel) {
- return channel == kReleaseChannelDev ||
- channel == kReleaseChannelBeta ||
- channel == kReleaseChannelStable;
+ return channel == kReleaseChannelDev || channel == kReleaseChannelBeta ||
+ channel == kReleaseChannelStable;
}
} // namespace
@@ -561,4 +568,17 @@ UpdateEngineClient* UpdateEngineClient::Create(
return new UpdateEngineClientStubImpl();
}
+// static
+bool UpdateEngineClient::IsTargetChannelMoreStable(
+ const std::string& current_channel,
+ const std::string& target_channel) {
+ auto cix = std::find(kReleaseChannelsList,
+ kReleaseChannelsList + arraysize(kReleaseChannelsList),
+ current_channel);
+ auto tix = std::find(kReleaseChannelsList,
+ kReleaseChannelsList + arraysize(kReleaseChannelsList),
+ target_channel);
+ return tix > cix;
+}
+
} // namespace chromeos
« no previous file with comments | « chromeos/dbus/update_engine_client.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698