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 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
486 if (!layer() && parent_) { | 486 if (!layer() && parent_) { |
487 // Notification of paint scheduled happens for the window with a layer. | 487 // Notification of paint scheduled happens for the window with a layer. |
488 gfx::Rect parent_rect(bounds().size()); | 488 gfx::Rect parent_rect(bounds().size()); |
489 parent_rect.Intersect(rect); | 489 parent_rect.Intersect(rect); |
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)); |
sky
2014/08/18 21:22:35
Rename OnWindowPaintScheduled to your new name and
enne (OOO)
2014/08/18 23:32:21
Done.
| |
497 } | 497 } |
498 } | 498 } |
499 | 499 |
500 void Window::OnDelegatedFrameDamage(const gfx::Rect &damage_rect_in_dip) { | |
501 DCHECK(layer()); | |
502 FOR_EACH_OBSERVER(WindowObserver, | |
503 observers_, | |
504 OnWindowPaintScheduled(this, damage_rect_in_dip)); | |
505 } | |
506 | |
500 void Window::StackChildAtTop(Window* child) { | 507 void Window::StackChildAtTop(Window* child) { |
501 if (children_.size() <= 1 || child == children_.back()) | 508 if (children_.size() <= 1 || child == children_.back()) |
502 return; // In the front already. | 509 return; // In the front already. |
503 StackChildAbove(child, children_.back()); | 510 StackChildAbove(child, children_.back()); |
504 } | 511 } |
505 | 512 |
506 void Window::StackChildAbove(Window* child, Window* target) { | 513 void Window::StackChildAbove(Window* child, Window* target) { |
507 StackChildRelativeTo(child, target, STACK_ABOVE); | 514 StackChildRelativeTo(child, target, STACK_ABOVE); |
508 } | 515 } |
509 | 516 |
(...skipping 933 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1443 return window; | 1450 return window; |
1444 if (offset) | 1451 if (offset) |
1445 *offset += window->bounds().OffsetFromOrigin(); | 1452 *offset += window->bounds().OffsetFromOrigin(); |
1446 } | 1453 } |
1447 if (offset) | 1454 if (offset) |
1448 *offset = gfx::Vector2d(); | 1455 *offset = gfx::Vector2d(); |
1449 return NULL; | 1456 return NULL; |
1450 } | 1457 } |
1451 | 1458 |
1452 } // namespace aura | 1459 } // namespace aura |
OLD | NEW |