| 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/create_application_shortcut_view.h" | 5 #include "chrome/browser/ui/views/create_application_shortcut_view.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "base/win/windows_version.h" | 9 #include "base/win/windows_version.h" |
| 10 #include "chrome/browser/extensions/extension_tab_helper.h" | 10 #include "chrome/browser/extensions/extension_tab_helper.h" |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 SkIntToScalar(bounds.x()), | 165 SkIntToScalar(bounds.x()), |
| 166 SkIntToScalar(bounds.y()), | 166 SkIntToScalar(bounds.y()), |
| 167 SkIntToScalar(bounds.right()), | 167 SkIntToScalar(bounds.right()), |
| 168 SkIntToScalar(bounds.bottom()) | 168 SkIntToScalar(bounds.bottom()) |
| 169 }; | 169 }; |
| 170 | 170 |
| 171 SkPaint border_paint; | 171 SkPaint border_paint; |
| 172 border_paint.setAntiAlias(true); | 172 border_paint.setAntiAlias(true); |
| 173 border_paint.setARGB(0xFF, 0xC8, 0xC8, 0xC8); | 173 border_paint.setARGB(0xFF, 0xC8, 0xC8, 0xC8); |
| 174 | 174 |
| 175 canvas->AsCanvasSkia()->drawRoundRect( | 175 canvas->AsCanvasSkia()->skia_canvas()->drawRoundRect( |
| 176 border_rect, SkIntToScalar(2), SkIntToScalar(2), border_paint); | 176 border_rect, SkIntToScalar(2), SkIntToScalar(2), border_paint); |
| 177 | 177 |
| 178 SkRect inner_rect = { | 178 SkRect inner_rect = { |
| 179 border_rect.fLeft + SkDoubleToScalar(0.5), | 179 border_rect.fLeft + SkDoubleToScalar(0.5), |
| 180 border_rect.fTop + SkDoubleToScalar(0.5), | 180 border_rect.fTop + SkDoubleToScalar(0.5), |
| 181 border_rect.fRight - SkDoubleToScalar(0.5), | 181 border_rect.fRight - SkDoubleToScalar(0.5), |
| 182 border_rect.fBottom - SkDoubleToScalar(0.5), | 182 border_rect.fBottom - SkDoubleToScalar(0.5), |
| 183 }; | 183 }; |
| 184 | 184 |
| 185 SkPaint inner_paint; | 185 SkPaint inner_paint; |
| 186 inner_paint.setAntiAlias(true); | 186 inner_paint.setAntiAlias(true); |
| 187 inner_paint.setARGB(0xFF, 0xF8, 0xF8, 0xF8); | 187 inner_paint.setARGB(0xFF, 0xF8, 0xF8, 0xF8); |
| 188 canvas->AsCanvasSkia()->drawRoundRect( | 188 canvas->AsCanvasSkia()->skia_canvas()->drawRoundRect( |
| 189 inner_rect, SkIntToScalar(1.5), SkIntToScalar(1.5), inner_paint); | 189 inner_rect, SkIntToScalar(1.5), SkIntToScalar(1.5), inner_paint); |
| 190 } | 190 } |
| 191 | 191 |
| 192 } // namespace | 192 } // namespace |
| 193 | 193 |
| 194 namespace browser { | 194 namespace browser { |
| 195 | 195 |
| 196 void ShowCreateWebAppShortcutsDialog(gfx::NativeWindow parent_window, | 196 void ShowCreateWebAppShortcutsDialog(gfx::NativeWindow parent_window, |
| 197 TabContentsWrapper* tab_contents) { | 197 TabContentsWrapper* tab_contents) { |
| 198 views::Window::CreateChromeWindow(parent_window, gfx::Rect(), | 198 views::Window::CreateChromeWindow(parent_window, gfx::Rect(), |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 520 void CreateChromeApplicationShortcutView::OnImageLoaded( | 520 void CreateChromeApplicationShortcutView::OnImageLoaded( |
| 521 SkBitmap* image, const ExtensionResource& resource, int index) { | 521 SkBitmap* image, const ExtensionResource& resource, int index) { |
| 522 if (image->isNull()) { | 522 if (image->isNull()) { |
| 523 NOTREACHED() << "Corrupt image in profile?"; | 523 NOTREACHED() << "Corrupt image in profile?"; |
| 524 return; | 524 return; |
| 525 } | 525 } |
| 526 shortcut_info_.favicon = *image; | 526 shortcut_info_.favicon = *image; |
| 527 static_cast<AppInfoView*>(app_info_)->UpdateIcon(shortcut_info_.favicon); | 527 static_cast<AppInfoView*>(app_info_)->UpdateIcon(shortcut_info_.favicon); |
| 528 } | 528 } |
| 529 | 529 |
| OLD | NEW |