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

Side by Side Diff: chrome/browser/chromeos/cros/network_library.cc

Issue 6370010: Fix bug where when the 3G data plan is unknown, we show a green 3G badge. We ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chromeos/cros/network_library.h" 5 #include "chrome/browser/chromeos/cros/network_library.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <map> 8 #include <map>
9 9
10 #include "app/l10n_util.h" 10 #include "app/l10n_util.h"
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after
608 } 608 }
609 return significant; 609 return significant;
610 } 610 }
611 611
612 CellularNetwork::DataLeft CellularNetwork::GetDataLeft() const { 612 CellularNetwork::DataLeft CellularNetwork::GetDataLeft() const {
613 // If we need a new plan, then there's no data. 613 // If we need a new plan, then there's no data.
614 if (needs_new_plan()) 614 if (needs_new_plan())
615 return DATA_NONE; 615 return DATA_NONE;
616 const CellularDataPlan* plan = GetSignificantDataPlan(); 616 const CellularDataPlan* plan = GetSignificantDataPlan();
617 if (!plan) 617 if (!plan)
618 return DATA_NORMAL; 618 return DATA_UNKNOWN;
619 if (plan->plan_type == CELLULAR_DATA_PLAN_UNLIMITED) { 619 if (plan->plan_type == CELLULAR_DATA_PLAN_UNLIMITED) {
620 base::TimeDelta remaining = plan->remaining_time(); 620 base::TimeDelta remaining = plan->remaining_time();
621 if (remaining <= base::TimeDelta::FromSeconds(0)) 621 if (remaining <= base::TimeDelta::FromSeconds(0))
622 return DATA_NONE; 622 return DATA_NONE;
623 if (remaining <= base::TimeDelta::FromSeconds(kCellularDataVeryLowSecs)) 623 if (remaining <= base::TimeDelta::FromSeconds(kCellularDataVeryLowSecs))
624 return DATA_VERY_LOW; 624 return DATA_VERY_LOW;
625 if (remaining <= base::TimeDelta::FromSeconds(kCellularDataLowSecs)) 625 if (remaining <= base::TimeDelta::FromSeconds(kCellularDataLowSecs))
626 return DATA_LOW; 626 return DATA_LOW;
627 } else if (plan->plan_type == CELLULAR_DATA_PLAN_METERED_PAID || 627 } else if (plan->plan_type == CELLULAR_DATA_PLAN_METERED_PAID ||
628 plan->plan_type == CELLULAR_DATA_PLAN_METERED_BASE) { 628 plan->plan_type == CELLULAR_DATA_PLAN_METERED_BASE) {
(...skipping 1415 matching lines...) Expand 10 before | Expand all | Expand 10 after
2044 return new NetworkLibraryStubImpl(); 2044 return new NetworkLibraryStubImpl();
2045 else 2045 else
2046 return new NetworkLibraryImpl(); 2046 return new NetworkLibraryImpl();
2047 } 2047 }
2048 2048
2049 } // namespace chromeos 2049 } // namespace chromeos
2050 2050
2051 // Allows InvokeLater without adding refcounting. This class is a Singleton and 2051 // Allows InvokeLater without adding refcounting. This class is a Singleton and
2052 // won't be deleted until it's last InvokeLater is run. 2052 // won't be deleted until it's last InvokeLater is run.
2053 DISABLE_RUNNABLE_METHOD_REFCOUNT(chromeos::NetworkLibraryImpl); 2053 DISABLE_RUNNABLE_METHOD_REFCOUNT(chromeos::NetworkLibraryImpl);
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/cros/network_library.h ('k') | chrome/browser/chromeos/status/network_menu.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698