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

Side by Side Diff: ash/devtools/view_element.cc

Issue 2902063004: View shows wrong bound when it is highlighted. (Closed)
Patch Set: . Created 3 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
« no previous file with comments | « ash/devtools/ash_devtools_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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/devtools/view_element.h" 5 #include "ash/devtools/view_element.h"
6 6
7 #include "ash/devtools/ui_element_delegate.h" 7 #include "ash/devtools/ui_element_delegate.h"
8 #include "ui/views/widget/widget.h" 8 #include "ui/views/widget/widget.h"
9 9
10 namespace ash { 10 namespace ash {
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 void ViewElement::GetVisible(bool* visible) const { 68 void ViewElement::GetVisible(bool* visible) const {
69 *visible = view_->visible(); 69 *visible = view_->visible();
70 } 70 }
71 71
72 void ViewElement::SetVisible(bool visible) { 72 void ViewElement::SetVisible(bool visible) {
73 view_->SetVisible(visible); 73 view_->SetVisible(visible);
74 } 74 }
75 75
76 std::pair<aura::Window*, gfx::Rect> ViewElement::GetNodeWindowAndBounds() 76 std::pair<aura::Window*, gfx::Rect> ViewElement::GetNodeWindowAndBounds()
77 const { 77 const {
78 return std::make_pair(view_->GetWidget()->GetNativeWindow(), view_->bounds()); 78 return std::make_pair(view_->GetWidget()->GetNativeWindow(),
79 view_->GetBoundsInScreen());
79 } 80 }
80 81
81 // static 82 // static
82 views::View* ViewElement::From(UIElement* element) { 83 views::View* ViewElement::From(UIElement* element) {
83 DCHECK_EQ(UIElementType::VIEW, element->type()); 84 DCHECK_EQ(UIElementType::VIEW, element->type());
84 return static_cast<ViewElement*>(element)->view_; 85 return static_cast<ViewElement*>(element)->view_;
85 } 86 }
86 87
87 } // namespace devtools 88 } // namespace devtools
88 } // namespace ash 89 } // namespace ash
OLDNEW
« no previous file with comments | « ash/devtools/ash_devtools_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698