Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5667)

Unified Diff: chrome/browser/chromeos/login/username_view.cc

Issue 8142026: Revert 104076 - Change std::wstring to string16 for views::Link (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chromeos/login/user_view.cc ('k') | chrome/browser/chromeos/login/web_page_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/login/username_view.cc
===================================================================
--- chrome/browser/chromeos/login/username_view.cc (revision 104083)
+++ chrome/browser/chromeos/login/username_view.cc (working copy)
@@ -4,8 +4,6 @@
#include "chrome/browser/chromeos/login/username_view.h"
-#include <algorithm>
-
#include "base/logging.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/chromeos/login/rounded_view.h"
@@ -27,11 +25,14 @@
const SkColor kLabelBackgoundColor = 0x55000000;
// Holds margin to height ratio.
const double kMarginRatio = 1.0 / 3.0;
+// Holds the frame width for the small shaped username view.
+const SkScalar kSmallShapeFrameWidth = SkIntToScalar(1);
+
} // namespace
UsernameView::UsernameView(const std::wstring& username, bool use_small_shape)
: views::Label(username.empty()
- ? l10n_util::GetStringUTF16(IDS_GUEST) : WideToUTF16Hack(username)),
+ ? UTF16ToWide(l10n_util::GetStringUTF16(IDS_GUEST)) : username),
use_small_shape_(use_small_shape),
is_guest_(username.empty()) {
}
@@ -69,7 +70,7 @@
gfx::Canvas::TEXT_VALIGN_MIDDLE |
gfx::Canvas::NO_ELLIPSIS;
int text_height, text_width;
- gfx::CanvasSkia::SizeStringInt(GetText(), font(),
+ gfx::CanvasSkia::SizeStringInt(WideToUTF16Hack(GetText()), font(),
&text_width, &text_height,
flags);
text_width += margin_width_;
@@ -114,7 +115,7 @@
// Note, direct call of the DrawStringInt method produces the green dots
// along the text perimeter (when the label is place on the white background).
SkColor kInvisibleHaloColor = 0x00000000;
- canvas.DrawStringWithHalo(GetText(), font(), GetColor(),
+ canvas.DrawStringWithHalo(WideToUTF16Hack(GetText()), font(), GetColor(),
kInvisibleHaloColor, bounds.x() + margin_width_,
bounds.y(), bounds.width() - 2 * margin_width_,
bounds.height(), flags);
@@ -143,7 +144,7 @@
void UsernameView::OnLocaleChanged() {
if (is_guest_) {
- SetText(l10n_util::GetStringUTF16(IDS_GUEST));
+ SetText(UTF16ToWide(l10n_util::GetStringUTF16(IDS_GUEST)));
}
// Repaint because the font may have changed.
text_image_.reset();
« no previous file with comments | « chrome/browser/chromeos/login/user_view.cc ('k') | chrome/browser/chromeos/login/web_page_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698