| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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/drive/drive_file_system_util.h" | 5 #include "chrome/browser/chromeos/drive/drive_file_system_util.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 434 case google_apis::GDATA_NO_CONNECTION: | 434 case google_apis::GDATA_NO_CONNECTION: |
| 435 return DRIVE_FILE_ERROR_NO_CONNECTION; | 435 return DRIVE_FILE_ERROR_NO_CONNECTION; |
| 436 case google_apis::HTTP_SERVICE_UNAVAILABLE: | 436 case google_apis::HTTP_SERVICE_UNAVAILABLE: |
| 437 case google_apis::HTTP_INTERNAL_SERVER_ERROR: | 437 case google_apis::HTTP_INTERNAL_SERVER_ERROR: |
| 438 return DRIVE_FILE_ERROR_THROTTLED; | 438 return DRIVE_FILE_ERROR_THROTTLED; |
| 439 default: | 439 default: |
| 440 return DRIVE_FILE_ERROR_FAILED; | 440 return DRIVE_FILE_ERROR_FAILED; |
| 441 } | 441 } |
| 442 } | 442 } |
| 443 | 443 |
| 444 bool IsConnectionTypeCellular() { | |
| 445 bool is_cellular = false; | |
| 446 // Use switch, not if, to allow compiler to catch future enum changes. | |
| 447 // (e.g. Addition of CONNECTION_5G) | |
| 448 switch (net::NetworkChangeNotifier::GetConnectionType()) { | |
| 449 case net::NetworkChangeNotifier::CONNECTION_2G: | |
| 450 case net::NetworkChangeNotifier::CONNECTION_3G: | |
| 451 case net::NetworkChangeNotifier::CONNECTION_4G: | |
| 452 is_cellular = true; | |
| 453 break; | |
| 454 case net::NetworkChangeNotifier::CONNECTION_UNKNOWN: | |
| 455 case net::NetworkChangeNotifier::CONNECTION_ETHERNET: | |
| 456 case net::NetworkChangeNotifier::CONNECTION_WIFI: | |
| 457 case net::NetworkChangeNotifier::CONNECTION_NONE: | |
| 458 is_cellular = false; | |
| 459 break; | |
| 460 } | |
| 461 return is_cellular; | |
| 462 } | |
| 463 | |
| 464 } // namespace util | 444 } // namespace util |
| 465 } // namespace drive | 445 } // namespace drive |
| OLD | NEW |