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

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

Issue 10382144: Change SetImage, SetBackground, and SetToggledImage to take in a gfx::ImageSkia (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 8 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « ui/views/controls/image_view.h ('k') | ui/views/controls/scrollbar/bitmap_scroll_bar.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 "base/logging.h" 7 #include "base/logging.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "third_party/skia/include/core/SkPaint.h" 9 #include "third_party/skia/include/core/SkPaint.h"
10 #include "ui/base/accessibility/accessible_view_state.h" 10 #include "ui/base/accessibility/accessible_view_state.h"
(...skipping 12 matching lines...) Expand all
23 } 23 }
24 24
25 void ImageView::SetImage(const SkBitmap& bm) { 25 void ImageView::SetImage(const SkBitmap& bm) {
26 gfx::Size pref_size(GetPreferredSize()); 26 gfx::Size pref_size(GetPreferredSize());
27 image_ = bm; 27 image_ = bm;
28 if (pref_size != GetPreferredSize()) 28 if (pref_size != GetPreferredSize())
29 PreferredSizeChanged(); 29 PreferredSizeChanged();
30 SchedulePaint(); 30 SchedulePaint();
31 } 31 }
32 32
33 void ImageView::SetImage(const SkBitmap* bm) { 33 void ImageView::SetImage(const gfx::ImageSkia* image_skia) {
34 if (bm) { 34 if (image_skia) {
35 SetImage(*bm); 35 SetImage(*image_skia);
36 } else { 36 } else {
37 SkBitmap t; 37 SkBitmap t;
38 SetImage(t); 38 SetImage(t);
39 } 39 }
40 } 40 }
41 41
42 const SkBitmap& ImageView::GetImage() { 42 const SkBitmap& ImageView::GetImage() {
43 return image_; 43 return image_;
44 } 44 }
45 45
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 167
168 bool ImageView::GetTooltipText(const gfx::Point& p, string16* tooltip) const { 168 bool ImageView::GetTooltipText(const gfx::Point& p, string16* tooltip) const {
169 if (tooltip_text_.empty()) 169 if (tooltip_text_.empty())
170 return false; 170 return false;
171 171
172 *tooltip = GetTooltipText(); 172 *tooltip = GetTooltipText();
173 return true; 173 return true;
174 } 174 }
175 175
176 } // namespace views 176 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/image_view.h ('k') | ui/views/controls/scrollbar/bitmap_scroll_bar.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698