Chromium Code Reviews| 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 "ui/android/view_android.h" | 5 #include "ui/android/view_android.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/android/jni_android.h" | 9 #include "base/android/jni_android.h" |
| 10 #include "base/android/jni_string.h" | 10 #include "base/android/jni_string.h" |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 119 children_.end()); | 119 children_.end()); |
| 120 DCHECK(!RootPathHasEventForwarder(this) || !SubtreeHasEventForwarder(child)) | 120 DCHECK(!RootPathHasEventForwarder(this) || !SubtreeHasEventForwarder(child)) |
| 121 << "Some view tree path will have more than one event forwarder " | 121 << "Some view tree path will have more than one event forwarder " |
| 122 "if the child is added."; | 122 "if the child is added."; |
| 123 | 123 |
| 124 // The new child goes to the top, which is the end of the list. | 124 // The new child goes to the top, which is the end of the list. |
| 125 children_.push_back(child); | 125 children_.push_back(child); |
| 126 if (child->parent_) | 126 if (child->parent_) |
| 127 child->RemoveFromParent(); | 127 child->RemoveFromParent(); |
| 128 child->parent_ = this; | 128 child->parent_ = this; |
| 129 child->OnPhysicalBackingSizeChanged(physical_size_); | 129 |
| 130 // Physical backing size in WindowAndroid should not be propagated down. | |
| 131 if (this != GetWindowAndroid()) | |
|
boliu
2017/05/17 16:21:12
maybe more generally, don't propagate empty sizes?
Jinsuk Kim
2017/05/18 01:54:39
Changed to checking empty size.
| |
| 132 child->OnPhysicalBackingSizeChanged(physical_size_); | |
| 130 } | 133 } |
| 131 | 134 |
| 132 // static | 135 // static |
| 133 bool ViewAndroid::RootPathHasEventForwarder(ViewAndroid* view) { | 136 bool ViewAndroid::RootPathHasEventForwarder(ViewAndroid* view) { |
| 134 while (view) { | 137 while (view) { |
| 135 if (view->has_event_forwarder()) | 138 if (view->has_event_forwarder()) |
| 136 return true; | 139 return true; |
| 137 view = view->parent_; | 140 view = view->parent_; |
| 138 } | 141 } |
| 139 | 142 |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 351 matched = bound.Contains(e->GetX(0), e->GetY(0)); | 354 matched = bound.Contains(e->GetX(0), e->GetY(0)); |
| 352 } | 355 } |
| 353 if (matched && child->HitTest(send_to_client, *e)) | 356 if (matched && child->HitTest(send_to_client, *e)) |
| 354 return true; | 357 return true; |
| 355 } | 358 } |
| 356 } | 359 } |
| 357 return false; | 360 return false; |
| 358 } | 361 } |
| 359 | 362 |
| 360 } // namespace ui | 363 } // namespace ui |
| OLD | NEW |