Chromium Code Reviews| 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/shared/immersive_fullscreen_controller.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "ash/common/ash_constants.h" | |
| 10 #include "ash/common/wm/immersive/wm_immersive_fullscreen_controller_delegate.h" | |
| 11 #include "ash/shared/immersive_context.h" | 9 #include "ash/shared/immersive_context.h" |
| 12 #include "ash/shared/immersive_focus_watcher.h" | 10 #include "ash/shared/immersive_focus_watcher.h" |
| 11 #include "ash/shared/immersive_fullscreen_controller_delegate.h" | |
| 13 #include "ash/shared/immersive_gesture_handler.h" | 12 #include "ash/shared/immersive_gesture_handler.h" |
| 14 #include "ash/wm/immersive_handler_factory.h" | 13 #include "ash/shared/immersive_handler_factory.h" |
| 15 #include "base/metrics/histogram.h" | 14 #include "base/metrics/histogram.h" |
| 16 #include "ui/display/display.h" | 15 #include "ui/display/display.h" |
| 17 #include "ui/display/screen.h" | 16 #include "ui/display/screen.h" |
| 18 #include "ui/events/base_event_utils.h" | 17 #include "ui/events/base_event_utils.h" |
| 19 #include "ui/gfx/animation/slide_animation.h" | 18 #include "ui/gfx/animation/slide_animation.h" |
| 20 #include "ui/gfx/geometry/point.h" | 19 #include "ui/gfx/geometry/point.h" |
| 21 #include "ui/gfx/geometry/rect.h" | 20 #include "ui/gfx/geometry/rect.h" |
| 22 #include "ui/views/bubble/bubble_dialog_delegate.h" | 21 #include "ui/views/bubble/bubble_dialog_delegate.h" |
| 23 #include "ui/views/view.h" | 22 #include "ui/views/view.h" |
| 24 #include "ui/views/widget/widget.h" | 23 #include "ui/views/widget/widget.h" |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 53 // See ShouldIgnoreMouseEventAtLocation() for more details. | 52 // See ShouldIgnoreMouseEventAtLocation() for more details. |
| 54 const int kHeightOfDeadRegionAboveTopContainer = 10; | 53 const int kHeightOfDeadRegionAboveTopContainer = 10; |
| 55 | 54 |
| 56 } // namespace | 55 } // namespace |
| 57 | 56 |
| 58 // The height in pixels of the region below the top edge of the display in which | 57 // The height in pixels of the region below the top edge of the display in which |
| 59 // the mouse can trigger revealing the top-of-window views. | 58 // the mouse can trigger revealing the top-of-window views. |
| 60 // The height must be greater than 1px because the top pixel is used to trigger | 59 // The height must be greater than 1px because the top pixel is used to trigger |
| 61 // moving the cursor between displays if the user has a vertical display layout | 60 // moving the cursor between displays if the user has a vertical display layout |
| 62 // (primary display above/below secondary display). | 61 // (primary display above/below secondary display). |
| 62 // static | |
| 63 const int ImmersiveFullscreenController::kMouseRevealBoundsHeight = 3; | 63 const int ImmersiveFullscreenController::kMouseRevealBoundsHeight = 3; |
| 64 | 64 |
| 65 // static | |
|
James Cook
2016/08/19 18:15:16
nit: Either put the comment here for consistency w
sky
2016/08/19 19:25:40
I moved the above comment to the header as that is
| |
| 66 const int ImmersiveFullscreenController::kImmersiveFullscreenTopEdgeInset = 8; | |
| 67 | |
| 65 //////////////////////////////////////////////////////////////////////////////// | 68 //////////////////////////////////////////////////////////////////////////////// |
| 66 | 69 |
| 67 ImmersiveFullscreenController::ImmersiveFullscreenController() | 70 ImmersiveFullscreenController::ImmersiveFullscreenController() |
| 68 : delegate_(NULL), | 71 : delegate_(NULL), |
| 69 top_container_(NULL), | 72 top_container_(NULL), |
| 70 widget_(NULL), | 73 widget_(NULL), |
| 71 observers_enabled_(false), | 74 observers_enabled_(false), |
| 72 enabled_(false), | 75 enabled_(false), |
| 73 reveal_state_(CLOSED), | 76 reveal_state_(CLOSED), |
| 74 revealed_lock_count_(0), | 77 revealed_lock_count_(0), |
| 75 mouse_x_when_hit_top_in_screen_(-1), | 78 mouse_x_when_hit_top_in_screen_(-1), |
| 76 gesture_begun_(false), | 79 gesture_begun_(false), |
| 77 animation_(new gfx::SlideAnimation(this)), | 80 animation_(new gfx::SlideAnimation(this)), |
| 78 animations_disabled_for_test_(false), | 81 animations_disabled_for_test_(false), |
| 79 weak_ptr_factory_(this) {} | 82 weak_ptr_factory_(this) {} |
| 80 | 83 |
| 81 ImmersiveFullscreenController::~ImmersiveFullscreenController() { | 84 ImmersiveFullscreenController::~ImmersiveFullscreenController() { |
| 82 EnableWindowObservers(false); | 85 EnableWindowObservers(false); |
| 83 } | 86 } |
| 84 | 87 |
| 85 void ImmersiveFullscreenController::Init( | 88 void ImmersiveFullscreenController::Init( |
| 86 WmImmersiveFullscreenControllerDelegate* delegate, | 89 ImmersiveFullscreenControllerDelegate* delegate, |
| 87 views::Widget* widget, | 90 views::Widget* widget, |
| 88 views::View* top_container) { | 91 views::View* top_container) { |
| 89 delegate_ = delegate; | 92 delegate_ = delegate; |
| 90 top_container_ = top_container; | 93 top_container_ = top_container; |
| 91 widget_ = widget; | 94 widget_ = widget; |
| 92 ImmersiveContext::Get()->InstallResizeHandleWindowTargeter(this); | 95 ImmersiveContext::Get()->InstallResizeHandleWindowTargeter(this); |
| 93 } | 96 } |
| 94 | 97 |
| 95 void ImmersiveFullscreenController::SetEnabled(WindowType window_type, | 98 void ImmersiveFullscreenController::SetEnabled(WindowType window_type, |
| 96 bool enabled) { | 99 bool enabled) { |
| (...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 646 location.y() < hit_bounds_in_screen.y() && | 649 location.y() < hit_bounds_in_screen.y() && |
| 647 location.x() >= hit_bounds_in_screen.x() && | 650 location.x() >= hit_bounds_in_screen.x() && |
| 648 location.x() < hit_bounds_in_screen.right()); | 651 location.x() < hit_bounds_in_screen.right()); |
| 649 } | 652 } |
| 650 | 653 |
| 651 gfx::Rect ImmersiveFullscreenController::GetDisplayBoundsInScreen() const { | 654 gfx::Rect ImmersiveFullscreenController::GetDisplayBoundsInScreen() const { |
| 652 return ImmersiveContext::Get()->GetDisplayBoundsInScreen(widget_); | 655 return ImmersiveContext::Get()->GetDisplayBoundsInScreen(widget_); |
| 653 } | 656 } |
| 654 | 657 |
| 655 } // namespace ash | 658 } // namespace ash |
| OLD | NEW |