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

Side by Side Diff: ash/drag_drop/drag_image_view.h

Issue 1514743002: cc: turn on strict paint property checking (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix DragImageView to not resize during paint Created 5 years 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
« no previous file with comments | « no previous file | ash/drag_drop/drag_image_view.cc » ('j') | ash/drag_drop/drag_image_view.cc » ('J')
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 #ifndef ASH_DRAG_DROP_DRAG_IMAGE_VIEW_H_ 5 #ifndef ASH_DRAG_DROP_DRAG_IMAGE_VIEW_H_
6 #define ASH_DRAG_DROP_DRAG_IMAGE_VIEW_H_ 6 #define ASH_DRAG_DROP_DRAG_IMAGE_VIEW_H_
7 7
8 #include "ui/base/dragdrop/drag_drop_types.h" 8 #include "ui/base/dragdrop/drag_drop_types.h"
9 #include "ui/views/controls/image_view.h" 9 #include "ui/views/controls/image_view.h"
10 10
11 namespace gfx {
12 class Image;
13 }
14
11 namespace views { 15 namespace views {
12 class Widget; 16 class Widget;
13 } 17 }
14 18
15 namespace ash { 19 namespace ash {
16 20
17 // This class allows to show a (native) view always on top of everything. It 21 // This class allows to show a (native) view always on top of everything. It
18 // does this by creating a widget and setting the content as the given view. The 22 // does this by creating a widget and setting the content as the given view. The
19 // caller can then use this object to freely move / drag it around on the 23 // caller can then use this object to freely move / drag it around on the
20 // desktop in screen coordinates. 24 // desktop in screen coordinates.
(...skipping 30 matching lines...) Expand all
51 55
52 // |operation| is a bit field indicating allowable drag operations from 56 // |operation| is a bit field indicating allowable drag operations from
53 // ui::DragDropTypes::DragOperation. 57 // ui::DragDropTypes::DragOperation.
54 void SetTouchDragOperation(int operation); 58 void SetTouchDragOperation(int operation);
55 void SetTouchDragOperationHintPosition(const gfx::Point& position); 59 void SetTouchDragOperationHintPosition(const gfx::Point& position);
56 60
57 // Sets the |opacity| of the image view between 0.0 and 1.0. 61 // Sets the |opacity| of the image view between 0.0 and 1.0.
58 void SetOpacity(float opacity); 62 void SetOpacity(float opacity);
59 63
60 private: 64 private:
65 gfx::Image* DragHint() const;
66
61 // Overridden from views::ImageView. 67 // Overridden from views::ImageView.
62 void OnPaint(gfx::Canvas* canvas) override; 68 void OnPaint(gfx::Canvas* canvas) override;
63 69
70 // Overridden from views::view
71 void Layout() override;
72
64 scoped_ptr<views::Widget> widget_; 73 scoped_ptr<views::Widget> widget_;
65 gfx::Size widget_size_; 74 gfx::Size widget_size_;
66 75
67 ui::DragDropTypes::DragEventSource drag_event_source_; 76 ui::DragDropTypes::DragEventSource drag_event_source_;
68 int touch_drag_operation_; 77 int touch_drag_operation_;
69 gfx::Point touch_drag_operation_indicator_position_; 78 gfx::Point touch_drag_operation_indicator_position_;
70 79
71 DISALLOW_COPY_AND_ASSIGN(DragImageView); 80 DISALLOW_COPY_AND_ASSIGN(DragImageView);
72 }; 81 };
73 82
74 } // namespace ash 83 } // namespace ash
75 84
76 #endif // ASH_DRAG_DROP_DRAG_IMAGE_VIEW_H_ 85 #endif // ASH_DRAG_DROP_DRAG_IMAGE_VIEW_H_
OLDNEW
« no previous file with comments | « no previous file | ash/drag_drop/drag_image_view.cc » ('j') | ash/drag_drop/drag_image_view.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698