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/root_window.h" | 5 #include "ui/aura/root_window.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
11 #include "base/debug/trace_event.h" | 11 #include "base/debug/trace_event.h" |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
13 #include "base/message_loop/message_loop.h" | 13 #include "base/message_loop/message_loop.h" |
14 #include "ui/aura/client/activation_client.h" | |
15 #include "ui/aura/client/capture_client.h" | 14 #include "ui/aura/client/capture_client.h" |
16 #include "ui/aura/client/cursor_client.h" | 15 #include "ui/aura/client/cursor_client.h" |
17 #include "ui/aura/client/event_client.h" | 16 #include "ui/aura/client/event_client.h" |
18 #include "ui/aura/client/focus_client.h" | 17 #include "ui/aura/client/focus_client.h" |
19 #include "ui/aura/client/screen_position_client.h" | 18 #include "ui/aura/client/screen_position_client.h" |
20 #include "ui/aura/env.h" | 19 #include "ui/aura/env.h" |
21 #include "ui/aura/root_window_host.h" | 20 #include "ui/aura/root_window_host.h" |
22 #include "ui/aura/root_window_observer.h" | 21 #include "ui/aura/root_window_observer.h" |
23 #include "ui/aura/root_window_transformer.h" | 22 #include "ui/aura/root_window_transformer.h" |
24 #include "ui/aura/window.h" | 23 #include "ui/aura/window.h" |
(...skipping 748 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
773 DispatchMouseExitToHidingWindow(detached); | 772 DispatchMouseExitToHidingWindow(detached); |
774 OnWindowHidden(detached, new_root ? WINDOW_MOVING : WINDOW_HIDDEN); | 773 OnWindowHidden(detached, new_root ? WINDOW_MOVING : WINDOW_HIDDEN); |
775 | 774 |
776 if (detached->IsVisible() && | 775 if (detached->IsVisible() && |
777 detached->ContainsPointInRoot(GetLastMouseLocationInRoot())) { | 776 detached->ContainsPointInRoot(GetLastMouseLocationInRoot())) { |
778 PostMouseMoveEventAfterWindowChange(); | 777 PostMouseMoveEventAfterWindowChange(); |
779 } | 778 } |
780 } | 779 } |
781 | 780 |
782 void RootWindow::OnWindowHidden(Window* invisible, WindowHiddenReason reason) { | 781 void RootWindow::OnWindowHidden(Window* invisible, WindowHiddenReason reason) { |
783 // TODO(beng): This should be removed once FocusController is turned on. | |
784 if (client::GetFocusClient(this)) { | |
785 client::GetFocusClient(this)->OnWindowHiddenInRootWindow( | |
786 invisible, this, reason == WINDOW_DESTROYED); | |
787 } | |
788 | |
789 // Do not clear the capture, and the |event_dispatch_target_| if the | 782 // Do not clear the capture, and the |event_dispatch_target_| if the |
790 // window is moving across root windows, because the target itself | 783 // window is moving across root windows, because the target itself |
791 // is actually still visible and clearing them stops further event | 784 // is actually still visible and clearing them stops further event |
792 // processing, which can cause unexpected behaviors. See | 785 // processing, which can cause unexpected behaviors. See |
793 // crbug.com/157583 | 786 // crbug.com/157583 |
794 if (reason != WINDOW_MOVING) { | 787 if (reason != WINDOW_MOVING) { |
795 Window* capture_window = aura::client::GetCaptureWindow(this); | 788 Window* capture_window = aura::client::GetCaptureWindow(this); |
796 // If the ancestor of the capture window is hidden, | 789 // If the ancestor of the capture window is hidden, |
797 // release the capture. | 790 // release the capture. |
798 if (invisible->Contains(capture_window) && invisible != this) | 791 if (invisible->Contains(capture_window) && invisible != this) |
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1252 } | 1245 } |
1253 | 1246 |
1254 gfx::Transform RootWindow::GetInverseRootTransform() const { | 1247 gfx::Transform RootWindow::GetInverseRootTransform() const { |
1255 float scale = ui::GetDeviceScaleFactor(layer()); | 1248 float scale = ui::GetDeviceScaleFactor(layer()); |
1256 gfx::Transform transform; | 1249 gfx::Transform transform; |
1257 transform.Scale(1.0f / scale, 1.0f / scale); | 1250 transform.Scale(1.0f / scale, 1.0f / scale); |
1258 return transformer_->GetInverseTransform() * transform; | 1251 return transformer_->GetInverseTransform() * transform; |
1259 } | 1252 } |
1260 | 1253 |
1261 } // namespace aura | 1254 } // namespace aura |
OLD | NEW |