| 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/public/cpp/view_manager/view.h" | 5 #include "mojo/services/public/cpp/view_manager/view.h" |
| 6 | 6 |
| 7 #include "mojo/public/cpp/application/service_provider_impl.h" | 7 #include "mojo/public/cpp/application/service_provider_impl.h" |
| 8 #include "mojo/services/public/cpp/view_manager/lib/view_manager_client_impl.h" | 8 #include "mojo/services/public/cpp/view_manager/lib/view_manager_client_impl.h" |
| 9 #include "mojo/services/public/cpp/view_manager/lib/view_private.h" | 9 #include "mojo/services/public/cpp/view_manager/lib/view_private.h" |
| 10 #include "mojo/services/public/cpp/view_manager/view_observer.h" | 10 #include "mojo/services/public/cpp/view_manager/view_observer.h" |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 children_.end()); | 202 children_.end()); |
| 203 } | 203 } |
| 204 } | 204 } |
| 205 LocalDestroy(); | 205 LocalDestroy(); |
| 206 } | 206 } |
| 207 | 207 |
| 208 void View::SetBounds(const Rect& bounds) { | 208 void View::SetBounds(const Rect& bounds) { |
| 209 if (!OwnsView(manager_, this)) | 209 if (!OwnsView(manager_, this)) |
| 210 return; | 210 return; |
| 211 | 211 |
| 212 if (bounds_.Equals(bounds)) |
| 213 return; |
| 214 |
| 212 if (manager_) | 215 if (manager_) |
| 213 static_cast<ViewManagerClientImpl*>(manager_)->SetBounds(id_, bounds); | 216 static_cast<ViewManagerClientImpl*>(manager_)->SetBounds(id_, bounds); |
| 214 LocalSetBounds(bounds_, bounds); | 217 LocalSetBounds(bounds_, bounds); |
| 215 } | 218 } |
| 216 | 219 |
| 217 void View::SetVisible(bool value) { | 220 void View::SetVisible(bool value) { |
| 218 if (visible_ == value) | 221 if (visible_ == value) |
| 219 return; | 222 return; |
| 220 | 223 |
| 221 if (manager_) | 224 if (manager_) |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 if (IsDrawn() == value) { | 444 if (IsDrawn() == value) { |
| 442 drawn_ = value; | 445 drawn_ = value; |
| 443 return; | 446 return; |
| 444 } | 447 } |
| 445 FOR_EACH_OBSERVER(ViewObserver, observers_, OnViewDrawnChanging(this)); | 448 FOR_EACH_OBSERVER(ViewObserver, observers_, OnViewDrawnChanging(this)); |
| 446 drawn_ = value; | 449 drawn_ = value; |
| 447 FOR_EACH_OBSERVER(ViewObserver, observers_, OnViewDrawnChanged(this)); | 450 FOR_EACH_OBSERVER(ViewObserver, observers_, OnViewDrawnChanged(this)); |
| 448 } | 451 } |
| 449 | 452 |
| 450 } // namespace mojo | 453 } // namespace mojo |
| OLD | NEW |