OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/views/button.h" | 5 #include "chrome/views/button.h" |
6 | 6 |
7 #include <atlbase.h> | 7 #include <atlbase.h> |
8 #include <atlapp.h> | 8 #include <atlapp.h> |
9 | 9 |
10 #include "chrome/app/chrome_dll_resource.h" | 10 #include "chrome/app/chrome_dll_resource.h" |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 | 98 |
99 canvas->DrawBitmapInt(img, x, y); | 99 canvas->DrawBitmapInt(img, x, y); |
100 } | 100 } |
101 PaintFocusBorder(canvas); | 101 PaintFocusBorder(canvas); |
102 } | 102 } |
103 | 103 |
104 SkBitmap Button::GetImageToPaint() { | 104 SkBitmap Button::GetImageToPaint() { |
105 SkBitmap img; | 105 SkBitmap img; |
106 | 106 |
107 if (!images_[BS_HOT].isNull() && hover_animation_->IsAnimating()) { | 107 if (!images_[BS_HOT].isNull() && hover_animation_->IsAnimating()) { |
108 img = gfx::ImageOperations::CreateBlendedBitmap(images_[BS_NORMAL], | 108 img = skia::ImageOperations::CreateBlendedBitmap(images_[BS_NORMAL], |
109 images_[BS_HOT], hover_animation_->GetCurrentValue()); | 109 images_[BS_HOT], hover_animation_->GetCurrentValue()); |
110 } else { | 110 } else { |
111 img = images_[GetState()]; | 111 img = images_[GetState()]; |
112 } | 112 } |
113 | 113 |
114 return !img.isNull() ? img : images_[BS_NORMAL]; | 114 return !img.isNull() ? img : images_[BS_NORMAL]; |
115 } | 115 } |
116 | 116 |
117 //////////////////////////////////////////////////////////////////////////////// | 117 //////////////////////////////////////////////////////////////////////////////// |
118 // | 118 // |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 toggled_ = toggled; | 194 toggled_ = toggled; |
195 SchedulePaint(); | 195 SchedulePaint(); |
196 } | 196 } |
197 | 197 |
198 void ToggleButton::SetToggledTooltipText(const std::wstring& tooltip) { | 198 void ToggleButton::SetToggledTooltipText(const std::wstring& tooltip) { |
199 toggled_tooltip_text_.assign(tooltip); | 199 toggled_tooltip_text_.assign(tooltip); |
200 } | 200 } |
201 | 201 |
202 } // namespace views | 202 } // namespace views |
203 | 203 |
OLD | NEW |