| 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> |
| 11 #include <map> | 11 #include <map> |
| 12 #include <set> | 12 #include <set> |
| 13 #include <string> | 13 #include <string> |
| 14 #include <utility> | 14 #include <utility> |
| 15 #include <vector> | 15 #include <vector> |
| 16 | 16 |
| 17 #include "base/mac/scoped_nsobject.h" | 17 #include "base/mac/scoped_nsobject.h" |
| 18 #include "base/memory/scoped_ptr.h" | 18 #include "base/memory/scoped_ptr.h" |
| 19 #include "base/memory/weak_ptr.h" | 19 #include "base/memory/weak_ptr.h" |
| 20 #include "base/time/time.h" | 20 #include "base/time/time.h" |
| 21 #include "content/browser/compositor/browser_compositor_view_mac.h" | 21 #include "content/browser/compositor/browser_compositor_view_mac.h" |
| 22 #include "content/browser/compositor/delegated_frame_host.h" | 22 #include "content/browser/compositor/delegated_frame_host.h" |
| 23 #include "content/browser/renderer_host/display_link_mac.h" | 23 #include "content/browser/renderer_host/display_link_mac.h" |
| 24 #include "content/browser/renderer_host/input/mouse_wheel_rails_filter_mac.h" |
| 24 #include "content/browser/renderer_host/render_widget_host_view_base.h" | 25 #include "content/browser/renderer_host/render_widget_host_view_base.h" |
| 25 #include "content/common/content_export.h" | 26 #include "content/common/content_export.h" |
| 26 #include "content/common/cursors/webcursor.h" | 27 #include "content/common/cursors/webcursor.h" |
| 27 #include "content/common/edit_command.h" | 28 #include "content/common/edit_command.h" |
| 28 #import "content/public/browser/render_widget_host_view_mac_base.h" | 29 #import "content/public/browser/render_widget_host_view_mac_base.h" |
| 29 #include "ipc/ipc_sender.h" | 30 #include "ipc/ipc_sender.h" |
| 30 #include "third_party/WebKit/public/web/WebCompositionUnderline.h" | 31 #include "third_party/WebKit/public/web/WebCompositionUnderline.h" |
| 31 #include "ui/accelerated_widget_mac/accelerated_widget_mac.h" | 32 #include "ui/accelerated_widget_mac/accelerated_widget_mac.h" |
| 32 #include "ui/accelerated_widget_mac/io_surface_layer.h" | 33 #include "ui/accelerated_widget_mac/io_surface_layer.h" |
| 33 #include "ui/base/cocoa/base_view.h" | 34 #include "ui/base/cocoa/base_view.h" |
| 34 #include "ui/base/cocoa/remote_layer_api.h" | 35 #include "ui/base/cocoa/remote_layer_api.h" |
| 35 #include "ui/gfx/display_observer.h" | 36 #include "ui/gfx/display_observer.h" |
| 36 | 37 |
| 37 namespace content { | 38 namespace content { |
| 39 class RenderWidgetHostImpl; |
| 38 class RenderWidgetHostViewMac; | 40 class RenderWidgetHostViewMac; |
| 39 class RenderWidgetHostViewMacEditCommandHelper; | 41 class RenderWidgetHostViewMacEditCommandHelper; |
| 40 class WebContents; | 42 class WebContents; |
| 41 } | 43 } |
| 42 | 44 |
| 43 namespace ui { | 45 namespace ui { |
| 44 class Compositor; | 46 class Compositor; |
| 45 class Layer; | 47 class Layer; |
| 46 } | 48 } |
| 47 | 49 |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 // If true then escape key down events are suppressed until the first escape | 166 // If true then escape key down events are suppressed until the first escape |
| 165 // key up event. (The up event is suppressed as well). This is used by the | 167 // key up event. (The up event is suppressed as well). This is used by the |
| 166 // flash fullscreen code to avoid sending a key up event without a matching | 168 // flash fullscreen code to avoid sending a key up event without a matching |
| 167 // key down event. | 169 // key down event. |
| 168 BOOL suppressNextEscapeKeyUp_; | 170 BOOL suppressNextEscapeKeyUp_; |
| 169 | 171 |
| 170 // The set of key codes from key down events that we haven't seen the matching | 172 // The set of key codes from key down events that we haven't seen the matching |
| 171 // key up events yet. | 173 // key up events yet. |
| 172 // Used for filtering out non-matching NSKeyUp events. | 174 // Used for filtering out non-matching NSKeyUp events. |
| 173 std::set<unsigned short> keyDownCodes_; | 175 std::set<unsigned short> keyDownCodes_; |
| 176 |
| 177 // The filter used to guide touch events towards a horizontal or vertical |
| 178 // orientation. |
| 179 content::MouseWheelRailsFilterMac mouseWheelFilter_; |
| 174 } | 180 } |
| 175 | 181 |
| 176 @property(nonatomic, readonly) NSRange selectedRange; | 182 @property(nonatomic, readonly) NSRange selectedRange; |
| 177 @property(nonatomic, readonly) BOOL suppressNextEscapeKeyUp; | 183 @property(nonatomic, readonly) BOOL suppressNextEscapeKeyUp; |
| 178 | 184 |
| 179 - (void)setCanBeKeyView:(BOOL)can; | 185 - (void)setCanBeKeyView:(BOOL)can; |
| 180 - (void)setCloseOnDeactivate:(BOOL)b; | 186 - (void)setCloseOnDeactivate:(BOOL)b; |
| 181 - (void)setOpaque:(BOOL)opaque; | 187 - (void)setOpaque:(BOOL)opaque; |
| 182 - (void)setToolTipAtMousePoint:(NSString *)string; | 188 - (void)setToolTipAtMousePoint:(NSString *)string; |
| 183 // True for always-on-top special windows (e.g. Balloons and Panels). | 189 // True for always-on-top special windows (e.g. Balloons and Panels). |
| 184 - (BOOL)acceptsMouseEventsWhenInactive; | 190 - (BOOL)acceptsMouseEventsWhenInactive; |
| 185 // Cancel ongoing composition (abandon the marked text). | 191 // Cancel ongoing composition (abandon the marked text). |
| 186 - (void)cancelComposition; | 192 - (void)cancelComposition; |
| 187 // Confirm ongoing composition. | 193 // Confirm ongoing composition. |
| 188 - (void)confirmComposition; | 194 - (void)confirmComposition; |
| 189 // Enables or disables plugin IME. | 195 // Enables or disables plugin IME. |
| 190 - (void)setPluginImeActive:(BOOL)active; | 196 - (void)setPluginImeActive:(BOOL)active; |
| 191 // Updates the current plugin focus state. | 197 // Updates the current plugin focus state. |
| 192 - (void)pluginFocusChanged:(BOOL)focused forPlugin:(int)pluginId; | 198 - (void)pluginFocusChanged:(BOOL)focused forPlugin:(int)pluginId; |
| 193 // Evaluates the event in the context of plugin IME, if plugin IME is enabled. | 199 // Evaluates the event in the context of plugin IME, if plugin IME is enabled. |
| 194 // Returns YES if the event was handled. | 200 // Returns YES if the event was handled. |
| 195 - (BOOL)postProcessEventForPluginIme:(NSEvent*)event; | 201 - (BOOL)postProcessEventForPluginIme:(NSEvent*)event; |
| 196 - (void)updateCursor:(NSCursor*)cursor; | 202 - (void)updateCursor:(NSCursor*)cursor; |
| 197 - (NSRect)firstViewRectForCharacterRange:(NSRange)theRange | 203 - (NSRect)firstViewRectForCharacterRange:(NSRange)theRange |
| 198 actualRange:(NSRangePointer)actualRange; | 204 actualRange:(NSRangePointer)actualRange; |
| 199 @end | 205 @end |
| 200 | 206 |
| 201 namespace content { | 207 namespace content { |
| 202 class RenderWidgetHostImpl; | |
| 203 | 208 |
| 204 /////////////////////////////////////////////////////////////////////////////// | 209 /////////////////////////////////////////////////////////////////////////////// |
| 205 // RenderWidgetHostViewMac | 210 // RenderWidgetHostViewMac |
| 206 // | 211 // |
| 207 // An object representing the "View" of a rendered web page. This object is | 212 // An object representing the "View" of a rendered web page. This object is |
| 208 // responsible for displaying the content of the web page, and integrating with | 213 // responsible for displaying the content of the web page, and integrating with |
| 209 // the Cocoa view system. It is the implementation of the RenderWidgetHostView | 214 // the Cocoa view system. It is the implementation of the RenderWidgetHostView |
| 210 // that the cross-platform RenderWidgetHost object uses | 215 // that the cross-platform RenderWidgetHost object uses |
| 211 // to display the data. | 216 // to display the data. |
| 212 // | 217 // |
| (...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 574 | 579 |
| 575 // Factory used to safely scope delayed calls to ShutdownHost(). | 580 // Factory used to safely scope delayed calls to ShutdownHost(). |
| 576 base::WeakPtrFactory<RenderWidgetHostViewMac> weak_factory_; | 581 base::WeakPtrFactory<RenderWidgetHostViewMac> weak_factory_; |
| 577 | 582 |
| 578 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMac); | 583 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMac); |
| 579 }; | 584 }; |
| 580 | 585 |
| 581 } // namespace content | 586 } // namespace content |
| 582 | 587 |
| 583 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ | 588 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ |
| OLD | NEW |