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 "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "chrome/common/chrome_notification_types.h" | 8 #include "chrome/common/chrome_notification_types.h" |
9 #include "content/browser/tab_contents/tab_contents.h" | 9 #include "content/browser/tab_contents/tab_contents.h" |
10 #include "content/common/notification_service.h" | 10 #include "content/common/notification_service.h" |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 paint.setStyle(SkPaint::kFill_Style); | 122 paint.setStyle(SkPaint::kFill_Style); |
123 paint.setFlags(SkPaint::kAntiAlias_Flag); | 123 paint.setFlags(SkPaint::kAntiAlias_Flag); |
124 paint.setColor(SK_ColorBLACK); | 124 paint.setColor(SK_ColorBLACK); |
125 | 125 |
126 SkRect rect; | 126 SkRect rect; |
127 rect.set(0, 0, | 127 rect.set(0, 0, |
128 SkIntToScalar(width()), | 128 SkIntToScalar(width()), |
129 SkIntToScalar(height())); | 129 SkIntToScalar(height())); |
130 SkPath path; | 130 SkPath path; |
131 path.addRoundRect(rect, rad, SkPath::kCW_Direction); | 131 path.addRoundRect(rect, rad, SkPath::kCW_Direction); |
132 canvas->AsCanvasSkia()->drawPath(path, paint); | 132 canvas->GetSkCanvas()->drawPath(path, paint); |
133 | 133 |
134 int text_width = views::Label::font().GetStringWidth(text_); | 134 int text_width = views::Label::font().GetStringWidth(text_); |
135 gfx::Rect body_bounds(kTextHorizPadding / 2, 0, text_width, height()); | 135 gfx::Rect body_bounds(kTextHorizPadding / 2, 0, text_width, height()); |
136 body_bounds.set_x(GetMirroredXForRect(body_bounds)); | 136 body_bounds.set_x(GetMirroredXForRect(body_bounds)); |
137 | 137 |
138 SkColor text_color = SK_ColorWHITE; | 138 SkColor text_color = SK_ColorWHITE; |
139 canvas->DrawStringInt(text_, | 139 canvas->DrawStringInt(text_, |
140 views::Label::font(), | 140 views::Label::font(), |
141 text_color, | 141 text_color, |
142 body_bounds.x(), | 142 body_bounds.x(), |
(...skipping 19 matching lines...) Expand all Loading... |
162 const NotificationDetails& details) { | 162 const NotificationDetails& details) { |
163 Close(); | 163 Close(); |
164 } | 164 } |
165 | 165 |
166 // static | 166 // static |
167 void ThemeInstallBubbleView::Show(TabContents* tab_contents) { | 167 void ThemeInstallBubbleView::Show(TabContents* tab_contents) { |
168 ++num_loads_extant_; | 168 ++num_loads_extant_; |
169 if (num_loads_extant_ < 2) | 169 if (num_loads_extant_ < 2) |
170 new ThemeInstallBubbleView(tab_contents); | 170 new ThemeInstallBubbleView(tab_contents); |
171 } | 171 } |
OLD | NEW |