OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/renderer_host/render_widget_host_view_win.h" | 5 #include "chrome/browser/renderer_host/render_widget_host_view_win.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 is_hidden_(false), | 230 is_hidden_(false), |
231 about_to_validate_and_paint_(false), | 231 about_to_validate_and_paint_(false), |
232 close_on_deactivate_(false), | 232 close_on_deactivate_(false), |
233 being_destroyed_(false), | 233 being_destroyed_(false), |
234 tooltip_hwnd_(NULL), | 234 tooltip_hwnd_(NULL), |
235 tooltip_showing_(false), | 235 tooltip_showing_(false), |
236 shutdown_factory_(this), | 236 shutdown_factory_(this), |
237 parent_hwnd_(NULL), | 237 parent_hwnd_(NULL), |
238 is_loading_(false), | 238 is_loading_(false), |
239 overlay_color_(0), | 239 overlay_color_(0), |
240 text_input_type_(WebKit::WebTextInputTypeNone) { | 240 text_input_type_(ui::TEXT_INPUT_TYPE_NONE) { |
241 render_widget_host_->set_view(this); | 241 render_widget_host_->set_view(this); |
242 registrar_.Add(this, | 242 registrar_.Add(this, |
243 NotificationType::RENDERER_PROCESS_TERMINATED, | 243 NotificationType::RENDERER_PROCESS_TERMINATED, |
244 NotificationService::AllSources()); | 244 NotificationService::AllSources()); |
245 } | 245 } |
246 | 246 |
247 RenderWidgetHostViewWin::~RenderWidgetHostViewWin() { | 247 RenderWidgetHostViewWin::~RenderWidgetHostViewWin() { |
248 ResetTooltip(); | 248 ResetTooltip(); |
249 } | 249 } |
250 | 250 |
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
580 SetCursor(display_cursor); | 580 SetCursor(display_cursor); |
581 } | 581 } |
582 } | 582 } |
583 | 583 |
584 void RenderWidgetHostViewWin::SetIsLoading(bool is_loading) { | 584 void RenderWidgetHostViewWin::SetIsLoading(bool is_loading) { |
585 is_loading_ = is_loading; | 585 is_loading_ = is_loading; |
586 UpdateCursorIfOverSelf(); | 586 UpdateCursorIfOverSelf(); |
587 } | 587 } |
588 | 588 |
589 void RenderWidgetHostViewWin::ImeUpdateTextInputState( | 589 void RenderWidgetHostViewWin::ImeUpdateTextInputState( |
590 WebKit::WebTextInputType type, | 590 ui::TextInputType type, |
| 591 bool can_compose_inline, |
591 const gfx::Rect& caret_rect) { | 592 const gfx::Rect& caret_rect) { |
| 593 // TODO(kinaba): currently, can_compose_inline is ignored and always treated |
| 594 // as true. We need to support "can_compose_inline=false" for PPAPI plugins |
| 595 // that may want to avoid drawing composition-text by themselves and pass |
| 596 // the responsibility to the browser. |
592 if (text_input_type_ != type) { | 597 if (text_input_type_ != type) { |
593 text_input_type_ = type; | 598 text_input_type_ = type; |
594 if (type == WebKit::WebTextInputTypeText) | 599 if (type == ui::TEXT_INPUT_TYPE_TEXT) |
595 ime_input_.EnableIME(m_hWnd); | 600 ime_input_.EnableIME(m_hWnd); |
596 else | 601 else |
597 ime_input_.DisableIME(m_hWnd); | 602 ime_input_.DisableIME(m_hWnd); |
598 } | 603 } |
599 | 604 |
600 // Only update caret position if the input method is enabled. | 605 // Only update caret position if the input method is enabled. |
601 if (type == WebKit::WebTextInputTypeText) | 606 if (type == ui::TEXT_INPUT_TYPE_TEXT) |
602 ime_input_.UpdateCaretRect(m_hWnd, caret_rect); | 607 ime_input_.UpdateCaretRect(m_hWnd, caret_rect); |
603 } | 608 } |
604 | 609 |
605 void RenderWidgetHostViewWin::ImeCancelComposition() { | 610 void RenderWidgetHostViewWin::ImeCancelComposition() { |
606 ime_input_.CancelIME(m_hWnd); | 611 ime_input_.CancelIME(m_hWnd); |
607 } | 612 } |
608 | 613 |
609 BOOL CALLBACK EnumChildProc(HWND hwnd, LPARAM lparam) { | 614 BOOL CALLBACK EnumChildProc(HWND hwnd, LPARAM lparam) { |
610 if (!webkit::npapi::WebPluginDelegateImpl::IsPluginDelegateWindow(hwnd)) | 615 if (!webkit::npapi::WebPluginDelegateImpl::IsPluginDelegateWindow(hwnd)) |
611 return TRUE; | 616 return TRUE; |
(...skipping 1191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1803 } | 1808 } |
1804 | 1809 |
1805 // static | 1810 // static |
1806 RenderWidgetHostView* | 1811 RenderWidgetHostView* |
1807 RenderWidgetHostView::GetRenderWidgetHostViewFromNativeView( | 1812 RenderWidgetHostView::GetRenderWidgetHostViewFromNativeView( |
1808 gfx::NativeView native_view) { | 1813 gfx::NativeView native_view) { |
1809 return ::IsWindow(native_view) ? | 1814 return ::IsWindow(native_view) ? |
1810 reinterpret_cast<RenderWidgetHostView*>( | 1815 reinterpret_cast<RenderWidgetHostView*>( |
1811 ViewProp::GetValue(native_view, kRenderWidgetHostViewKey)) : NULL; | 1816 ViewProp::GetValue(native_view, kRenderWidgetHostViewKey)) : NULL; |
1812 } | 1817 } |
OLD | NEW |