| OLD | NEW |
| 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/login/oobe_progress_bar.h" | 5 #include "chrome/browser/chromeos/login/oobe_progress_bar.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 | 104 |
| 105 if (i != steps_.size() - 1) | 105 if (i != steps_.size() - 1) |
| 106 canvas->DrawBitmapInt(*line_after, ix, y + line_offset_y); | 106 canvas->DrawBitmapInt(*line_after, ix, y + line_offset_y); |
| 107 ix += line_after->width(); | 107 ix += line_after->width(); |
| 108 | 108 |
| 109 if (i != steps_.size() - 1) { | 109 if (i != steps_.size() - 1) { |
| 110 canvas->TileImageInt(*line_, ix, y + line_offset_y, | 110 canvas->TileImageInt(*line_, ix, y + line_offset_y, |
| 111 next_x - ix, line_->height()); | 111 next_x - ix, line_->height()); |
| 112 } | 112 } |
| 113 | 113 |
| 114 string16 str = l10n_util::GetStringUTF16(steps_[i]); | 114 std::wstring str = UTF16ToWide(l10n_util::GetStringUTF16(steps_[i])); |
| 115 canvas->DrawStringInt(str, font_, color, | 115 canvas->DrawStringInt(str, font_, color, |
| 116 x + kTextPadding, y + dot->height() + kTextPadding, | 116 x + kTextPadding, y + dot->height() + kTextPadding, |
| 117 (next_x - x - 2 * kTextPadding), | 117 (next_x - x - 2 * kTextPadding), |
| 118 (bounds.height() - dot->height() - 2 * kTextPadding), | 118 (bounds.height() - dot->height() - 2 * kTextPadding), |
| 119 gfx::Canvas::MULTI_LINE | gfx::Canvas::TEXT_ALIGN_CENTER | | 119 gfx::Canvas::MULTI_LINE | gfx::Canvas::TEXT_ALIGN_CENTER | |
| 120 gfx::Canvas::TEXT_VALIGN_TOP); | 120 gfx::Canvas::TEXT_VALIGN_TOP); |
| 121 | 121 |
| 122 x = next_x; | 122 x = next_x; |
| 123 } | 123 } |
| 124 } | 124 } |
| 125 | 125 |
| 126 void OobeProgressBar::OnLocaleChanged() { | 126 void OobeProgressBar::OnLocaleChanged() { |
| 127 SchedulePaint(); | 127 SchedulePaint(); |
| 128 } | 128 } |
| 129 | 129 |
| 130 void OobeProgressBar::SetStep(int step) { | 130 void OobeProgressBar::SetStep(int step) { |
| 131 for (size_t i = 0; i < steps_.size(); ++i) { | 131 for (size_t i = 0; i < steps_.size(); ++i) { |
| 132 if (steps_[i] == step) { | 132 if (steps_[i] == step) { |
| 133 progress_ = i; | 133 progress_ = i; |
| 134 SchedulePaint(); | 134 SchedulePaint(); |
| 135 return; | 135 return; |
| 136 } | 136 } |
| 137 } | 137 } |
| 138 NOTREACHED(); | 138 NOTREACHED(); |
| 139 } | 139 } |
| 140 | 140 |
| 141 } // namespace chromeos | 141 } // namespace chromeos |
| OLD | NEW |