| 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/login/screens/update_screen.h" | 5 #include "chrome/browser/chromeos/login/screens/update_screen.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 // TODO(nkostylev): Animate progress during each state. | 34 // TODO(nkostylev): Animate progress during each state. |
| 35 const int kBeforeUpdateCheckProgress = 7; | 35 const int kBeforeUpdateCheckProgress = 7; |
| 36 const int kBeforeDownloadProgress = 14; | 36 const int kBeforeDownloadProgress = 14; |
| 37 const int kBeforeVerifyingProgress = 74; | 37 const int kBeforeVerifyingProgress = 74; |
| 38 const int kBeforeFinalizingProgress = 81; | 38 const int kBeforeFinalizingProgress = 81; |
| 39 const int kProgressComplete = 100; | 39 const int kProgressComplete = 100; |
| 40 | 40 |
| 41 // Defines what part of update progress does download part takes. | 41 // Defines what part of update progress does download part takes. |
| 42 const int kDownloadProgressIncrement = 60; | 42 const int kDownloadProgressIncrement = 60; |
| 43 | 43 |
| 44 // Considering 10px shadow from each side. | |
| 45 const int kUpdateScreenWidth = 580; | |
| 46 const int kUpdateScreenHeight = 305; | |
| 47 | |
| 48 const char kUpdateDeadlineFile[] = "/tmp/update-check-response-deadline"; | 44 const char kUpdateDeadlineFile[] = "/tmp/update-check-response-deadline"; |
| 49 | 45 |
| 50 // Minimum timestep between two consecutive measurements for the | 46 // Minimum timestep between two consecutive measurements for the |
| 51 // download rate. | 47 // download rate. |
| 52 const base::TimeDelta kMinTimeStep = base::TimeDelta::FromSeconds(1); | 48 const base::TimeDelta kMinTimeStep = base::TimeDelta::FromSeconds(1); |
| 53 | 49 |
| 54 // Minimum allowed progress between two consecutive ETAs. | |
| 55 const double kMinProgressStep = 1e-3; | |
| 56 | |
| 57 // Smooth factor that is used for the average downloading speed | 50 // Smooth factor that is used for the average downloading speed |
| 58 // estimation. | 51 // estimation. |
| 59 // avg_speed = smooth_factor * cur_speed + (1.0 - smooth_factor) * avg_speed. | 52 // avg_speed = smooth_factor * cur_speed + (1.0 - smooth_factor) * avg_speed. |
| 60 const double kDownloadSpeedSmoothFactor = 0.1; | 53 const double kDownloadSpeedSmoothFactor = 0.1; |
| 61 | 54 |
| 62 // Minumum allowed value for the average downloading speed. | 55 // Minumum allowed value for the average downloading speed. |
| 63 const double kDownloadAverageSpeedDropBound = 1e-8; | 56 const double kDownloadAverageSpeedDropBound = 1e-8; |
| 64 | 57 |
| 65 // An upper bound for possible downloading time left estimations. | 58 // An upper bound for possible downloading time left estimations. |
| 66 const double kMaxTimeLeft = 24 * 60 * 60; | 59 const double kMaxTimeLeft = 24 * 60 * 60; |
| (...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 539 GetErrorScreen()->SetErrorState(ErrorScreen::ERROR_STATE_PROXY, | 532 GetErrorScreen()->SetErrorState(ErrorScreen::ERROR_STATE_PROXY, |
| 540 std::string()); | 533 std::string()); |
| 541 break; | 534 break; |
| 542 default: | 535 default: |
| 543 NOTREACHED(); | 536 NOTREACHED(); |
| 544 break; | 537 break; |
| 545 } | 538 } |
| 546 } | 539 } |
| 547 | 540 |
| 548 } // namespace chromeos | 541 } // namespace chromeos |
| OLD | NEW |