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

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

Issue 2235283003: Track composition range and character bounds on the browser side (Mac) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased to fix some crashing tests Created 4 years, 4 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 #include <stdint.h> 10 #include <stdint.h>
(...skipping 881 matching lines...) Expand 10 before | Expand all | Expand 10 after
892 #endif 892 #endif
893 } 893 }
894 } 894 }
895 895
896 void RenderWidgetHostViewMac::OnImeCancelComposition( 896 void RenderWidgetHostViewMac::OnImeCancelComposition(
897 TextInputManager* text_input_manager, 897 TextInputManager* text_input_manager,
898 RenderWidgetHostViewBase* updated_view) { 898 RenderWidgetHostViewBase* updated_view) {
899 [cocoa_view_ cancelComposition]; 899 [cocoa_view_ cancelComposition];
900 } 900 }
901 901
902 void RenderWidgetHostViewMac::ImeCompositionRangeChanged( 902 void RenderWidgetHostViewMac::OnImeCompositionRangeChanged(
903 const gfx::Range& range, 903 TextInputManager* text_input_manager,
904 const std::vector<gfx::Rect>& character_bounds) { 904 RenderWidgetHostViewBase* updated_view) {
905 const TextInputManager::CompositionRangeInfo* info =
906 GetTextInputManager()->GetCompositionRangeInfo();
905 // The RangeChanged message is only sent with valid values. The current 907 // The RangeChanged message is only sent with valid values. The current
906 // caret position (start == end) will be sent if there is no IME range. 908 // caret position (start == end) will be sent if there is no IME range.
907 [cocoa_view_ setMarkedRange:range.ToNSRange()]; 909 [cocoa_view_ setMarkedRange:info->range.ToNSRange()];
908 composition_range_ = range; 910 composition_range_ = info->range;
909 composition_bounds_ = character_bounds; 911 composition_bounds_ = info->character_bounds;
910 } 912 }
911 913
912 void RenderWidgetHostViewMac::RenderProcessGone(base::TerminationStatus status, 914 void RenderWidgetHostViewMac::RenderProcessGone(base::TerminationStatus status,
913 int error_code) { 915 int error_code) {
914 Destroy(); 916 Destroy();
915 } 917 }
916 918
917 void RenderWidgetHostViewMac::Destroy() { 919 void RenderWidgetHostViewMac::Destroy() {
918 // SurfaceClientIds registered with RenderWidgetHostInputEventRouter 920 // SurfaceClientIds registered with RenderWidgetHostInputEventRouter
919 // have already been cleared when RenderWidgetHostViewBase notified its 921 // have already been cleared when RenderWidgetHostViewBase notified its
(...skipping 2324 matching lines...) Expand 10 before | Expand all | Expand 10 after
3244 3246
3245 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding 3247 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding
3246 // regions that are not draggable. (See ControlRegionView in 3248 // regions that are not draggable. (See ControlRegionView in
3247 // native_app_window_cocoa.mm). This requires the render host view to be 3249 // native_app_window_cocoa.mm). This requires the render host view to be
3248 // draggable by default. 3250 // draggable by default.
3249 - (BOOL)mouseDownCanMoveWindow { 3251 - (BOOL)mouseDownCanMoveWindow {
3250 return YES; 3252 return YES;
3251 } 3253 }
3252 3254
3253 @end 3255 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698