| 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 "content/browser/tab_contents/tab_contents.h" | 8 #include "content/browser/tab_contents/tab_contents.h" |
| 9 #include "content/common/notification_service.h" | 9 #include "content/common/notification_service.h" |
| 10 #include "grit/generated_resources.h" | 10 #include "grit/generated_resources.h" |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 paint.setStyle(SkPaint::kFill_Style); | 121 paint.setStyle(SkPaint::kFill_Style); |
| 122 paint.setFlags(SkPaint::kAntiAlias_Flag); | 122 paint.setFlags(SkPaint::kAntiAlias_Flag); |
| 123 paint.setColor(SK_ColorBLACK); | 123 paint.setColor(SK_ColorBLACK); |
| 124 | 124 |
| 125 SkRect rect; | 125 SkRect rect; |
| 126 rect.set(0, 0, | 126 rect.set(0, 0, |
| 127 SkIntToScalar(width()), | 127 SkIntToScalar(width()), |
| 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()->skia_canvas()->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(GetMirroredXForRect(body_bounds)); | 135 body_bounds.set_x(GetMirroredXForRect(body_bounds)); |
| 136 | 136 |
| 137 SkColor text_color = SK_ColorWHITE; | 137 SkColor text_color = SK_ColorWHITE; |
| 138 canvas->DrawStringInt(text_, | 138 canvas->DrawStringInt(text_, |
| 139 views::Label::font(), | 139 views::Label::font(), |
| 140 text_color, | 140 text_color, |
| 141 body_bounds.x(), | 141 body_bounds.x(), |
| (...skipping 19 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 |