Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(417)

Side by Side Diff: chrome/browser/ui/app_list/extension_app_item.cc

Issue 1865213004: Convert //chrome/browser/ui from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/app_list/extension_app_item.h ('k') | chrome/browser/ui/app_list/extension_app_model_builder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698