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 12 matching lines...) Expand all Loading... |
23 #include "ui/aura/client/window_stacking_client.h" | 23 #include "ui/aura/client/window_stacking_client.h" |
24 #include "ui/aura/env.h" | 24 #include "ui/aura/env.h" |
25 #include "ui/aura/layout_manager.h" | 25 #include "ui/aura/layout_manager.h" |
26 #include "ui/aura/window_delegate.h" | 26 #include "ui/aura/window_delegate.h" |
27 #include "ui/aura/window_event_dispatcher.h" | 27 #include "ui/aura/window_event_dispatcher.h" |
28 #include "ui/aura/window_observer.h" | 28 #include "ui/aura/window_observer.h" |
29 #include "ui/aura/window_tracker.h" | 29 #include "ui/aura/window_tracker.h" |
30 #include "ui/aura/window_tree_host.h" | 30 #include "ui/aura/window_tree_host.h" |
31 #include "ui/compositor/compositor.h" | 31 #include "ui/compositor/compositor.h" |
32 #include "ui/compositor/layer.h" | 32 #include "ui/compositor/layer.h" |
| 33 #include "ui/compositor/paint_context.h" |
33 #include "ui/events/event_target_iterator.h" | 34 #include "ui/events/event_target_iterator.h" |
34 #include "ui/gfx/canvas.h" | 35 #include "ui/gfx/canvas.h" |
35 #include "ui/gfx/path.h" | 36 #include "ui/gfx/path.h" |
36 #include "ui/gfx/scoped_canvas.h" | 37 #include "ui/gfx/scoped_canvas.h" |
37 #include "ui/gfx/screen.h" | 38 #include "ui/gfx/screen.h" |
38 | 39 |
39 namespace aura { | 40 namespace aura { |
40 | 41 |
41 namespace { | 42 namespace { |
42 | 43 |
(...skipping 871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
914 if (delegate_) | 915 if (delegate_) |
915 delegate_->OnWindowTargetVisibilityChanged(visible); | 916 delegate_->OnWindowTargetVisibilityChanged(visible); |
916 | 917 |
917 NotifyWindowVisibilityChanged(this, visible); | 918 NotifyWindowVisibilityChanged(this, visible); |
918 } | 919 } |
919 | 920 |
920 void Window::SchedulePaint() { | 921 void Window::SchedulePaint() { |
921 SchedulePaintInRect(gfx::Rect(0, 0, bounds().width(), bounds().height())); | 922 SchedulePaintInRect(gfx::Rect(0, 0, bounds().width(), bounds().height())); |
922 } | 923 } |
923 | 924 |
924 void Window::Paint(gfx::Canvas* canvas) { | 925 void Window::Paint(const ui::PaintContext& context) { |
925 if (delegate_) | 926 if (delegate_) |
926 delegate_->OnPaint(canvas); | 927 delegate_->OnPaint(context); |
927 } | 928 } |
928 | 929 |
929 Window* Window::GetWindowForPoint(const gfx::Point& local_point, | 930 Window* Window::GetWindowForPoint(const gfx::Point& local_point, |
930 bool return_tightest, | 931 bool return_tightest, |
931 bool for_event_handling) { | 932 bool for_event_handling) { |
932 if (!IsVisible()) | 933 if (!IsVisible()) |
933 return NULL; | 934 return NULL; |
934 | 935 |
935 if ((for_event_handling && !HitTest(local_point)) || | 936 if ((for_event_handling && !HitTest(local_point)) || |
936 (!for_event_handling && !ContainsPoint(local_point))) | 937 (!for_event_handling && !ContainsPoint(local_point))) |
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1314 state_modified |= | 1315 state_modified |= |
1315 ui::GestureRecognizer::Get()->CleanupStateForConsumer(this); | 1316 ui::GestureRecognizer::Get()->CleanupStateForConsumer(this); |
1316 for (Window::Windows::iterator iter = children_.begin(); | 1317 for (Window::Windows::iterator iter = children_.begin(); |
1317 iter != children_.end(); | 1318 iter != children_.end(); |
1318 ++iter) { | 1319 ++iter) { |
1319 state_modified |= (*iter)->CleanupGestureState(); | 1320 state_modified |= (*iter)->CleanupGestureState(); |
1320 } | 1321 } |
1321 return state_modified; | 1322 return state_modified; |
1322 } | 1323 } |
1323 | 1324 |
1324 void Window::OnPaintLayer(gfx::Canvas* canvas) { | 1325 void Window::OnPaintLayer(const ui::PaintContext& context) { |
1325 Paint(canvas); | 1326 Paint(context); |
1326 } | 1327 } |
1327 | 1328 |
1328 void Window::OnDelegatedFrameDamage(const gfx::Rect& damage_rect_in_dip) { | 1329 void Window::OnDelegatedFrameDamage(const gfx::Rect& damage_rect_in_dip) { |
1329 DCHECK(layer()); | 1330 DCHECK(layer()); |
1330 FOR_EACH_OBSERVER(WindowObserver, | 1331 FOR_EACH_OBSERVER(WindowObserver, |
1331 observers_, | 1332 observers_, |
1332 OnDelegatedFrameDamage(this, damage_rect_in_dip)); | 1333 OnDelegatedFrameDamage(this, damage_rect_in_dip)); |
1333 } | 1334 } |
1334 | 1335 |
1335 base::Closure Window::PrepareForLayerBoundsChange() { | 1336 base::Closure Window::PrepareForLayerBoundsChange() { |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1408 return window; | 1409 return window; |
1409 if (offset) | 1410 if (offset) |
1410 *offset += window->bounds().OffsetFromOrigin(); | 1411 *offset += window->bounds().OffsetFromOrigin(); |
1411 } | 1412 } |
1412 if (offset) | 1413 if (offset) |
1413 *offset = gfx::Vector2d(); | 1414 *offset = gfx::Vector2d(); |
1414 return NULL; | 1415 return NULL; |
1415 } | 1416 } |
1416 | 1417 |
1417 } // namespace aura | 1418 } // namespace aura |
OLD | NEW |