| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "ash/wm/immersive_fullscreen_controller.h" | 5 #include "ash/wm/immersive_fullscreen_controller.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "ash/ash_constants.h" | 9 #include "ash/ash_constants.h" |
| 10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 for (aura::Window* window = maybe_transient; window; | 82 for (aura::Window* window = maybe_transient; window; |
| 83 window = ::wm::GetTransientParent(window)) { | 83 window = ::wm::GetTransientParent(window)) { |
| 84 if (window == toplevel) | 84 if (window == toplevel) |
| 85 return true; | 85 return true; |
| 86 } | 86 } |
| 87 return false; | 87 return false; |
| 88 } | 88 } |
| 89 | 89 |
| 90 // Returns the location of |event| in screen coordinates. | 90 // Returns the location of |event| in screen coordinates. |
| 91 gfx::Point GetEventLocationInScreen(const ui::LocatedEvent& event) { | 91 gfx::Point GetEventLocationInScreen(const ui::LocatedEvent& event) { |
| 92 gfx::Point location_in_screen = event.location(); | 92 gfx::Point location_in_screen = gfx::ToFlooredPoint(event.location()); |
| 93 aura::Window* target = static_cast<aura::Window*>(event.target()); | 93 aura::Window* target = static_cast<aura::Window*>(event.target()); |
| 94 aura::client::ScreenPositionClient* screen_position_client = | 94 aura::client::ScreenPositionClient* screen_position_client = |
| 95 aura::client::GetScreenPositionClient(target->GetRootWindow()); | 95 aura::client::GetScreenPositionClient(target->GetRootWindow()); |
| 96 screen_position_client->ConvertPointToScreen(target, &location_in_screen); | 96 screen_position_client->ConvertPointToScreen(target, &location_in_screen); |
| 97 return location_in_screen; | 97 return location_in_screen; |
| 98 } | 98 } |
| 99 | 99 |
| 100 // Returns the bounds of the display nearest to |window| in screen coordinates. | 100 // Returns the bounds of the display nearest to |window| in screen coordinates. |
| 101 gfx::Rect GetDisplayBoundsInScreen(aura::Window* window) { | 101 gfx::Rect GetDisplayBoundsInScreen(aura::Window* window) { |
| 102 return Shell::GetScreen()->GetDisplayNearestWindow(window).bounds(); | 102 return Shell::GetScreen()->GetDisplayNearestWindow(window).bounds(); |
| (...skipping 840 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 943 AsBubbleDelegate(transient_child); | 943 AsBubbleDelegate(transient_child); |
| 944 if (bubble_delegate && | 944 if (bubble_delegate && |
| 945 bubble_delegate->GetAnchorView() && | 945 bubble_delegate->GetAnchorView() && |
| 946 top_container_->Contains(bubble_delegate->GetAnchorView())) { | 946 top_container_->Contains(bubble_delegate->GetAnchorView())) { |
| 947 bubble_manager_->StartObserving(transient_child); | 947 bubble_manager_->StartObserving(transient_child); |
| 948 } | 948 } |
| 949 } | 949 } |
| 950 } | 950 } |
| 951 | 951 |
| 952 } // namespace ash | 952 } // namespace ash |
| OLD | NEW |