| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "views/controls/throbber.h" | 5 #include "views/controls/throbber.h" |
| 6 | 6 |
| 7 #include "base/time.h" | 7 #include "base/time.h" |
| 8 #include "grit/app_resources.h" | 8 #include "grit/app_resources.h" |
| 9 #include "third_party/skia/include/core/SkBitmap.h" | 9 #include "third_party/skia/include/core/SkBitmap.h" |
| 10 #include "ui/base/resource/resource_bundle.h" | 10 #include "ui/base/resource/resource_bundle.h" |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 // Delay after work stops before stopping, in milliseconds. | 97 // Delay after work stops before stopping, in milliseconds. |
| 98 static const int kStopDelay = 50; | 98 static const int kStopDelay = 50; |
| 99 | 99 |
| 100 | 100 |
| 101 SmoothedThrobber::SmoothedThrobber(int frame_time_ms) | 101 SmoothedThrobber::SmoothedThrobber(int frame_time_ms) |
| 102 : Throbber(frame_time_ms, /* paint_while_stopped= */ false), | 102 : Throbber(frame_time_ms, /* paint_while_stopped= */ false), |
| 103 start_delay_ms_(kStartDelay), | 103 start_delay_ms_(kStartDelay), |
| 104 stop_delay_ms_(kStopDelay) { | 104 stop_delay_ms_(kStopDelay) { |
| 105 } | 105 } |
| 106 | 106 |
| 107 SmoothedThrobber::~SmoothedThrobber() {} |
| 108 |
| 107 void SmoothedThrobber::Start() { | 109 void SmoothedThrobber::Start() { |
| 108 stop_timer_.Stop(); | 110 stop_timer_.Stop(); |
| 109 | 111 |
| 110 if (!running_ && !start_timer_.IsRunning()) { | 112 if (!running_ && !start_timer_.IsRunning()) { |
| 111 start_timer_.Start(TimeDelta::FromMilliseconds(start_delay_ms_), this, | 113 start_timer_.Start(TimeDelta::FromMilliseconds(start_delay_ms_), this, |
| 112 &SmoothedThrobber::StartDelayOver); | 114 &SmoothedThrobber::StartDelayOver); |
| 113 } | 115 } |
| 114 } | 116 } |
| 115 | 117 |
| 116 void SmoothedThrobber::StartDelayOver() { | 118 void SmoothedThrobber::StartDelayOver() { |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 169 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
| 168 checkmark_ = rb.GetBitmapNamed(IDR_INPUT_GOOD); | 170 checkmark_ = rb.GetBitmapNamed(IDR_INPUT_GOOD); |
| 169 initialized = true; | 171 initialized = true; |
| 170 } | 172 } |
| 171 } | 173 } |
| 172 | 174 |
| 173 // static | 175 // static |
| 174 SkBitmap* CheckmarkThrobber::checkmark_ = NULL; | 176 SkBitmap* CheckmarkThrobber::checkmark_ = NULL; |
| 175 | 177 |
| 176 } // namespace views | 178 } // namespace views |
| OLD | NEW |