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

Unified Diff: ui/views/controls/image_view.cc

Issue 2713993005: Clean up ImageView. (Closed)
Patch Set: revert errant changes Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/controls/image_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/image_view.cc
diff --git a/ui/views/controls/image_view.cc b/ui/views/controls/image_view.cc
index edd639ed482baad9e0c89b4700aec447f0a5c215..024155d68230176b4a5823dff7c5c10113f83525 100644
--- a/ui/views/controls/image_view.cc
+++ b/ui/views/controls/image_view.cc
@@ -12,7 +12,6 @@
#include "ui/accessibility/ax_node_data.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/geometry/insets.h"
-#include "ui/views/painter.h"
namespace views {
@@ -35,14 +34,10 @@ ImageView::ImageView()
: image_size_set_(false),
horiz_alignment_(CENTER),
vert_alignment_(CENTER),
- interactive_(true),
last_paint_scale_(0.f),
- last_painted_bitmap_pixels_(NULL),
- focus_painter_(Painter::CreateDashedFocusPainter()) {
-}
+ last_painted_bitmap_pixels_(NULL) {}
-ImageView::~ImageView() {
-}
+ImageView::~ImageView() {}
void ImageView::SetImage(const gfx::ImageSkia& img) {
if (IsImageEqual(img))
@@ -84,10 +79,6 @@ void ImageView::ResetImageSize() {
image_size_set_ = false;
}
-void ImageView::SetFocusPainter(std::unique_ptr<Painter> focus_painter) {
- focus_painter_ = std::move(focus_painter);
-}
-
gfx::Size ImageView::GetPreferredSize() const {
gfx::Size size = GetImageSize();
size.Enlarge(GetInsets().width(), GetInsets().height());
@@ -138,22 +129,9 @@ gfx::Point ImageView::ComputeImageOrigin(const gfx::Size& image_size) const {
return gfx::Point(x, y);
}
-void ImageView::OnFocus() {
- View::OnFocus();
- if (focus_painter_.get())
- SchedulePaint();
-}
-
-void ImageView::OnBlur() {
- View::OnBlur();
- if (focus_painter_.get())
- SchedulePaint();
-}
-
void ImageView::OnPaint(gfx::Canvas* canvas) {
View::OnPaint(canvas);
OnPaintImage(canvas);
- Painter::PaintFocusPainter(this, canvas, focus_painter_.get());
}
void ImageView::GetAccessibleNodeData(ui::AXNodeData* node_data) {
@@ -204,10 +182,6 @@ bool ImageView::GetTooltipText(const gfx::Point& p,
return true;
}
-bool ImageView::CanProcessEventsWithinSubtree() const {
- return interactive_;
-}
-
void ImageView::OnPaintImage(gfx::Canvas* canvas) {
last_paint_scale_ = canvas->image_scale();
last_painted_bitmap_pixels_ = NULL;
« no previous file with comments | « ui/views/controls/image_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698