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

Side by Side Diff: ui/views/controls/image_view.cc

Issue 1868363002: Replace scoped_ptr with std::unique_ptr in //ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@scopedptrcc
Patch Set: scopedptrui: rebase-make_scoped_ptr 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
« no previous file with comments | « ui/views/controls/image_view.h ('k') | ui/views/controls/label.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "ui/views/controls/image_view.h" 5 #include "ui/views/controls/image_view.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 77
78 gfx::Rect ImageView::GetImageBounds() const { 78 gfx::Rect ImageView::GetImageBounds() const {
79 gfx::Size image_size = GetImageSize(); 79 gfx::Size image_size = GetImageSize();
80 return gfx::Rect(ComputeImageOrigin(image_size), image_size); 80 return gfx::Rect(ComputeImageOrigin(image_size), image_size);
81 } 81 }
82 82
83 void ImageView::ResetImageSize() { 83 void ImageView::ResetImageSize() {
84 image_size_set_ = false; 84 image_size_set_ = false;
85 } 85 }
86 86
87 void ImageView::SetFocusPainter(scoped_ptr<Painter> focus_painter) { 87 void ImageView::SetFocusPainter(std::unique_ptr<Painter> focus_painter) {
88 focus_painter_ = std::move(focus_painter); 88 focus_painter_ = std::move(focus_painter);
89 } 89 }
90 90
91 gfx::Size ImageView::GetPreferredSize() const { 91 gfx::Size ImageView::GetPreferredSize() const {
92 gfx::Size size = GetImageSize(); 92 gfx::Size size = GetImageSize();
93 size.Enlarge(GetInsets().width(), GetInsets().height()); 93 size.Enlarge(GetInsets().width(), GetInsets().height());
94 return size; 94 return size;
95 } 95 }
96 96
97 bool ImageView::IsImageEqual(const gfx::ImageSkia& img) const { 97 bool ImageView::IsImageEqual(const gfx::ImageSkia& img) const {
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 canvas->DrawImageInt(image_, 0, 0, image_.width(), image_.height(), 226 canvas->DrawImageInt(image_, 0, 0, image_.width(), image_.height(),
227 image_bounds.x(), image_bounds.y(), image_bounds.width(), 227 image_bounds.x(), image_bounds.y(), image_bounds.width(),
228 image_bounds.height(), true, paint); 228 image_bounds.height(), true, paint);
229 } else { 229 } else {
230 canvas->DrawImageInt(image_, image_bounds.x(), image_bounds.y()); 230 canvas->DrawImageInt(image_, image_bounds.x(), image_bounds.y());
231 } 231 }
232 last_painted_bitmap_pixels_ = GetBitmapPixels(image_, last_paint_scale_); 232 last_painted_bitmap_pixels_ = GetBitmapPixels(image_, last_paint_scale_);
233 } 233 }
234 234
235 } // namespace views 235 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/image_view.h ('k') | ui/views/controls/label.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698