| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/common/devtools/ash_devtools_dom_agent.h" | 5 #include "ash/common/devtools/ash_devtools_dom_agent.h" |
| 6 | 6 |
| 7 #include "ash/common/wm_window.h" | 7 #include "ash/common/wm_window.h" |
| 8 #include "ash/public/cpp/shell_window_ids.h" | 8 #include "ash/public/cpp/shell_window_ids.h" |
| 9 #include "ash/root_window_controller.h" | 9 #include "ash/root_window_controller.h" |
| 10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 if (view == widget->GetRootView()) | 178 if (view == widget->GetRootView()) |
| 179 RemoveViewTree(view, nullptr, true); | 179 RemoveViewTree(view, nullptr, true); |
| 180 } | 180 } |
| 181 | 181 |
| 182 void AshDevToolsDOMAgent::OnWidgetBoundsChanged(views::Widget* widget, | 182 void AshDevToolsDOMAgent::OnWidgetBoundsChanged(views::Widget* widget, |
| 183 const gfx::Rect& new_bounds) { | 183 const gfx::Rect& new_bounds) { |
| 184 for (auto& observer : observers_) | 184 for (auto& observer : observers_) |
| 185 observer.OnWidgetBoundsChanged(widget); | 185 observer.OnWidgetBoundsChanged(widget); |
| 186 } | 186 } |
| 187 | 187 |
| 188 void AshDevToolsDOMAgent::OnChildViewRemoved(views::View* view, | 188 void AshDevToolsDOMAgent::OnChildViewRemoved(views::View* parent, |
| 189 views::View* parent) { | 189 views::View* view) { |
| 190 RemoveViewTree(view, parent, true); | 190 RemoveViewTree(view, parent, true); |
| 191 } | 191 } |
| 192 | 192 |
| 193 void AshDevToolsDOMAgent::OnChildViewAdded(views::View* view) { | 193 void AshDevToolsDOMAgent::OnChildViewAdded(views::View* parent, |
| 194 views::View* view) { |
| 194 AddViewTree(view); | 195 AddViewTree(view); |
| 195 } | 196 } |
| 196 | 197 |
| 197 void AshDevToolsDOMAgent::OnChildViewReordered(views::View* view) { | 198 void AshDevToolsDOMAgent::OnChildViewReordered(views::View* parent, |
| 198 RemoveViewTree(view, view->parent(), false); | 199 views::View* view) { |
| 200 RemoveViewTree(view, parent, false); |
| 199 AddViewTree(view); | 201 AddViewTree(view); |
| 200 } | 202 } |
| 201 | 203 |
| 202 void AshDevToolsDOMAgent::OnViewBoundsChanged(views::View* view) { | 204 void AshDevToolsDOMAgent::OnViewBoundsChanged(views::View* view) { |
| 203 for (auto& observer : observers_) | 205 for (auto& observer : observers_) |
| 204 observer.OnViewBoundsChanged(view); | 206 observer.OnViewBoundsChanged(view); |
| 205 } | 207 } |
| 206 | 208 |
| 207 WmWindow* AshDevToolsDOMAgent::GetWindowFromNodeId(int nodeId) { | 209 WmWindow* AshDevToolsDOMAgent::GetWindowFromNodeId(int nodeId) { |
| 208 return node_id_to_window_map_.count(nodeId) ? node_id_to_window_map_[nodeId] | 210 return node_id_to_window_map_.count(nodeId) ? node_id_to_window_map_[nodeId] |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 522 return ui::devtools::protocol::Response::OK(); | 524 return ui::devtools::protocol::Response::OK(); |
| 523 } | 525 } |
| 524 | 526 |
| 525 bool AshDevToolsDOMAgent::IsHighlightingWindow(WmWindow* window) { | 527 bool AshDevToolsDOMAgent::IsHighlightingWindow(WmWindow* window) { |
| 526 return widget_for_highlighting_ && | 528 return widget_for_highlighting_ && |
| 527 GetWidgetFromWmWindow(window) == widget_for_highlighting_.get(); | 529 GetWidgetFromWmWindow(window) == widget_for_highlighting_.get(); |
| 528 } | 530 } |
| 529 | 531 |
| 530 } // namespace devtools | 532 } // namespace devtools |
| 531 } // namespace ash | 533 } // namespace ash |
| OLD | NEW |