| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/oobe_progress_bar.h" | 5 #include "chrome/browser/chromeos/login/oobe_progress_bar.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "grit/theme_resources.h" | 9 #include "grit/theme_resources.h" |
| 10 #include "third_party/skia/include/core/SkBitmap.h" | 10 #include "third_party/skia/include/core/SkBitmap.h" |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 canvas->TileImageInt(*line_, ix, y + line_offset_y, | 112 canvas->TileImageInt(*line_, ix, y + line_offset_y, |
| 113 next_x - ix, line_->height()); | 113 next_x - ix, line_->height()); |
| 114 } | 114 } |
| 115 | 115 |
| 116 string16 str = l10n_util::GetStringUTF16(steps_[i]); | 116 string16 str = l10n_util::GetStringUTF16(steps_[i]); |
| 117 canvas->DrawStringInt(str, font_, color, | 117 canvas->DrawStringInt(str, font_, color, |
| 118 x + kTextPadding, y + dot->height() + kTextPadding, | 118 x + kTextPadding, y + dot->height() + kTextPadding, |
| 119 (next_x - x - 2 * kTextPadding), | 119 (next_x - x - 2 * kTextPadding), |
| 120 (bounds.height() - dot->height() - 2 * kTextPadding), | 120 (bounds.height() - dot->height() - 2 * kTextPadding), |
| 121 gfx::Canvas::MULTI_LINE | gfx::Canvas::TEXT_ALIGN_CENTER | | 121 gfx::Canvas::MULTI_LINE | gfx::Canvas::TEXT_ALIGN_CENTER | |
| 122 gfx::Canvas::TEXT_VALIGN_TOP); | 122 gfx::Canvas::TEXT_VALIGN_TOP | gfx::Canvas::NO_ELLIPSIS); |
| 123 | 123 |
| 124 x = next_x; | 124 x = next_x; |
| 125 } | 125 } |
| 126 } | 126 } |
| 127 | 127 |
| 128 void OobeProgressBar::OnLocaleChanged() { | 128 void OobeProgressBar::OnLocaleChanged() { |
| 129 font_ = ResourceBundle::GetSharedInstance().GetFont(ResourceBundle::BaseFont); | 129 font_ = ResourceBundle::GetSharedInstance().GetFont(ResourceBundle::BaseFont); |
| 130 SchedulePaint(); | 130 SchedulePaint(); |
| 131 } | 131 } |
| 132 | 132 |
| 133 void OobeProgressBar::SetStep(int step) { | 133 void OobeProgressBar::SetStep(int step) { |
| 134 for (size_t i = 0; i < steps_.size(); ++i) { | 134 for (size_t i = 0; i < steps_.size(); ++i) { |
| 135 if (steps_[i] == step) { | 135 if (steps_[i] == step) { |
| 136 progress_ = i; | 136 progress_ = i; |
| 137 SchedulePaint(); | 137 SchedulePaint(); |
| 138 return; | 138 return; |
| 139 } | 139 } |
| 140 } | 140 } |
| 141 NOTREACHED(); | 141 NOTREACHED(); |
| 142 } | 142 } |
| 143 | 143 |
| 144 } // namespace chromeos | 144 } // namespace chromeos |
| OLD | NEW |