Index: chrome/browser/chromeos/cros/cellular_data_plan.h |
diff --git a/chrome/browser/chromeos/cros/cellular_data_plan.h b/chrome/browser/chromeos/cros/cellular_data_plan.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..2f45bc46380a96ced8049d719311b01f0b20f437 |
--- /dev/null |
+++ b/chrome/browser/chromeos/cros/cellular_data_plan.h |
@@ -0,0 +1,66 @@ |
+// Copyright (c) 2012 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 CHROME_BROWSER_CHROMEOS_CROS_CELLULAR_DATA_PLAN_H_ |
+#define CHROME_BROWSER_CHROMEOS_CROS_CELLULAR_DATA_PLAN_H_ |
+ |
+#include <string> |
+ |
+#include "base/memory/scoped_vector.h" |
+#include "base/string16.h" |
+#include "base/time.h" |
+#include "third_party/cros/chromeos_network.h" |
+ |
+namespace chromeos { |
+ |
+// Cellular network is considered low data when less than 60 minues. |
+extern const int kCellularDataLowSecs; |
+ |
+// Cellular network is considered low data when less than 30 minues. |
+extern const int kCellularDataVeryLowSecs; |
+ |
+// Cellular network is considered low data when less than 100MB. |
+extern const int kCellularDataLowBytes; |
+ |
+// Cellular network is considered very low data when less than 50MB. |
+extern const int kCellularDataVeryLowBytes; |
+ |
+class CellularDataPlan { |
+ public: |
+ CellularDataPlan(); |
+ explicit CellularDataPlan(const CellularDataPlanInfo &plan); |
+ ~CellularDataPlan(); |
+ |
+ // Formats cellular plan description. |
+ string16 GetPlanDesciption() const; |
+ // Evaluates cellular plans status and returns warning string if it is near |
+ // expiration. |
+ string16 GetRemainingWarning() const; |
+ // Formats remaining plan data description. |
+ string16 GetDataRemainingDesciption() const; |
+ // Formats plan expiration description. |
+ string16 GetPlanExpiration() const; |
+ // Formats plan usage info. |
+ string16 GetUsageInfo() const; |
+ // Returns a unique string for this plan that can be used for comparisons. |
+ std::string GetUniqueIdentifier() const; |
+ base::TimeDelta remaining_time() const; |
+ int64 remaining_minutes() const; |
+ // Returns plan data remaining in bytes. |
+ int64 remaining_data() const; |
+ // TODO(stevenjb): Make these private with accessors and properly named. |
+ std::string plan_name; |
+ CellularDataPlanType plan_type; |
+ base::Time update_time; |
+ base::Time plan_start_time; |
+ base::Time plan_end_time; |
+ int64 plan_data_bytes; |
+ int64 data_bytes_used; |
+}; |
+ |
+typedef ScopedVector<CellularDataPlan> CellularDataPlanVector; |
+ |
+} // namespace chromeos |
+ |
+#endif // CHROME_BROWSER_CHROMEOS_CROS_CELLULAR_DATA_PLAN_H_ |