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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/chromeos/cros/cellular_data_plan.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2012 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 CHROME_BROWSER_CHROMEOS_CROS_CELLULAR_DATA_PLAN_H_
6 #define CHROME_BROWSER_CHROMEOS_CROS_CELLULAR_DATA_PLAN_H_
7
8 #include <string>
9
10 #include "base/memory/scoped_vector.h"
11 #include "base/string16.h"
12 #include "base/time.h"
13 #include "third_party/cros/chromeos_network.h"
14
15 namespace chromeos {
16
17 // Cellular network is considered low data when less than 60 minues.
18 extern const int kCellularDataLowSecs;
19
20 // Cellular network is considered low data when less than 30 minues.
21 extern const int kCellularDataVeryLowSecs;
22
23 // Cellular network is considered low data when less than 100MB.
24 extern const int kCellularDataLowBytes;
25
26 // Cellular network is considered very low data when less than 50MB.
27 extern const int kCellularDataVeryLowBytes;
28
29 class CellularDataPlan {
30 public:
31 CellularDataPlan();
32 explicit CellularDataPlan(const CellularDataPlanInfo &plan);
33 ~CellularDataPlan();
34
35 // Formats cellular plan description.
36 string16 GetPlanDesciption() const;
37 // Evaluates cellular plans status and returns warning string if it is near
38 // expiration.
39 string16 GetRemainingWarning() const;
40 // Formats remaining plan data description.
41 string16 GetDataRemainingDesciption() const;
42 // Formats plan expiration description.
43 string16 GetPlanExpiration() const;
44 // Formats plan usage info.
45 string16 GetUsageInfo() const;
46 // Returns a unique string for this plan that can be used for comparisons.
47 std::string GetUniqueIdentifier() const;
48 base::TimeDelta remaining_time() const;
49 int64 remaining_minutes() const;
50 // Returns plan data remaining in bytes.
51 int64 remaining_data() const;
52 // TODO(stevenjb): Make these private with accessors and properly named.
53 std::string plan_name;
54 CellularDataPlanType plan_type;
55 base::Time update_time;
56 base::Time plan_start_time;
57 base::Time plan_end_time;
58 int64 plan_data_bytes;
59 int64 data_bytes_used;
60 };
61
62 typedef ScopedVector<CellularDataPlan> CellularDataPlanVector;
63
64 } // namespace chromeos
65
66 #endif // CHROME_BROWSER_CHROMEOS_CROS_CELLULAR_DATA_PLAN_H_
OLDNEW
« 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