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 3105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3116 } | 3116 } |
3117 | 3117 |
3118 - (void)selectAll:(id)sender { | 3118 - (void)selectAll:(id)sender { |
3119 // editCommand_helper_ adds implementations for most NSResponder methods | 3119 // editCommand_helper_ adds implementations for most NSResponder methods |
3120 // dynamically. But the renderer side only sends selection results back to | 3120 // dynamically. But the renderer side only sends selection results back to |
3121 // the browser if they were triggered by a keyboard event or went through | 3121 // the browser if they were triggered by a keyboard event or went through |
3122 // one of the Select methods on RWH. Since selectAll: is called from the | 3122 // one of the Select methods on RWH. Since selectAll: is called from the |
3123 // menu handler, neither is true. | 3123 // menu handler, neither is true. |
3124 // Explicitly call SelectAll() here to make sure the renderer returns | 3124 // Explicitly call SelectAll() here to make sure the renderer returns |
3125 // selection results. | 3125 // selection results. |
3126 WebContents* web_contents = renderWidgetHostView_->GetWebContents(); | 3126 content::RenderWidgetHostDelegate* render_widget_host_delegate = |
3127 if (web_contents) | 3127 renderWidgetHostView_->render_widget_host_->delegate(); |
3128 web_contents->SelectAll(); | 3128 if (render_widget_host_delegate) |
| 3129 render_widget_host_delegate->SelectAll(); |
3129 } | 3130 } |
3130 | 3131 |
3131 - (void)startSpeaking:(id)sender { | 3132 - (void)startSpeaking:(id)sender { |
3132 GetRenderWidgetHostViewToUse(renderWidgetHostView_.get())->SpeakSelection(); | 3133 GetRenderWidgetHostViewToUse(renderWidgetHostView_.get())->SpeakSelection(); |
3133 } | 3134 } |
3134 | 3135 |
3135 - (void)stopSpeaking:(id)sender { | 3136 - (void)stopSpeaking:(id)sender { |
3136 GetRenderWidgetHostViewToUse(renderWidgetHostView_.get())->StopSpeaking(); | 3137 GetRenderWidgetHostViewToUse(renderWidgetHostView_.get())->StopSpeaking(); |
3137 } | 3138 } |
3138 | 3139 |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3302 | 3303 |
3303 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding | 3304 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding |
3304 // regions that are not draggable. (See ControlRegionView in | 3305 // regions that are not draggable. (See ControlRegionView in |
3305 // native_app_window_cocoa.mm). This requires the render host view to be | 3306 // native_app_window_cocoa.mm). This requires the render host view to be |
3306 // draggable by default. | 3307 // draggable by default. |
3307 - (BOOL)mouseDownCanMoveWindow { | 3308 - (BOOL)mouseDownCanMoveWindow { |
3308 return YES; | 3309 return YES; |
3309 } | 3310 } |
3310 | 3311 |
3311 @end | 3312 @end |
OLD | NEW |