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

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

Issue 2842383002: Fix a recent regression in Speech->Start Speaking on Mac (Closed)
Patch Set: Created 3 years, 7 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
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_mac.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <Carbon/Carbon.h> 7 #import <Carbon/Carbon.h>
8 #import <objc/runtime.h> 8 #import <objc/runtime.h>
9 #include <OpenGL/gl.h> 9 #include <OpenGL/gl.h>
10 #include <QuartzCore/QuartzCore.h> 10 #include <QuartzCore/QuartzCore.h>
(...skipping 1094 matching lines...) Expand 10 before | Expand all | Expand 10 after
1105 if (selection->selected_text().empty() && render_widget_host_) { 1105 if (selection->selected_text().empty() && render_widget_host_) {
1106 // TODO: This will not work with OOPIFs (https://crbug.com/659753). 1106 // TODO: This will not work with OOPIFs (https://crbug.com/659753).
1107 // If there's no selection, speak all text. Send an asynchronous IPC 1107 // If there's no selection, speak all text. Send an asynchronous IPC
1108 // request for fetching all the text for a webcontent. 1108 // request for fetching all the text for a webcontent.
1109 // ViewMsg_GetRenderedTextCompleted is sent back to IPC Message receiver. 1109 // ViewMsg_GetRenderedTextCompleted is sent back to IPC Message receiver.
1110 render_widget_host_->Send( 1110 render_widget_host_->Send(
1111 new ViewMsg_GetRenderedText(render_widget_host_->GetRoutingID())); 1111 new ViewMsg_GetRenderedText(render_widget_host_->GetRoutingID()));
1112 return; 1112 return;
1113 } 1113 }
1114 1114
1115 SpeakText(selected_text_); 1115 SpeakText(base::UTF16ToUTF8(selection->selected_text()));
1116 } 1116 }
1117 1117
1118 bool RenderWidgetHostViewMac::IsSpeaking() const { 1118 bool RenderWidgetHostViewMac::IsSpeaking() const {
1119 return [NSApp respondsToSelector:@selector(isSpeaking)] && [NSApp isSpeaking]; 1119 return [NSApp respondsToSelector:@selector(isSpeaking)] && [NSApp isSpeaking];
1120 } 1120 }
1121 1121
1122 void RenderWidgetHostViewMac::StopSpeaking() { 1122 void RenderWidgetHostViewMac::StopSpeaking() {
1123 if ([NSApp respondsToSelector:@selector(stopSpeaking:)]) 1123 if ([NSApp respondsToSelector:@selector(stopSpeaking:)])
1124 [NSApp stopSpeaking:cocoa_view_]; 1124 [NSApp stopSpeaking:cocoa_view_];
1125 } 1125 }
(...skipping 2391 matching lines...) Expand 10 before | Expand all | Expand 10 after
3517 3517
3518 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding 3518 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding
3519 // regions that are not draggable. (See ControlRegionView in 3519 // regions that are not draggable. (See ControlRegionView in
3520 // native_app_window_cocoa.mm). This requires the render host view to be 3520 // native_app_window_cocoa.mm). This requires the render host view to be
3521 // draggable by default. 3521 // draggable by default.
3522 - (BOOL)mouseDownCanMoveWindow { 3522 - (BOOL)mouseDownCanMoveWindow {
3523 return YES; 3523 return YES;
3524 } 3524 }
3525 3525
3526 @end 3526 @end
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_mac.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698