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

Unified Diff: chrome/browser/chromeos/cros/network_library.cc

Issue 3923002: Revert 63135 - Update icons to show lowdata and very lowdata for 3G data.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 2 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
Index: chrome/browser/chromeos/cros/network_library.cc
===================================================================
--- chrome/browser/chromeos/cros/network_library.cc (revision 63144)
+++ chrome/browser/chromeos/cros/network_library.cc (working copy)
@@ -264,35 +264,6 @@
network_technology_ != NETWORK_TECHNOLOGY_UNKNOWN;
}
-CellularNetwork::DataLeft CellularNetwork::data_left() const {
- if (data_plans_.empty())
- return DATA_NORMAL;
- CellularDataPlan plan = data_plans_[0];
- if (plan.plan_type == CELLULAR_DATA_PLAN_UNLIMITED) {
- int64 remaining = plan.plan_end_time - plan.update_time;
- if (remaining <= 0)
- return DATA_NONE;
- else if (remaining <= kCellularDataVeryLowSecs)
- return DATA_VERY_LOW;
- else if (remaining <= kCellularDataLowSecs)
- return DATA_LOW;
- else
- return DATA_NORMAL;
- } else if (plan.plan_type == CELLULAR_DATA_PLAN_METERED_PAID ||
- plan.plan_type == CELLULAR_DATA_PLAN_METERED_BASE) {
- int64 remaining = plan.plan_data_bytes - plan.data_bytes_used;
- if (remaining <= 0)
- return DATA_NONE;
- else if (remaining <= kCellularDataVeryLowBytes)
- return DATA_VERY_LOW;
- else if (remaining <= kCellularDataLowBytes)
- return DATA_LOW;
- else
- return DATA_NORMAL;
- }
- return DATA_NORMAL;
-}
-
std::string CellularNetwork::GetNetworkTechnologyString() const {
// No need to localize these cellular technology abbreviations.
switch (network_technology_) {
@@ -1025,9 +996,7 @@
test_plan.plan_type = CELLULAR_DATA_PLAN_METERED_PAID;
test_plan.update_time = base::Time::Now().ToInternalValue() /
base::Time::kMicrosecondsPerSecond;
- chromeos::CellularDataPlanList test_plans;
- test_plans.push_back(test_plan);
- cellular_.SetDataPlans(test_plans);
+ cellular_data_plans_.push_back(test_plan);
}
void UpdateSystemInfo() {
@@ -1086,7 +1055,9 @@
}
void NotifyCellularDataPlanChanged() {
- FOR_EACH_OBSERVER(Observer, observers_, CellularDataPlanChanged(this));
+ FOR_EACH_OBSERVER(Observer, observers_,
+ CellularDataPlanChanged(cellular_.service_path(),
+ cellular_data_plans_));
}
void UpdateNetworkStatus() {
@@ -1142,7 +1113,7 @@
}
void UpdateCellularDataPlan(const CellularDataPlanList& data_plans) {
- cellular_.SetDataPlans(data_plans);
+ cellular_data_plans_ = data_plans;
NotifyCellularDataPlanChanged();
}
@@ -1172,6 +1143,9 @@
// The current connected (or connecting) cellular network.
CellularNetwork cellular_;
+ // The data plan for the current cellular network.
+ CellularDataPlanList cellular_data_plans_;
+
// The remembered cellular networks.
CellularNetworkVector remembered_cellular_networks_;
« no previous file with comments | « chrome/browser/chromeos/cros/network_library.h ('k') | chrome/browser/chromeos/dom_ui/internet_options_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698