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