OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/app_list/extension_app_item.h" | 5 #include "chrome/browser/ui/app_list/extension_app_item.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 ~RoundedCornersImageSource() override {} | 72 ~RoundedCornersImageSource() override {} |
73 | 73 |
74 private: | 74 private: |
75 // gfx::CanvasImageSource overrides: | 75 // gfx::CanvasImageSource overrides: |
76 void Draw(gfx::Canvas* canvas) override { | 76 void Draw(gfx::Canvas* canvas) override { |
77 // The radius used to round the app icon. | 77 // The radius used to round the app icon. |
78 const size_t kRoundingRadius = 2; | 78 const size_t kRoundingRadius = 2; |
79 | 79 |
80 canvas->DrawImageInt(icon_, 0, 0); | 80 canvas->DrawImageInt(icon_, 0, 0); |
81 | 81 |
82 scoped_ptr<gfx::Canvas> masking_canvas( | 82 std::unique_ptr<gfx::Canvas> masking_canvas( |
83 new gfx::Canvas(gfx::Size(icon_.width(), icon_.height()), 1.0f, false)); | 83 new gfx::Canvas(gfx::Size(icon_.width(), icon_.height()), 1.0f, false)); |
84 DCHECK(masking_canvas); | 84 DCHECK(masking_canvas); |
85 | 85 |
86 SkPaint opaque_paint; | 86 SkPaint opaque_paint; |
87 opaque_paint.setColor(SK_ColorWHITE); | 87 opaque_paint.setColor(SK_ColorWHITE); |
88 opaque_paint.setFlags(SkPaint::kAntiAlias_Flag); | 88 opaque_paint.setFlags(SkPaint::kAntiAlias_Flag); |
89 masking_canvas->DrawRoundRect( | 89 masking_canvas->DrawRoundRect( |
90 gfx::Rect(icon_.width(), icon_.height()), | 90 gfx::Rect(icon_.width(), icon_.height()), |
91 kRoundingRadius, opaque_paint); | 91 kRoundingRadius, opaque_paint); |
92 | 92 |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 } | 336 } |
337 | 337 |
338 void ExtensionAppItem::UpdatePositionFromOrdering() { | 338 void ExtensionAppItem::UpdatePositionFromOrdering() { |
339 const syncer::StringOrdinal& page = | 339 const syncer::StringOrdinal& page = |
340 GetAppSorting()->GetPageOrdinal(extension_id()); | 340 GetAppSorting()->GetPageOrdinal(extension_id()); |
341 const syncer::StringOrdinal& launch = | 341 const syncer::StringOrdinal& launch = |
342 GetAppSorting()->GetAppLaunchOrdinal(extension_id()); | 342 GetAppSorting()->GetAppLaunchOrdinal(extension_id()); |
343 set_position(syncer::StringOrdinal( | 343 set_position(syncer::StringOrdinal( |
344 page.ToInternalValue() + launch.ToInternalValue())); | 344 page.ToInternalValue() + launch.ToInternalValue())); |
345 } | 345 } |
OLD | NEW |