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

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

Issue 1878523002: Add the missing text input state tracking code to RenderWidgetHostViewMac. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 | « no previous file | 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 <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 997 matching lines...) Expand 10 before | Expand all | Expand 10 after
1008 is_loading_ = is_loading; 1008 is_loading_ = is_loading;
1009 // If we ever decide to show the waiting cursor while the page is loading 1009 // If we ever decide to show the waiting cursor while the page is loading
1010 // like Chrome does on Windows, call |UpdateCursor()| here. 1010 // like Chrome does on Windows, call |UpdateCursor()| here.
1011 } 1011 }
1012 1012
1013 void RenderWidgetHostViewMac::UpdateInputMethodIfNecessary( 1013 void RenderWidgetHostViewMac::UpdateInputMethodIfNecessary(
1014 bool text_input_state_changed) { 1014 bool text_input_state_changed) {
1015 if (!text_input_state_changed) 1015 if (!text_input_state_changed)
1016 return; 1016 return;
1017 1017
1018 // TODO(ekaramad): The state tracking is all in WebContentsImpl now. Remove
1019 // these local variables.
Charlie Reis 2016/04/11 20:13:34 s/local variables/members/ (Or do I misunderstand
EhsanK 2016/04/11 20:46:01 You are right. Members.
1020 const TextInputState* state =
1021 render_widget_host_->delegate()->GetTextInputState();
1022 text_input_type_ = state->type;
1023 can_compose_inline_ = state->can_compose_inline;
1024
1018 if (HasFocus()) { 1025 if (HasFocus()) {
1019 SetTextInputActive(true); 1026 SetTextInputActive(true);
1020 1027
1021 // Let AppKit cache the new input context to make IMEs happy. 1028 // Let AppKit cache the new input context to make IMEs happy.
1022 // See http://crbug.com/73039. 1029 // See http://crbug.com/73039.
1023 [NSApp updateWindows]; 1030 [NSApp updateWindows];
1024 1031
1025 #ifndef __LP64__ 1032 #ifndef __LP64__
1026 UseInputWindow(TSMGetActiveDocument(), !render_widget_host_->delegate() 1033 UseInputWindow(TSMGetActiveDocument(), !can_compose_inline_);
1027 ->GetTextInputState()
1028 ->can_compose_inline);
1029 #endif 1034 #endif
1030 } 1035 }
1031 } 1036 }
1032 1037
1033 void RenderWidgetHostViewMac::ImeCancelComposition() { 1038 void RenderWidgetHostViewMac::ImeCancelComposition() {
1034 [cocoa_view_ cancelComposition]; 1039 [cocoa_view_ cancelComposition];
1035 } 1040 }
1036 1041
1037 void RenderWidgetHostViewMac::ImeCompositionRangeChanged( 1042 void RenderWidgetHostViewMac::ImeCompositionRangeChanged(
1038 const gfx::Range& range, 1043 const gfx::Range& range,
(...skipping 2360 matching lines...) Expand 10 before | Expand all | Expand 10 after
3399 3404
3400 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding 3405 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding
3401 // regions that are not draggable. (See ControlRegionView in 3406 // regions that are not draggable. (See ControlRegionView in
3402 // native_app_window_cocoa.mm). This requires the render host view to be 3407 // native_app_window_cocoa.mm). This requires the render host view to be
3403 // draggable by default. 3408 // draggable by default.
3404 - (BOOL)mouseDownCanMoveWindow { 3409 - (BOOL)mouseDownCanMoveWindow {
3405 return YES; 3410 return YES;
3406 } 3411 }
3407 3412
3408 @end 3413 @end
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698