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

Unified Diff: chromecast/crash/app_state_tracker.h

Issue 1154383006: Adding crash utilities to chromecast/crash. (Closed) Base URL: https://eureka-internal.googlesource.com/chromium/src@master
Patch Set: cast_shell_unittests not built for android Created 5 years, 6 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 | « chromecast/crash/android/crash_handler.cc ('k') | chromecast/crash/app_state_tracker.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromecast/crash/app_state_tracker.h
diff --git a/chromecast/crash/app_state_tracker.h b/chromecast/crash/app_state_tracker.h
new file mode 100644
index 0000000000000000000000000000000000000000..3df8686c95141908eced0418d01f1c91da4c829a
--- /dev/null
+++ b/chromecast/crash/app_state_tracker.h
@@ -0,0 +1,32 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROMECAST_CRASH_APP_STATE_TRACKER_H_
+#define CHROMECAST_CRASH_APP_STATE_TRACKER_H_
+
+#include <string>
+
+namespace chromecast {
+
+class AppStateTracker {
+ public:
+ // Record |app_id| as the last app that attempted to launch.
+ static void SetLastLaunchedApp(const std::string& app_id);
+
+ // The current app becomes the previous app, |app_id| becomes the current app.
+ static void SetCurrentApp(const std::string& app_id);
+
+ // Returns the id of the app that was last attempted to launch.
+ static std::string GetLastLaunchedApp();
+
+ // Returns the id of the active app.
+ static std::string GetCurrentApp();
+
+ // Returns the id of the app which was previously active.
+ static std::string GetPreviousApp();
+};
+
+} // namespace chromecast
+
+#endif // CHROMECAST_CRASH_APP_STATE_TRACKER_H_
« no previous file with comments | « chromecast/crash/android/crash_handler.cc ('k') | chromecast/crash/app_state_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698