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

Side by Side Diff: ui/views/controls/button/image_button.cc

Issue 10824359: Remove ImageSkia::empty and ImageSkia::extractSubset (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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/gfx/image/image_skia_util_mac.mm ('k') | ui/views/controls/button/image_button_unittest.cc » ('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/button/image_button.h" 5 #include "ui/views/controls/button/image_button.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "ui/base/animation/throb_animation.h" 8 #include "ui/base/animation/throb_animation.h"
9 #include "ui/gfx/canvas.h" 9 #include "ui/gfx/canvas.h"
10 #include "ui/gfx/image/image_skia_operations.h" 10 #include "ui/gfx/image/image_skia_operations.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 if (v_alignment_ == ALIGN_MIDDLE) 90 if (v_alignment_ == ALIGN_MIDDLE)
91 y = (height() - img.height()) / 2; 91 y = (height() - img.height()) / 2;
92 else if (v_alignment_ == ALIGN_BOTTOM) 92 else if (v_alignment_ == ALIGN_BOTTOM)
93 y = height() - img.height(); 93 y = height() - img.height();
94 94
95 if (!background_image_.isNull()) 95 if (!background_image_.isNull())
96 canvas->DrawImageInt(background_image_, x, y); 96 canvas->DrawImageInt(background_image_, x, y);
97 97
98 canvas->DrawImageInt(img, x, y); 98 canvas->DrawImageInt(img, x, y);
99 99
100 if (!overlay_image_.empty()) 100 if (!overlay_image_.isNull())
101 canvas->DrawImageInt(overlay_image_, x, y); 101 canvas->DrawImageInt(overlay_image_, x, y);
102 } 102 }
103 OnPaintFocusBorder(canvas); 103 OnPaintFocusBorder(canvas);
104 } 104 }
105 105
106 //////////////////////////////////////////////////////////////////////////////// 106 ////////////////////////////////////////////////////////////////////////////////
107 // ImageButton, protected: 107 // ImageButton, protected:
108 108
109 gfx::ImageSkia ImageButton::GetImageToPaint() { 109 gfx::ImageSkia ImageButton::GetImageToPaint() {
110 gfx::ImageSkia img; 110 gfx::ImageSkia img;
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 bool ToggleImageButton::GetTooltipText(const gfx::Point& p, 179 bool ToggleImageButton::GetTooltipText(const gfx::Point& p,
180 string16* tooltip) const { 180 string16* tooltip) const {
181 if (!toggled_ || toggled_tooltip_text_.empty()) 181 if (!toggled_ || toggled_tooltip_text_.empty())
182 return Button::GetTooltipText(p, tooltip); 182 return Button::GetTooltipText(p, tooltip);
183 183
184 *tooltip = toggled_tooltip_text_; 184 *tooltip = toggled_tooltip_text_;
185 return true; 185 return true;
186 } 186 }
187 187
188 } // namespace views 188 } // namespace views
OLDNEW
« no previous file with comments | « ui/gfx/image/image_skia_util_mac.mm ('k') | ui/views/controls/button/image_button_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698