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

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

Issue 10384068: views: Have a more accurate name for View parent_owned accessors. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 7 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 | « no previous file | ash/tooltips/tooltip_controller.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 "ash/drag_drop/drag_image_view.h" 5 #include "ash/drag_drop/drag_image_view.h"
6 6
7 #include "ui/views/widget/widget.h" 7 #include "ui/views/widget/widget.h"
8 8
9 namespace ash { 9 namespace ash {
10 namespace internal { 10 namespace internal {
(...skipping 14 matching lines...) Expand all
25 return drag_widget; 25 return drag_widget;
26 } 26 }
27 } 27 }
28 28
29 DragImageView::DragImageView() : views::ImageView() { 29 DragImageView::DragImageView() : views::ImageView() {
30 widget_.reset(CreateDragWidget()); 30 widget_.reset(CreateDragWidget());
31 widget_->SetContentsView(this); 31 widget_->SetContentsView(this);
32 widget_->SetAlwaysOnTop(true); 32 widget_->SetAlwaysOnTop(true);
33 33
34 // We are owned by the DragDropController. 34 // We are owned by the DragDropController.
35 set_parent_owned(false); 35 set_owned_by_client();
36 } 36 }
37 37
38 DragImageView::~DragImageView() { 38 DragImageView::~DragImageView() {
39 widget_->Hide(); 39 widget_->Hide();
40 } 40 }
41 41
42 void DragImageView::SetScreenBounds(const gfx::Rect& bounds) { 42 void DragImageView::SetScreenBounds(const gfx::Rect& bounds) {
43 widget_->SetBounds(bounds); 43 widget_->SetBounds(bounds);
44 } 44 }
45 45
46 void DragImageView::SetScreenPosition(const gfx::Point& position) { 46 void DragImageView::SetScreenPosition(const gfx::Point& position) {
47 widget_->SetBounds(gfx::Rect(position, GetPreferredSize())); 47 widget_->SetBounds(gfx::Rect(position, GetPreferredSize()));
48 } 48 }
49 49
50 void DragImageView::SetWidgetVisible(bool visible) { 50 void DragImageView::SetWidgetVisible(bool visible) {
51 if (visible != widget_->IsVisible()) { 51 if (visible != widget_->IsVisible()) {
52 if (visible) 52 if (visible)
53 widget_->Show(); 53 widget_->Show();
54 else 54 else
55 widget_->Hide(); 55 widget_->Hide();
56 } 56 }
57 } 57 }
58 58
59 } // namespace internal 59 } // namespace internal
60 } // namespace ash 60 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/tooltips/tooltip_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698