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

Unified Diff: chrome/browser/chromeos/cros/cellular_data_plan.h

Issue 10207006: Move CellularDataPlanInfo to CellularDataPlan conversion code to cros_network_functions.cc (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 8 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 | « no previous file | chrome/browser/chromeos/cros/cellular_data_plan.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_
« no previous file with comments | « no previous file | chrome/browser/chromeos/cros/cellular_data_plan.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698