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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 gfx::Point location_in_screen = event.location(); | 92 gfx::Point location_in_screen = 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 gfx::Screen::GetScreen()->GetDisplayNearestWindow(window).bounds(); |
103 } | 103 } |
104 | 104 |
105 } // namespace | 105 } // namespace |
106 | 106 |
107 // The height in pixels of the region below the top edge of the display in which | 107 // The height in pixels of the region below the top edge of the display in which |
108 // the mouse can trigger revealing the top-of-window views. | 108 // the mouse can trigger revealing the top-of-window views. |
109 #if defined(OS_WIN) | 109 #if defined(OS_WIN) |
110 // Windows 8 reserves some pixels at the top of the screen for the hand icon | 110 // Windows 8 reserves some pixels at the top of the screen for the hand icon |
111 // that allows you to drag a metro app off the screen, so a few additional | 111 // that allows you to drag a metro app off the screen, so a few additional |
112 // pixels of space must be reserved for the mouse reveal. | 112 // pixels of space must be reserved for the mouse reveal. |
(...skipping 806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
919 gfx::Rect hit_bounds_in_screen(GetDisplayBoundsInScreen(native_window_)); | 919 gfx::Rect hit_bounds_in_screen(GetDisplayBoundsInScreen(native_window_)); |
920 hit_bounds_in_screen.set_height(kImmersiveFullscreenTopEdgeInset); | 920 hit_bounds_in_screen.set_height(kImmersiveFullscreenTopEdgeInset); |
921 if (hit_bounds_in_screen.Contains(location)) | 921 if (hit_bounds_in_screen.Contains(location)) |
922 return true; | 922 return true; |
923 | 923 |
924 // There may be a bezel sensor off screen logically above | 924 // There may be a bezel sensor off screen logically above |
925 // |hit_bounds_in_screen|. The check for the event not contained by the | 925 // |hit_bounds_in_screen|. The check for the event not contained by the |
926 // closest screen ensures that the event is from a valid bezel (as opposed to | 926 // closest screen ensures that the event is from a valid bezel (as opposed to |
927 // another screen in an extended desktop). | 927 // another screen in an extended desktop). |
928 gfx::Rect screen_bounds = | 928 gfx::Rect screen_bounds = |
929 Shell::GetScreen()->GetDisplayNearestPoint(location).bounds(); | 929 gfx::Screen::GetScreen()->GetDisplayNearestPoint(location).bounds(); |
930 return (!screen_bounds.Contains(location) && | 930 return (!screen_bounds.Contains(location) && |
931 location.y() < hit_bounds_in_screen.y() && | 931 location.y() < hit_bounds_in_screen.y() && |
932 location.x() >= hit_bounds_in_screen.x() && | 932 location.x() >= hit_bounds_in_screen.x() && |
933 location.x() < hit_bounds_in_screen.right()); | 933 location.x() < hit_bounds_in_screen.right()); |
934 } | 934 } |
935 | 935 |
936 void ImmersiveFullscreenController::RecreateBubbleManager() { | 936 void ImmersiveFullscreenController::RecreateBubbleManager() { |
937 bubble_manager_.reset(new BubbleManager(this)); | 937 bubble_manager_.reset(new BubbleManager(this)); |
938 const std::vector<aura::Window*> transient_children = | 938 const std::vector<aura::Window*> transient_children = |
939 ::wm::GetTransientChildren(native_window_); | 939 ::wm::GetTransientChildren(native_window_); |
940 for (size_t i = 0; i < transient_children.size(); ++i) { | 940 for (size_t i = 0; i < transient_children.size(); ++i) { |
941 aura::Window* transient_child = transient_children[i]; | 941 aura::Window* transient_child = transient_children[i]; |
942 views::BubbleDelegateView* bubble_delegate = | 942 views::BubbleDelegateView* bubble_delegate = |
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 |