Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(35)

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_mac.mm

Issue 1162373002: Make some editing/selection functions accessible to c/b/renderer_host/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Used scoped_refptr Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 3024 matching lines...) Expand 10 before | Expand all | Expand 10 after
3075 web_contents->Undo(); 3076 web_contents->Undo();
3076 } 3077 }
3077 3078
3078 - (void)redo:(id)sender { 3079 - (void)redo:(id)sender {
3079 WebContents* web_contents = renderWidgetHostView_->GetWebContents(); 3080 WebContents* web_contents = renderWidgetHostView_->GetWebContents();
3080 if (web_contents) 3081 if (web_contents)
3081 web_contents->Redo(); 3082 web_contents->Redo();
3082 } 3083 }
3083 3084
3084 - (void)cut:(id)sender { 3085 - (void)cut:(id)sender {
3085 WebContents* web_contents = renderWidgetHostView_->GetWebContents(); 3086 content::RenderWidgetHostDelegate* render_widget_host_delegate =
3086 if (web_contents) 3087 renderWidgetHostView_->render_widget_host_->delegate();
3087 web_contents->Cut(); 3088 if (render_widget_host_delegate)
3089 render_widget_host_delegate->Cut();
3088 } 3090 }
3089 3091
3090 - (void)copy:(id)sender { 3092 - (void)copy:(id)sender {
3091 WebContents* web_contents = renderWidgetHostView_->GetWebContents(); 3093 content::RenderWidgetHostDelegate* render_widget_host_delegate =
3092 if (web_contents) 3094 renderWidgetHostView_->render_widget_host_->delegate();
3093 web_contents->Copy(); 3095 if (render_widget_host_delegate)
3096 render_widget_host_delegate->Copy();
3094 } 3097 }
3095 3098
3096 - (void)copyToFindPboard:(id)sender { 3099 - (void)copyToFindPboard:(id)sender {
3097 WebContents* web_contents = renderWidgetHostView_->GetWebContents(); 3100 WebContents* web_contents = renderWidgetHostView_->GetWebContents();
3098 if (web_contents) 3101 if (web_contents)
3099 web_contents->CopyToFindPboard(); 3102 web_contents->CopyToFindPboard();
3100 } 3103 }
3101 3104
3102 - (void)paste:(id)sender { 3105 - (void)paste:(id)sender {
3103 WebContents* web_contents = renderWidgetHostView_->GetWebContents(); 3106 content::RenderWidgetHostDelegate* render_widget_host_delegate =
3104 if (web_contents) 3107 renderWidgetHostView_->render_widget_host_->delegate();
3105 web_contents->Paste(); 3108 if (render_widget_host_delegate)
3109 render_widget_host_delegate->Paste();
3106 } 3110 }
3107 3111
3108 - (void)pasteAndMatchStyle:(id)sender { 3112 - (void)pasteAndMatchStyle:(id)sender {
3109 WebContents* web_contents = renderWidgetHostView_->GetWebContents(); 3113 WebContents* web_contents = renderWidgetHostView_->GetWebContents();
3110 if (web_contents) 3114 if (web_contents)
3111 web_contents->PasteAndMatchStyle(); 3115 web_contents->PasteAndMatchStyle();
3112 } 3116 }
3113 3117
3114 - (void)selectAll:(id)sender { 3118 - (void)selectAll:(id)sender {
3115 // editCommand_helper_ adds implementations for most NSResponder methods 3119 // editCommand_helper_ adds implementations for most NSResponder methods
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
3298 3302
3299 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding 3303 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding
3300 // regions that are not draggable. (See ControlRegionView in 3304 // regions that are not draggable. (See ControlRegionView in
3301 // native_app_window_cocoa.mm). This requires the render host view to be 3305 // native_app_window_cocoa.mm). This requires the render host view to be
3302 // draggable by default. 3306 // draggable by default.
3303 - (BOOL)mouseDownCanMoveWindow { 3307 - (BOOL)mouseDownCanMoveWindow {
3304 return YES; 3308 return YES;
3305 } 3309 }
3306 3310
3307 @end 3311 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698