OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROMECAST_CRASH_APP_STATE_TRACKER_H_ |
| 6 #define CHROMECAST_CRASH_APP_STATE_TRACKER_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 namespace chromecast { |
| 11 |
| 12 class AppStateTracker { |
| 13 public: |
| 14 // Record |app_id| as the last app that attempted to launch. |
| 15 static void SetLastLaunchedApp(const std::string& app_id); |
| 16 |
| 17 // The current app becomes the previous app, |app_id| becomes the current app. |
| 18 static void SetCurrentApp(const std::string& app_id); |
| 19 |
| 20 // Returns the id of the app that was last attempted to launch. |
| 21 static std::string GetLastLaunchedApp(); |
| 22 |
| 23 // Returns the id of the active app. |
| 24 static std::string GetCurrentApp(); |
| 25 |
| 26 // Returns the id of the app which was previously active. |
| 27 static std::string GetPreviousApp(); |
| 28 }; |
| 29 |
| 30 } // namespace chromecast |
| 31 |
| 32 #endif // CHROMECAST_CRASH_APP_STATE_TRACKER_H_ |
OLD | NEW |