| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 // Download utility implementation | 5 // Download utility implementation |
| 6 | 6 |
| 7 #include "chrome/browser/download/download_util.h" | 7 #include "chrome/browser/download/download_util.h" |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 PI/2) / 2 + 0.5; | 200 PI/2) / 2 + 0.5; |
| 201 | 201 |
| 202 SkRect bounds; | 202 SkRect bounds; |
| 203 bounds.set(SkIntToScalar(complete_bounds.x()), | 203 bounds.set(SkIntToScalar(complete_bounds.x()), |
| 204 SkIntToScalar(complete_bounds.y()), | 204 SkIntToScalar(complete_bounds.y()), |
| 205 SkIntToScalar(complete_bounds.x() + complete_bounds.width()), | 205 SkIntToScalar(complete_bounds.x() + complete_bounds.width()), |
| 206 SkIntToScalar(complete_bounds.y() + complete_bounds.height())); | 206 SkIntToScalar(complete_bounds.y() + complete_bounds.height())); |
| 207 canvas->saveLayerAlpha(&bounds, | 207 canvas->saveLayerAlpha(&bounds, |
| 208 static_cast<int>(255.0 * opacity), | 208 static_cast<int>(255.0 * opacity), |
| 209 SkCanvas::kARGB_ClipLayer_SaveFlag); | 209 SkCanvas::kARGB_ClipLayer_SaveFlag); |
| 210 canvas->drawARGB(0, 255, 255, 255, SkPorterDuff::kClear_Mode); | 210 canvas->drawARGB(0, 255, 255, 255, SkXfermode::kClear_Mode); |
| 211 canvas->DrawBitmapInt(*complete, complete_bounds.x(), complete_bounds.y()); | 211 canvas->DrawBitmapInt(*complete, complete_bounds.x(), complete_bounds.y()); |
| 212 canvas->restore(); | 212 canvas->restore(); |
| 213 } | 213 } |
| 214 | 214 |
| 215 // Load a language dependent height so that the dangerous download confirmation | 215 // Load a language dependent height so that the dangerous download confirmation |
| 216 // message doesn't overlap with the download link label. | 216 // message doesn't overlap with the download link label. |
| 217 int GetBigProgressIconSize() { | 217 int GetBigProgressIconSize() { |
| 218 static int big_progress_icon_size = 0; | 218 static int big_progress_icon_size = 0; |
| 219 if (big_progress_icon_size == 0) { | 219 if (big_progress_icon_size == 0) { |
| 220 string16 locale_size_str = | 220 string16 locale_size_str = |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 DWORD effects; | 252 DWORD effects; |
| 253 DoDragDrop(data.get(), drag_source.get(), DROPEFFECT_COPY | DROPEFFECT_LINK, | 253 DoDragDrop(data.get(), drag_source.get(), DROPEFFECT_COPY | DROPEFFECT_LINK, |
| 254 &effects); | 254 &effects); |
| 255 #else | 255 #else |
| 256 NOTIMPLEMENTED(); | 256 NOTIMPLEMENTED(); |
| 257 #endif | 257 #endif |
| 258 } | 258 } |
| 259 #endif | 259 #endif |
| 260 | 260 |
| 261 } // namespace download_util | 261 } // namespace download_util |
| OLD | NEW |