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 #include "content/browser/renderer_host/render_widget_host_view_mac.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_mac.h" |
6 | 6 |
7 #import <objc/runtime.h> | 7 #import <objc/runtime.h> |
8 #include <OpenGL/gl.h> | 8 #include <OpenGL/gl.h> |
9 #include <QuartzCore/QuartzCore.h> | 9 #include <QuartzCore/QuartzCore.h> |
10 | 10 |
(...skipping 20 matching lines...) Expand all Loading... |
31 #include "content/browser/bad_message.h" | 31 #include "content/browser/bad_message.h" |
32 #import "content/browser/cocoa/system_hotkey_helper_mac.h" | 32 #import "content/browser/cocoa/system_hotkey_helper_mac.h" |
33 #import "content/browser/cocoa/system_hotkey_map.h" | 33 #import "content/browser/cocoa/system_hotkey_map.h" |
34 #include "content/browser/compositor/resize_lock.h" | 34 #include "content/browser/compositor/resize_lock.h" |
35 #include "content/browser/frame_host/frame_tree.h" | 35 #include "content/browser/frame_host/frame_tree.h" |
36 #include "content/browser/frame_host/frame_tree_node.h" | 36 #include "content/browser/frame_host/frame_tree_node.h" |
37 #include "content/browser/frame_host/render_frame_host_impl.h" | 37 #include "content/browser/frame_host/render_frame_host_impl.h" |
38 #include "content/browser/gpu/compositor_util.h" | 38 #include "content/browser/gpu/compositor_util.h" |
39 #include "content/browser/renderer_host/render_view_host_impl.h" | 39 #include "content/browser/renderer_host/render_view_host_impl.h" |
40 #include "content/browser/renderer_host/render_widget_helper.h" | 40 #include "content/browser/renderer_host/render_widget_helper.h" |
| 41 #include "content/browser/renderer_host/render_widget_host_delegate.h" |
41 #import "content/browser/renderer_host/render_widget_host_view_mac_dictionary_he
lper.h" | 42 #import "content/browser/renderer_host/render_widget_host_view_mac_dictionary_he
lper.h" |
42 #import "content/browser/renderer_host/render_widget_host_view_mac_editcommand_h
elper.h" | 43 #import "content/browser/renderer_host/render_widget_host_view_mac_editcommand_h
elper.h" |
43 #include "content/browser/renderer_host/render_widget_resize_helper.h" | 44 #include "content/browser/renderer_host/render_widget_resize_helper.h" |
44 #import "content/browser/renderer_host/text_input_client_mac.h" | 45 #import "content/browser/renderer_host/text_input_client_mac.h" |
45 #include "content/common/accessibility_messages.h" | 46 #include "content/common/accessibility_messages.h" |
46 #include "content/common/edit_command.h" | 47 #include "content/common/edit_command.h" |
47 #include "content/common/gpu/gpu_messages.h" | 48 #include "content/common/gpu/gpu_messages.h" |
48 #include "content/common/input_messages.h" | 49 #include "content/common/input_messages.h" |
49 #include "content/common/view_messages.h" | 50 #include "content/common/view_messages.h" |
50 #include "content/common/webplugin_geometry.h" | 51 #include "content/common/webplugin_geometry.h" |
(...skipping 3016 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3067 web_contents->Undo(); | 3068 web_contents->Undo(); |
3068 } | 3069 } |
3069 | 3070 |
3070 - (void)redo:(id)sender { | 3071 - (void)redo:(id)sender { |
3071 WebContents* web_contents = renderWidgetHostView_->GetWebContents(); | 3072 WebContents* web_contents = renderWidgetHostView_->GetWebContents(); |
3072 if (web_contents) | 3073 if (web_contents) |
3073 web_contents->Redo(); | 3074 web_contents->Redo(); |
3074 } | 3075 } |
3075 | 3076 |
3076 - (void)cut:(id)sender { | 3077 - (void)cut:(id)sender { |
3077 WebContents* web_contents = renderWidgetHostView_->GetWebContents(); | 3078 content::RenderWidgetHostDelegate* render_widget_host_delegate = |
3078 if (web_contents) | 3079 renderWidgetHostView_->render_widget_host_->delegate(); |
3079 web_contents->Cut(); | 3080 if (render_widget_host_delegate) |
| 3081 render_widget_host_delegate->Cut(); |
3080 } | 3082 } |
3081 | 3083 |
3082 - (void)copy:(id)sender { | 3084 - (void)copy:(id)sender { |
3083 WebContents* web_contents = renderWidgetHostView_->GetWebContents(); | 3085 content::RenderWidgetHostDelegate* render_widget_host_delegate = |
3084 if (web_contents) | 3086 renderWidgetHostView_->render_widget_host_->delegate(); |
3085 web_contents->Copy(); | 3087 if (render_widget_host_delegate) |
| 3088 render_widget_host_delegate->Copy(); |
3086 } | 3089 } |
3087 | 3090 |
3088 - (void)copyToFindPboard:(id)sender { | 3091 - (void)copyToFindPboard:(id)sender { |
3089 WebContents* web_contents = renderWidgetHostView_->GetWebContents(); | 3092 WebContents* web_contents = renderWidgetHostView_->GetWebContents(); |
3090 if (web_contents) | 3093 if (web_contents) |
3091 web_contents->CopyToFindPboard(); | 3094 web_contents->CopyToFindPboard(); |
3092 } | 3095 } |
3093 | 3096 |
3094 - (void)paste:(id)sender { | 3097 - (void)paste:(id)sender { |
3095 WebContents* web_contents = renderWidgetHostView_->GetWebContents(); | 3098 content::RenderWidgetHostDelegate* render_widget_host_delegate = |
3096 if (web_contents) | 3099 renderWidgetHostView_->render_widget_host_->delegate(); |
3097 web_contents->Paste(); | 3100 if (render_widget_host_delegate) |
| 3101 render_widget_host_delegate->Paste(); |
3098 } | 3102 } |
3099 | 3103 |
3100 - (void)pasteAndMatchStyle:(id)sender { | 3104 - (void)pasteAndMatchStyle:(id)sender { |
3101 WebContents* web_contents = renderWidgetHostView_->GetWebContents(); | 3105 WebContents* web_contents = renderWidgetHostView_->GetWebContents(); |
3102 if (web_contents) | 3106 if (web_contents) |
3103 web_contents->PasteAndMatchStyle(); | 3107 web_contents->PasteAndMatchStyle(); |
3104 } | 3108 } |
3105 | 3109 |
3106 - (void)selectAll:(id)sender { | 3110 - (void)selectAll:(id)sender { |
3107 // editCommand_helper_ adds implementations for most NSResponder methods | 3111 // editCommand_helper_ adds implementations for most NSResponder methods |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3290 | 3294 |
3291 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding | 3295 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding |
3292 // regions that are not draggable. (See ControlRegionView in | 3296 // regions that are not draggable. (See ControlRegionView in |
3293 // native_app_window_cocoa.mm). This requires the render host view to be | 3297 // native_app_window_cocoa.mm). This requires the render host view to be |
3294 // draggable by default. | 3298 // draggable by default. |
3295 - (BOOL)mouseDownCanMoveWindow { | 3299 - (BOOL)mouseDownCanMoveWindow { |
3296 return YES; | 3300 return YES; |
3297 } | 3301 } |
3298 | 3302 |
3299 @end | 3303 @end |
OLD | NEW |