OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/aura/window.h" | 5 #include "ui/aura/window.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
490 if (!parent_rect.IsEmpty()) { | 490 if (!parent_rect.IsEmpty()) { |
491 parent_rect.Offset(bounds().origin().OffsetFromOrigin()); | 491 parent_rect.Offset(bounds().origin().OffsetFromOrigin()); |
492 parent_->SchedulePaintInRect(parent_rect); | 492 parent_->SchedulePaintInRect(parent_rect); |
493 } | 493 } |
494 } else if (layer() && layer()->SchedulePaint(rect)) { | 494 } else if (layer() && layer()->SchedulePaint(rect)) { |
495 FOR_EACH_OBSERVER( | 495 FOR_EACH_OBSERVER( |
496 WindowObserver, observers_, OnWindowPaintScheduled(this, rect)); | 496 WindowObserver, observers_, OnWindowPaintScheduled(this, rect)); |
497 } | 497 } |
498 } | 498 } |
499 | 499 |
500 void Window::NotifyDamage(const gfx::Rect& rect) { | |
enne (OOO)
2014/08/11 23:43:23
This code is an unfortunate duplicate of Window::S
sky
2014/08/13 20:01:01
Is this a notification that a paint has been sched
enne (OOO)
2014/08/13 23:55:45
This is a notification that part of the screen has
| |
501 if (!layer() && parent_) { | |
502 gfx::Rect parent_rect(bounds().size()); | |
503 parent_rect.Intersect(rect); | |
504 if (!parent_rect.IsEmpty()) { | |
505 parent_rect.Offset(bounds().origin().OffsetFromOrigin()); | |
506 parent_->NotifyDamage(parent_rect); | |
507 } | |
508 } else if (layer()) { | |
509 FOR_EACH_OBSERVER( | |
510 WindowObserver, observers_, OnWindowPaintScheduled(this, rect)); | |
511 } | |
512 } | |
513 | |
500 void Window::StackChildAtTop(Window* child) { | 514 void Window::StackChildAtTop(Window* child) { |
501 if (children_.size() <= 1 || child == children_.back()) | 515 if (children_.size() <= 1 || child == children_.back()) |
502 return; // In the front already. | 516 return; // In the front already. |
503 StackChildAbove(child, children_.back()); | 517 StackChildAbove(child, children_.back()); |
504 } | 518 } |
505 | 519 |
506 void Window::StackChildAbove(Window* child, Window* target) { | 520 void Window::StackChildAbove(Window* child, Window* target) { |
507 StackChildRelativeTo(child, target, STACK_ABOVE); | 521 StackChildRelativeTo(child, target, STACK_ABOVE); |
508 } | 522 } |
509 | 523 |
(...skipping 933 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1443 return window; | 1457 return window; |
1444 if (offset) | 1458 if (offset) |
1445 *offset += window->bounds().OffsetFromOrigin(); | 1459 *offset += window->bounds().OffsetFromOrigin(); |
1446 } | 1460 } |
1447 if (offset) | 1461 if (offset) |
1448 *offset = gfx::Vector2d(); | 1462 *offset = gfx::Vector2d(); |
1449 return NULL; | 1463 return NULL; |
1450 } | 1464 } |
1451 | 1465 |
1452 } // namespace aura | 1466 } // namespace aura |
OLD | NEW |