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/ui/views/theme_install_bubble_view.h" | 5 #include "chrome/browser/ui/views/theme_install_bubble_view.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/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/browser/tab_contents/tab_contents.h" | 10 #include "chrome/browser/tab_contents/tab_contents.h" |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 SkIntToScalar(height())); | 128 SkIntToScalar(height())); |
129 SkPath path; | 129 SkPath path; |
130 path.addRoundRect(rect, rad, SkPath::kCW_Direction); | 130 path.addRoundRect(rect, rad, SkPath::kCW_Direction); |
131 canvas->AsCanvasSkia()->drawPath(path, paint); | 131 canvas->AsCanvasSkia()->drawPath(path, paint); |
132 | 132 |
133 int text_width = views::Label::font().GetStringWidth(text_); | 133 int text_width = views::Label::font().GetStringWidth(text_); |
134 gfx::Rect body_bounds(kTextHorizPadding / 2, 0, text_width, height()); | 134 gfx::Rect body_bounds(kTextHorizPadding / 2, 0, text_width, height()); |
135 body_bounds.set_x(MirroredLeftPointForRect(body_bounds)); | 135 body_bounds.set_x(MirroredLeftPointForRect(body_bounds)); |
136 | 136 |
137 SkColor text_color = SK_ColorWHITE; | 137 SkColor text_color = SK_ColorWHITE; |
138 canvas->DrawStringInt(text_, | 138 canvas->DrawStringInt(UTF16ToWideHack(text_), |
139 views::Label::font(), | 139 views::Label::font(), |
140 text_color, | 140 text_color, |
141 body_bounds.x(), | 141 body_bounds.x(), |
142 body_bounds.y(), | 142 body_bounds.y(), |
143 body_bounds.width(), | 143 body_bounds.width(), |
144 body_bounds.height()); | 144 body_bounds.height()); |
145 } | 145 } |
146 | 146 |
147 void ThemeInstallBubbleView::Close() { | 147 void ThemeInstallBubbleView::Close() { |
148 --num_loads_extant_; | 148 --num_loads_extant_; |
(...skipping 12 matching lines...) Expand all Loading... |
161 const NotificationDetails& details) { | 161 const NotificationDetails& details) { |
162 Close(); | 162 Close(); |
163 } | 163 } |
164 | 164 |
165 // static | 165 // static |
166 void ThemeInstallBubbleView::Show(TabContents* tab_contents) { | 166 void ThemeInstallBubbleView::Show(TabContents* tab_contents) { |
167 ++num_loads_extant_; | 167 ++num_loads_extant_; |
168 if (num_loads_extant_ < 2) | 168 if (num_loads_extant_ < 2) |
169 new ThemeInstallBubbleView(tab_contents); | 169 new ThemeInstallBubbleView(tab_contents); |
170 } | 170 } |
OLD | NEW |