OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "mojo/services/view_manager/root_node_manager.h" | 5 #include "mojo/services/view_manager/root_node_manager.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "mojo/public/cpp/application/application_connection.h" | 8 #include "mojo/public/cpp/application/application_connection.h" |
9 #include "mojo/public/interfaces/application/service_provider.mojom.h" | 9 #include "mojo/public/interfaces/application/service_provider.mojom.h" |
10 #include "mojo/services/public/cpp/input_events/input_events_type_converters.h" | 10 #include "mojo/services/public/cpp/input_events/input_events_type_converters.h" |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 const Node* new_parent, | 245 const Node* new_parent, |
246 const Node* old_parent) { | 246 const Node* old_parent) { |
247 if (!root_view_manager_.in_setup()) | 247 if (!root_view_manager_.in_setup()) |
248 ProcessNodeHierarchyChanged(node, new_parent, old_parent); | 248 ProcessNodeHierarchyChanged(node, new_parent, old_parent); |
249 } | 249 } |
250 | 250 |
251 void RootNodeManager::OnNodeBoundsChanged(const Node* node, | 251 void RootNodeManager::OnNodeBoundsChanged(const Node* node, |
252 const gfx::Rect& old_bounds, | 252 const gfx::Rect& old_bounds, |
253 const gfx::Rect& new_bounds) { | 253 const gfx::Rect& new_bounds) { |
254 ProcessNodeBoundsChanged(node, old_bounds, new_bounds); | 254 ProcessNodeBoundsChanged(node, old_bounds, new_bounds); |
| 255 if (!node->parent()) |
| 256 return; |
| 257 |
| 258 // TODO(sky): optimize this. |
| 259 root_view_manager_.SchedulePaint(node->parent(), old_bounds); |
| 260 root_view_manager_.SchedulePaint(node->parent(), new_bounds); |
| 261 } |
| 262 |
| 263 void RootNodeManager::OnNodeBitmapChanged(const Node* node) { |
| 264 root_view_manager_.SchedulePaint(node, gfx::Rect(node->bounds().size())); |
255 } | 265 } |
256 | 266 |
257 } // namespace service | 267 } // namespace service |
258 } // namespace mojo | 268 } // namespace mojo |
OLD | NEW |