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 #include <stdint.h> | 10 #include <stdint.h> |
(...skipping 999 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1010 WebCursor web_cursor = cursor; | 1010 WebCursor web_cursor = cursor; |
1011 [cocoa_view_ updateCursor:web_cursor.GetNativeCursor()]; | 1011 [cocoa_view_ updateCursor:web_cursor.GetNativeCursor()]; |
1012 } | 1012 } |
1013 | 1013 |
1014 void RenderWidgetHostViewMac::SetIsLoading(bool is_loading) { | 1014 void RenderWidgetHostViewMac::SetIsLoading(bool is_loading) { |
1015 is_loading_ = is_loading; | 1015 is_loading_ = is_loading; |
1016 // If we ever decide to show the waiting cursor while the page is loading | 1016 // If we ever decide to show the waiting cursor while the page is loading |
1017 // like Chrome does on Windows, call |UpdateCursor()| here. | 1017 // like Chrome does on Windows, call |UpdateCursor()| here. |
1018 } | 1018 } |
1019 | 1019 |
1020 void RenderWidgetHostViewMac::TextInputStateChanged( | 1020 void RenderWidgetHostViewMac::UpdateInputMethodIfNecessary( |
1021 const ViewHostMsg_TextInputState_Params& params) { | 1021 bool text_input_state_changed) { |
1022 if (text_input_type_ != params.type | 1022 if (!text_input_state_changed) |
1023 || can_compose_inline_ != params.can_compose_inline) { | 1023 return; |
1024 text_input_type_ = params.type; | |
1025 can_compose_inline_ = params.can_compose_inline; | |
1026 if (HasFocus()) { | |
1027 SetTextInputActive(true); | |
1028 | 1024 |
1029 // Let AppKit cache the new input context to make IMEs happy. | 1025 if (HasFocus()) { |
1030 // See http://crbug.com/73039. | 1026 SetTextInputActive(true); |
1031 [NSApp updateWindows]; | 1027 |
| 1028 // Let AppKit cache the new input context to make IMEs happy. |
| 1029 // See http://crbug.com/73039. |
| 1030 [NSApp updateWindows]; |
1032 | 1031 |
1033 #ifndef __LP64__ | 1032 #ifndef __LP64__ |
1034 UseInputWindow(TSMGetActiveDocument(), !can_compose_inline_); | 1033 UseInputWindow(TSMGetActiveDocument(), !render_widget_host_->delegate() |
| 1034 ->GetTextInputState() |
| 1035 .can_compose_inline); |
1035 #endif | 1036 #endif |
1036 } | |
1037 } | 1037 } |
1038 } | 1038 } |
1039 | 1039 |
1040 void RenderWidgetHostViewMac::ImeCancelComposition() { | 1040 void RenderWidgetHostViewMac::ImeCancelComposition() { |
1041 [cocoa_view_ cancelComposition]; | 1041 [cocoa_view_ cancelComposition]; |
1042 } | 1042 } |
1043 | 1043 |
1044 void RenderWidgetHostViewMac::ImeCompositionRangeChanged( | 1044 void RenderWidgetHostViewMac::ImeCompositionRangeChanged( |
1045 const gfx::Range& range, | 1045 const gfx::Range& range, |
1046 const std::vector<gfx::Rect>& character_bounds) { | 1046 const std::vector<gfx::Rect>& character_bounds) { |
(...skipping 2437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3484 | 3484 |
3485 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding | 3485 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding |
3486 // regions that are not draggable. (See ControlRegionView in | 3486 // regions that are not draggable. (See ControlRegionView in |
3487 // native_app_window_cocoa.mm). This requires the render host view to be | 3487 // native_app_window_cocoa.mm). This requires the render host view to be |
3488 // draggable by default. | 3488 // draggable by default. |
3489 - (BOOL)mouseDownCanMoveWindow { | 3489 - (BOOL)mouseDownCanMoveWindow { |
3490 return YES; | 3490 return YES; |
3491 } | 3491 } |
3492 | 3492 |
3493 @end | 3493 @end |
OLD | NEW |