OLD | NEW |
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/strings/utf_string_conversions.h" | 8 #include "base/strings/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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 if (va != vert_alignment_) { | 170 if (va != vert_alignment_) { |
171 vert_alignment_ = va; | 171 vert_alignment_ = va; |
172 SchedulePaint(); | 172 SchedulePaint(); |
173 } | 173 } |
174 } | 174 } |
175 | 175 |
176 ImageView::Alignment ImageView::GetVerticalAlignment() const { | 176 ImageView::Alignment ImageView::GetVerticalAlignment() const { |
177 return vert_alignment_; | 177 return vert_alignment_; |
178 } | 178 } |
179 | 179 |
180 void ImageView::SetTooltipText(const string16& tooltip) { | 180 void ImageView::SetTooltipText(const base::string16& tooltip) { |
181 tooltip_text_ = tooltip; | 181 tooltip_text_ = tooltip; |
182 } | 182 } |
183 | 183 |
184 string16 ImageView::GetTooltipText() const { | 184 base::string16 ImageView::GetTooltipText() const { |
185 return tooltip_text_; | 185 return tooltip_text_; |
186 } | 186 } |
187 | 187 |
188 bool ImageView::GetTooltipText(const gfx::Point& p, string16* tooltip) const { | 188 bool ImageView::GetTooltipText(const gfx::Point& p, |
| 189 base::string16* tooltip) const { |
189 if (tooltip_text_.empty()) | 190 if (tooltip_text_.empty()) |
190 return false; | 191 return false; |
191 | 192 |
192 *tooltip = GetTooltipText(); | 193 *tooltip = GetTooltipText(); |
193 return true; | 194 return true; |
194 } | 195 } |
195 | 196 |
196 bool ImageView::HitTestRect(const gfx::Rect& rect) const { | 197 bool ImageView::HitTestRect(const gfx::Rect& rect) const { |
197 return interactive_ ? View::HitTestRect(rect) : false; | 198 return interactive_ ? View::HitTestRect(rect) : false; |
198 } | 199 } |
(...skipping 18 matching lines...) Expand all Loading... |
217 image_bounds.x(), image_bounds.y(), image_bounds.width(), | 218 image_bounds.x(), image_bounds.y(), image_bounds.width(), |
218 image_bounds.height(), true, paint); | 219 image_bounds.height(), true, paint); |
219 } else { | 220 } else { |
220 canvas->DrawImageInt(image_, image_bounds.x(), image_bounds.y()); | 221 canvas->DrawImageInt(image_, image_bounds.x(), image_bounds.y()); |
221 } | 222 } |
222 last_painted_bitmap_pixels_ = | 223 last_painted_bitmap_pixels_ = |
223 image_.GetRepresentation(last_paint_scale_).sk_bitmap().getPixels(); | 224 image_.GetRepresentation(last_paint_scale_).sk_bitmap().getPixels(); |
224 } | 225 } |
225 | 226 |
226 } // namespace views | 227 } // namespace views |
OLD | NEW |