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/client/default_capture_client.h" | 5 #include "ui/aura/client/default_capture_client.h" |
6 | 6 |
7 #include "ui/aura/root_window.h" | 7 #include "ui/aura/root_window.h" |
8 | 8 |
9 namespace aura { | 9 namespace aura { |
10 namespace client { | 10 namespace client { |
(...skipping 12 matching lines...) Expand all Loading... |
23 if (capture_window_ == window) | 23 if (capture_window_ == window) |
24 return; | 24 return; |
25 if (window) { | 25 if (window) { |
26 ui::GestureRecognizer::Get()->TransferEventsTo( | 26 ui::GestureRecognizer::Get()->TransferEventsTo( |
27 capture_window_, window); | 27 capture_window_, window); |
28 } | 28 } |
29 | 29 |
30 Window* old_capture_window = capture_window_; | 30 Window* old_capture_window = capture_window_; |
31 capture_window_ = window; | 31 capture_window_ = window; |
32 | 32 |
33 CaptureDelegate* capture_delegate = root_window_->GetRootWindow(); | 33 CaptureDelegate* capture_delegate = root_window_->GetDispatcher(); |
34 if (capture_window_) | 34 if (capture_window_) |
35 capture_delegate->SetNativeCapture(); | 35 capture_delegate->SetNativeCapture(); |
36 else | 36 else |
37 capture_delegate->ReleaseNativeCapture(); | 37 capture_delegate->ReleaseNativeCapture(); |
38 | 38 |
39 capture_delegate->UpdateCapture(old_capture_window, capture_window_); | 39 capture_delegate->UpdateCapture(old_capture_window, capture_window_); |
40 } | 40 } |
41 | 41 |
42 void DefaultCaptureClient::ReleaseCapture(Window* window) { | 42 void DefaultCaptureClient::ReleaseCapture(Window* window) { |
43 if (capture_window_ != window) | 43 if (capture_window_ != window) |
44 return; | 44 return; |
45 SetCapture(NULL); | 45 SetCapture(NULL); |
46 } | 46 } |
47 | 47 |
48 Window* DefaultCaptureClient::GetCaptureWindow() { | 48 Window* DefaultCaptureClient::GetCaptureWindow() { |
49 return capture_window_; | 49 return capture_window_; |
50 } | 50 } |
51 | 51 |
52 } // namespace client | 52 } // namespace client |
53 } // namespace aura | 53 } // namespace aura |
OLD | NEW |