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_win.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_win.h" |
6 | 6 |
7 #include <InputScope.h> | 7 #include <InputScope.h> |
8 #include <wtsapi32.h> | 8 #include <wtsapi32.h> |
9 #pragma comment(lib, "wtsapi32.lib") | 9 #pragma comment(lib, "wtsapi32.lib") |
10 | 10 |
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 is_hidden_(false), | 398 is_hidden_(false), |
399 about_to_validate_and_paint_(false), | 399 about_to_validate_and_paint_(false), |
400 close_on_deactivate_(false), | 400 close_on_deactivate_(false), |
401 being_destroyed_(false), | 401 being_destroyed_(false), |
402 tooltip_hwnd_(NULL), | 402 tooltip_hwnd_(NULL), |
403 tooltip_showing_(false), | 403 tooltip_showing_(false), |
404 weak_factory_(this), | 404 weak_factory_(this), |
405 is_loading_(false), | 405 is_loading_(false), |
406 text_input_type_(ui::TEXT_INPUT_TYPE_NONE), | 406 text_input_type_(ui::TEXT_INPUT_TYPE_NONE), |
407 can_compose_inline_(true), | 407 can_compose_inline_(true), |
| 408 text_input_mode_(ui::TEXT_INPUT_MODE_DEFAULT), |
408 is_fullscreen_(false), | 409 is_fullscreen_(false), |
409 ignore_mouse_movement_(true), | 410 ignore_mouse_movement_(true), |
410 composition_range_(ui::Range::InvalidRange()), | 411 composition_range_(ui::Range::InvalidRange()), |
411 touch_state_(new WebTouchState(this)), | 412 touch_state_(new WebTouchState(this)), |
412 pointer_down_context_(false), | 413 pointer_down_context_(false), |
413 last_touch_location_(-1, -1), | 414 last_touch_location_(-1, -1), |
414 touch_events_enabled_(ui::AreTouchEventsEnabled()), | 415 touch_events_enabled_(ui::AreTouchEventsEnabled()), |
415 gesture_recognizer_(ui::GestureRecognizer::Create(this)) { | 416 gesture_recognizer_(ui::GestureRecognizer::Create(this)) { |
416 render_widget_host_->SetView(this); | 417 render_widget_host_->SetView(this); |
417 registrar_.Add(this, | 418 registrar_.Add(this, |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
685 void RenderWidgetHostViewWin::SetIsLoading(bool is_loading) { | 686 void RenderWidgetHostViewWin::SetIsLoading(bool is_loading) { |
686 is_loading_ = is_loading; | 687 is_loading_ = is_loading; |
687 UpdateCursorIfOverSelf(); | 688 UpdateCursorIfOverSelf(); |
688 } | 689 } |
689 | 690 |
690 void RenderWidgetHostViewWin::TextInputTypeChanged( | 691 void RenderWidgetHostViewWin::TextInputTypeChanged( |
691 ui::TextInputType type, | 692 ui::TextInputType type, |
692 bool can_compose_inline, | 693 bool can_compose_inline, |
693 ui::TextInputMode input_mode) { | 694 ui::TextInputMode input_mode) { |
694 if (text_input_type_ != type || | 695 if (text_input_type_ != type || |
695 can_compose_inline_ != can_compose_inline) { | 696 can_compose_inline_ != can_compose_inline || |
696 const bool text_input_type_changed = (text_input_type_ != type); | 697 text_input_mode_ != input_mode) { |
| 698 const bool text_input_type_changed = (text_input_type_ != type) || |
| 699 (text_input_mode_ != input_mode); |
697 text_input_type_ = type; | 700 text_input_type_ = type; |
698 can_compose_inline_ = can_compose_inline; | 701 can_compose_inline_ = can_compose_inline; |
| 702 text_input_mode_ = input_mode; |
699 UpdateIMEState(); | 703 UpdateIMEState(); |
700 if (text_input_type_changed) | 704 if (text_input_type_changed) |
701 UpdateInputScopeIfNecessary(text_input_type_); | 705 UpdateInputScopeIfNecessary(text_input_type_); |
702 } | 706 } |
703 } | 707 } |
704 | 708 |
705 void RenderWidgetHostViewWin::SelectionBoundsChanged( | 709 void RenderWidgetHostViewWin::SelectionBoundsChanged( |
706 const ViewHostMsg_SelectionBounds_Params& params) { | 710 const ViewHostMsg_SelectionBounds_Params& params) { |
707 bool is_enabled = (text_input_type_ != ui::TEXT_INPUT_TYPE_NONE && | 711 bool is_enabled = (text_input_type_ != ui::TEXT_INPUT_TYPE_NONE && |
708 text_input_type_ != ui::TEXT_INPUT_TYPE_PASSWORD); | 712 text_input_type_ != ui::TEXT_INPUT_TYPE_PASSWORD); |
(...skipping 2439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3148 ui::TSFBridge::GetInstance()->OnTextInputTypeChanged(this); | 3152 ui::TSFBridge::GetInstance()->OnTextInputTypeChanged(this); |
3149 return; | 3153 return; |
3150 } | 3154 } |
3151 if (text_input_type_ != ui::TEXT_INPUT_TYPE_NONE && | 3155 if (text_input_type_ != ui::TEXT_INPUT_TYPE_NONE && |
3152 text_input_type_ != ui::TEXT_INPUT_TYPE_PASSWORD) { | 3156 text_input_type_ != ui::TEXT_INPUT_TYPE_PASSWORD) { |
3153 imm32_manager_->EnableIME(m_hWnd); | 3157 imm32_manager_->EnableIME(m_hWnd); |
3154 imm32_manager_->SetUseCompositionWindow(!can_compose_inline_); | 3158 imm32_manager_->SetUseCompositionWindow(!can_compose_inline_); |
3155 } else { | 3159 } else { |
3156 imm32_manager_->DisableIME(m_hWnd); | 3160 imm32_manager_->DisableIME(m_hWnd); |
3157 } | 3161 } |
| 3162 |
| 3163 imm32_manager_->SetTextInputMode(m_hWnd, text_input_mode_); |
3158 } | 3164 } |
3159 | 3165 |
3160 void RenderWidgetHostViewWin::UpdateInputScopeIfNecessary( | 3166 void RenderWidgetHostViewWin::UpdateInputScopeIfNecessary( |
3161 ui::TextInputType text_input_type) { | 3167 ui::TextInputType text_input_type) { |
3162 // The text store is responsible for handling input scope when TSF-aware is | 3168 // The text store is responsible for handling input scope when TSF-aware is |
3163 // required. | 3169 // required. |
3164 if (base::win::IsTSFAwareRequired()) | 3170 if (base::win::IsTSFAwareRequired()) |
3165 return; | 3171 return; |
3166 | 3172 |
3167 ui::tsf_inputscope::SetInputScopeForTsfUnawareWindow( | 3173 ui::tsf_inputscope::SetInputScopeForTsfUnawareWindow( |
3168 m_hWnd, text_input_type, ui::TEXT_INPUT_MODE_DEFAULT); | 3174 m_hWnd, text_input_type, ui::TEXT_INPUT_MODE_DEFAULT); |
3169 } | 3175 } |
3170 | 3176 |
3171 //////////////////////////////////////////////////////////////////////////////// | 3177 //////////////////////////////////////////////////////////////////////////////// |
3172 // RenderWidgetHostView, public: | 3178 // RenderWidgetHostView, public: |
3173 | 3179 |
3174 // static | 3180 // static |
3175 RenderWidgetHostView* RenderWidgetHostView::CreateViewForWidget( | 3181 RenderWidgetHostView* RenderWidgetHostView::CreateViewForWidget( |
3176 RenderWidgetHost* widget) { | 3182 RenderWidgetHost* widget) { |
3177 return new RenderWidgetHostViewWin(widget); | 3183 return new RenderWidgetHostViewWin(widget); |
3178 } | 3184 } |
3179 | 3185 |
3180 // static | 3186 // static |
3181 void RenderWidgetHostViewPort::GetDefaultScreenInfo( | 3187 void RenderWidgetHostViewPort::GetDefaultScreenInfo( |
3182 WebKit::WebScreenInfo* results) { | 3188 WebKit::WebScreenInfo* results) { |
3183 GetScreenInfoForWindow(0, results); | 3189 GetScreenInfoForWindow(0, results); |
3184 } | 3190 } |
3185 | 3191 |
3186 } // namespace content | 3192 } // namespace content |
OLD | NEW |