| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #import "chrome/browser/ui/cocoa/fullscreen/fullscreen_toolbar_mouse_tracker.h" | 5 #import "chrome/browser/ui/cocoa/fullscreen/fullscreen_toolbar_mouse_tracker.h" |
| 6 | 6 |
| 7 #include "chrome/browser/ui/cocoa/browser_window_controller.h" | 7 #include "chrome/browser/ui/cocoa/browser_window_controller.h" |
| 8 #include "chrome/browser/ui/cocoa/fullscreen/fullscreen_toolbar_animation_contro
ller.h" | 8 #include "chrome/browser/ui/cocoa/fullscreen/fullscreen_toolbar_animation_contro
ller.h" |
| 9 #import "chrome/browser/ui/cocoa/fullscreen_toolbar_controller.h" | 9 #import "chrome/browser/ui/cocoa/fullscreen/fullscreen_toolbar_controller.h" |
| 10 #include "ui/base/cocoa/appkit_utils.h" | 10 #include "ui/base/cocoa/appkit_utils.h" |
| 11 #import "ui/base/cocoa/tracking_area.h" | 11 #import "ui/base/cocoa/tracking_area.h" |
| 12 | 12 |
| 13 namespace { | 13 namespace { |
| 14 | 14 |
| 15 // Additional height threshold added at the toolbar's bottom. This is to mimic | 15 // Additional height threshold added at the toolbar's bottom. This is to mimic |
| 16 // threshold the mouse position needs to be at before the menubar automatically | 16 // threshold the mouse position needs to be at before the menubar automatically |
| 17 // hides. | 17 // hides. |
| 18 const CGFloat kTrackingAreaAdditionalThreshold = 20; | 18 const CGFloat kTrackingAreaAdditionalThreshold = 20; |
| 19 | 19 |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 | 113 |
| 114 - (void)mouseEntered:(NSEvent*)event { | 114 - (void)mouseEntered:(NSEvent*)event { |
| 115 // Empty implementation. Required for CrTrackingArea. | 115 // Empty implementation. Required for CrTrackingArea. |
| 116 } | 116 } |
| 117 | 117 |
| 118 - (void)mouseExited:(NSEvent*)event { | 118 - (void)mouseExited:(NSEvent*)event { |
| 119 DCHECK_EQ([event trackingArea], trackingArea_.get()); | 119 DCHECK_EQ([event trackingArea], trackingArea_.get()); |
| 120 | 120 |
| 121 animationController_->AnimateToolbarOutIfPossible(); | 121 animationController_->AnimateToolbarOutIfPossible(); |
| 122 | 122 |
| 123 [owner_ updateToolbar]; | 123 [owner_ updateToolbarLayout]; |
| 124 [self removeTrackingArea]; | 124 [self removeTrackingArea]; |
| 125 } | 125 } |
| 126 | 126 |
| 127 @end | 127 @end |
| OLD | NEW |