| Index: ash/common/devtools/view_element.cc
|
| diff --git a/ash/common/devtools/view_element.cc b/ash/common/devtools/view_element.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..270eb3d8032d99eb731d9b32c66b5c49112f3c0e
|
| --- /dev/null
|
| +++ b/ash/common/devtools/view_element.cc
|
| @@ -0,0 +1,62 @@
|
| +// Copyright 2017 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "ash/common/devtools/view_element.h"
|
| +
|
| +namespace ash {
|
| +namespace devtools {
|
| +
|
| +void ViewElement::OnChildViewRemoved(views::View* parent, views::View* view) {
|
| + DomAgentDelegate()->NotifyRemoveViewTree(view, parent, true);
|
| +}
|
| +
|
| +void ViewElement::OnChildViewAdded(views::View* parent, views::View* view) {
|
| + DomAgentDelegate()->NotifyAddViewTree(view);
|
| +}
|
| +
|
| +void ViewElement::OnChildViewReordered(views::View* parent, views::View* view) {
|
| + DomAgentDelegate()->NotifyRemoveViewTree(view, parent, false);
|
| + DomAgentDelegate()->NotifyAddViewTree(view);
|
| +}
|
| +
|
| +void ViewElement::OnViewBoundsChanged(views::View* view) {
|
| + LOG(ERROR) << "WiewElement::OnViewBoundsChanged --------------";
|
| + DomAgentDelegate()->NotifyOnViewBoundsChanged(view);
|
| +}
|
| +
|
| +bool ViewElement::GetBounds(gfx::Rect* bounds) {
|
| + if (view) {
|
| + *bounds = view->bounds();
|
| + return true;
|
| + }
|
| + return false;
|
| +}
|
| +
|
| +bool ViewElement::SetBounds(const gfx::Rect& bounds) {
|
| + if (view) {
|
| + view->SetBoundsRect(bounds);
|
| + return true;
|
| + }
|
| + return false;
|
| +}
|
| +
|
| +bool ViewElement::GetVisible(bool* visible) {
|
| + if (view) {
|
| + *visible = view->visible();
|
| + return true;
|
| + }
|
| + return false;
|
| +}
|
| +
|
| +bool ViewElement::SetVisible(bool visible) {
|
| + if (view) {
|
| + if (visible != view->visible())
|
| + view->SetVisible(visible);
|
| + return true;
|
| + }
|
| + return false;
|
| +}
|
| +
|
| +} // namespace devtools
|
| +} // namespace ash
|
|
|