| 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 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ |
| 7 | 7 |
| 8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
| 9 #include <IOSurface/IOSurfaceAPI.h> | 9 #include <IOSurface/IOSurfaceAPI.h> |
| 10 #include <list> | 10 #include <list> |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 id endWheelMonitor_; | 152 id endWheelMonitor_; |
| 153 | 153 |
| 154 // When a gesture starts, the system does not inform the view of which type | 154 // When a gesture starts, the system does not inform the view of which type |
| 155 // of gesture is happening (magnify, rotate, etc), rather, it just informs | 155 // of gesture is happening (magnify, rotate, etc), rather, it just informs |
| 156 // the view that some as-yet-undefined gesture is starting. Capture the | 156 // the view that some as-yet-undefined gesture is starting. Capture the |
| 157 // information about the gesture's beginning event here. It will be used to | 157 // information about the gesture's beginning event here. It will be used to |
| 158 // create a specific gesture begin event later. | 158 // create a specific gesture begin event later. |
| 159 scoped_ptr<blink::WebGestureEvent> gestureBeginEvent_; | 159 scoped_ptr<blink::WebGestureEvent> gestureBeginEvent_; |
| 160 | 160 |
| 161 // To avoid accidental pinches, require that a certain zoom threshold be | 161 // To avoid accidental pinches, require that a certain zoom threshold be |
| 162 // reached before forwarding it to the browser. Use |unusedPinchAmount_| to | 162 // reached before forwarding it to the browser. Use |pinchUnusedAmount_| to |
| 163 // hold this value. If the user reaches this value, don't re-require the | 163 // hold this value. If the user reaches this value, don't re-require the |
| 164 // threshold be reached until a certain time has passed since the last | 164 // threshold be reached until the page has been zoomed back to page scale of |
| 165 // zoom. Store the time of the last zoom in |lastUsedPinchEventTimestamp_|. | 165 // one. |
| 166 float unusedPinchAmount_; | 166 bool pinchHasReachedZoomThreshold_; |
| 167 NSTimeInterval lastUsedPinchEventTimestamp_; | 167 float pinchUnusedAmount_; |
| 168 NSTimeInterval pinchLastGestureTimestamp_; |
| 168 | 169 |
| 169 // This is set if a GesturePinchBegin event has been sent in the lifetime of | 170 // This is set if a GesturePinchBegin event has been sent in the lifetime of |
| 170 // |gestureBeginEvent_|. If set, a GesturePinchEnd will be sent when the | 171 // |gestureBeginEvent_|. If set, a GesturePinchEnd will be sent when the |
| 171 // gesture ends. | 172 // gesture ends. |
| 172 BOOL gestureBeginPinchSent_; | 173 BOOL gestureBeginPinchSent_; |
| 173 | 174 |
| 174 // If true then escape key down events are suppressed until the first escape | 175 // If true then escape key down events are suppressed until the first escape |
| 175 // key up event. (The up event is suppressed as well). This is used by the | 176 // key up event. (The up event is suppressed as well). This is used by the |
| 176 // flash fullscreen code to avoid sending a key up event without a matching | 177 // flash fullscreen code to avoid sending a key up event without a matching |
| 177 // key down event. | 178 // key down event. |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 443 | 444 |
| 444 // Container for ui::Compositor the CALayer tree drawn by it. | 445 // Container for ui::Compositor the CALayer tree drawn by it. |
| 445 scoped_ptr<BrowserCompositorMac> browser_compositor_; | 446 scoped_ptr<BrowserCompositorMac> browser_compositor_; |
| 446 | 447 |
| 447 // Placeholder that is allocated while browser_compositor_ is NULL, | 448 // Placeholder that is allocated while browser_compositor_ is NULL, |
| 448 // indicating that a BrowserCompositorViewMac may be allocated. This is to | 449 // indicating that a BrowserCompositorViewMac may be allocated. This is to |
| 449 // help in recycling the internals of BrowserCompositorViewMac. | 450 // help in recycling the internals of BrowserCompositorViewMac. |
| 450 scoped_ptr<BrowserCompositorMacPlaceholder> | 451 scoped_ptr<BrowserCompositorMacPlaceholder> |
| 451 browser_compositor_placeholder_; | 452 browser_compositor_placeholder_; |
| 452 | 453 |
| 454 // Set when the currently-displayed frame is at page scale one. Used to |
| 455 // determine if pinch gestures need to be thresholded. |
| 456 bool page_is_at_scale_one_; |
| 457 |
| 453 NSWindow* pepper_fullscreen_window() const { | 458 NSWindow* pepper_fullscreen_window() const { |
| 454 return pepper_fullscreen_window_; | 459 return pepper_fullscreen_window_; |
| 455 } | 460 } |
| 456 | 461 |
| 457 CONTENT_EXPORT void release_pepper_fullscreen_window_for_testing(); | 462 CONTENT_EXPORT void release_pepper_fullscreen_window_for_testing(); |
| 458 | 463 |
| 459 RenderWidgetHostViewMac* fullscreen_parent_host_view() const { | 464 RenderWidgetHostViewMac* fullscreen_parent_host_view() const { |
| 460 return fullscreen_parent_host_view_; | 465 return fullscreen_parent_host_view_; |
| 461 } | 466 } |
| 462 | 467 |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 584 | 589 |
| 585 // Factory used to safely scope delayed calls to ShutdownHost(). | 590 // Factory used to safely scope delayed calls to ShutdownHost(). |
| 586 base::WeakPtrFactory<RenderWidgetHostViewMac> weak_factory_; | 591 base::WeakPtrFactory<RenderWidgetHostViewMac> weak_factory_; |
| 587 | 592 |
| 588 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMac); | 593 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMac); |
| 589 }; | 594 }; |
| 590 | 595 |
| 591 } // namespace content | 596 } // namespace content |
| 592 | 597 |
| 593 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ | 598 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ |
| OLD | NEW |