Chromium Code Reviews| 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 "view_manager/public/cpp/view.h" | 5 #include "view_manager/public/cpp/view.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "mojo/public/cpp/application/service_provider_impl.h" | 10 #include "mojo/public/cpp/application/service_provider_impl.h" |
| (...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 482 void View::LocalSetBounds(const Rect& old_bounds, | 482 void View::LocalSetBounds(const Rect& old_bounds, |
| 483 const Rect& new_bounds) { | 483 const Rect& new_bounds) { |
| 484 DCHECK(old_bounds.x == bounds_.x); | 484 DCHECK(old_bounds.x == bounds_.x); |
| 485 DCHECK(old_bounds.y == bounds_.y); | 485 DCHECK(old_bounds.y == bounds_.y); |
| 486 DCHECK(old_bounds.width == bounds_.width); | 486 DCHECK(old_bounds.width == bounds_.width); |
| 487 DCHECK(old_bounds.height == bounds_.height); | 487 DCHECK(old_bounds.height == bounds_.height); |
| 488 ScopedSetBoundsNotifier notifier(this, old_bounds, new_bounds); | 488 ScopedSetBoundsNotifier notifier(this, old_bounds, new_bounds); |
| 489 bounds_ = new_bounds; | 489 bounds_ = new_bounds; |
| 490 } | 490 } |
| 491 | 491 |
| 492 void View::LocalSetViewportMetrics(const ViewportMetrics& old_metrics, | |
|
sky
2015/01/27 16:35:08
Why does this need to take old_metrics? Isn't old_
eseidel
2015/01/27 18:50:04
I just tried to make it match what LocalSetBounds
| |
| 493 const ViewportMetrics& new_metrics) { | |
| 494 DCHECK(viewport_metrics_->size == viewport_metrics_->size); | |
|
sky
2015/01/27 16:35:08
I think there is a bug where viewport_metrics_ is
eseidel
2015/01/27 18:50:04
Yes, there is. It's fixed a little in this patch,
| |
| 495 DCHECK(viewport_metrics_->device_pixel_ratio == | |
| 496 viewport_metrics_->device_pixel_ratio); | |
| 497 viewport_metrics_ = new_metrics.Clone(); | |
| 498 FOR_EACH_OBSERVER( | |
| 499 ViewObserver, observers_, | |
| 500 OnViewViewportMetricsChanged(this, old_metrics, new_metrics)); | |
| 501 } | |
| 502 | |
| 492 void View::LocalSetDrawn(bool value) { | 503 void View::LocalSetDrawn(bool value) { |
| 493 if (drawn_ == value) | 504 if (drawn_ == value) |
| 494 return; | 505 return; |
| 495 | 506 |
| 496 // As IsDrawn() is derived from |visible_| and |drawn_|, only send drawn | 507 // As IsDrawn() is derived from |visible_| and |drawn_|, only send drawn |
| 497 // notification is the value of IsDrawn() is really changing. | 508 // notification is the value of IsDrawn() is really changing. |
| 498 if (IsDrawn() == value) { | 509 if (IsDrawn() == value) { |
| 499 drawn_ = value; | 510 drawn_ = value; |
| 500 return; | 511 return; |
| 501 } | 512 } |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 546 void View::NotifyViewVisibilityChangedUp(View* target) { | 557 void View::NotifyViewVisibilityChangedUp(View* target) { |
| 547 // Start with the parent as we already notified |this| | 558 // Start with the parent as we already notified |this| |
| 548 // in NotifyViewVisibilityChangedDown. | 559 // in NotifyViewVisibilityChangedDown. |
| 549 for (View* view = parent(); view; view = view->parent()) { | 560 for (View* view = parent(); view; view = view->parent()) { |
| 550 bool ret = view->NotifyViewVisibilityChangedAtReceiver(target); | 561 bool ret = view->NotifyViewVisibilityChangedAtReceiver(target); |
| 551 DCHECK(ret); | 562 DCHECK(ret); |
| 552 } | 563 } |
| 553 } | 564 } |
| 554 | 565 |
| 555 } // namespace mojo | 566 } // namespace mojo |
| OLD | NEW |