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/renderer/render_widget.h" | 5 #include "content/renderer/render_widget.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 1706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1717 } | 1717 } |
1718 | 1718 |
1719 void RenderWidget::set_next_paint_is_restore_ack() { | 1719 void RenderWidget::set_next_paint_is_restore_ack() { |
1720 next_paint_flags_ |= ViewHostMsg_UpdateRect_Flags::IS_RESTORE_ACK; | 1720 next_paint_flags_ |= ViewHostMsg_UpdateRect_Flags::IS_RESTORE_ACK; |
1721 } | 1721 } |
1722 | 1722 |
1723 void RenderWidget::set_next_paint_is_repaint_ack() { | 1723 void RenderWidget::set_next_paint_is_repaint_ack() { |
1724 next_paint_flags_ |= ViewHostMsg_UpdateRect_Flags::IS_REPAINT_ACK; | 1724 next_paint_flags_ |= ViewHostMsg_UpdateRect_Flags::IS_REPAINT_ACK; |
1725 } | 1725 } |
1726 | 1726 |
| 1727 static bool IsDateTimeInput(ui::TextInputType type) { |
| 1728 return type == ui::TEXT_INPUT_TYPE_DATE |
| 1729 || type == ui::TEXT_INPUT_TYPE_DATE_TIME |
| 1730 || type == ui::TEXT_INPUT_TYPE_DATE_TIME_LOCAL |
| 1731 || type == ui::TEXT_INPUT_TYPE_MONTH |
| 1732 || type == ui::TEXT_INPUT_TYPE_TIME |
| 1733 || type == ui::TEXT_INPUT_TYPE_WEEK; |
| 1734 } |
| 1735 |
| 1736 |
1727 void RenderWidget::UpdateTextInputState(ShowIme show_ime) { | 1737 void RenderWidget::UpdateTextInputState(ShowIme show_ime) { |
1728 bool show_ime_if_needed = (show_ime == SHOW_IME_IF_NEEDED); | 1738 bool show_ime_if_needed = (show_ime == SHOW_IME_IF_NEEDED); |
1729 if (!show_ime_if_needed && !input_method_is_active_) | 1739 if (!show_ime_if_needed && !input_method_is_active_) |
1730 return; | 1740 return; |
1731 ui::TextInputType new_type = GetTextInputType(); | 1741 ui::TextInputType new_type = GetTextInputType(); |
| 1742 if (IsDateTimeInput(new_type)) |
| 1743 return; // not considered as a text input field in WebKit |
| 1744 |
1732 WebKit::WebTextInputInfo new_info; | 1745 WebKit::WebTextInputInfo new_info; |
1733 if (webwidget_) | 1746 if (webwidget_) |
1734 new_info = webwidget_->textInputInfo(); | 1747 new_info = webwidget_->textInputInfo(); |
1735 | 1748 |
1736 bool new_can_compose_inline = CanComposeInline(); | 1749 bool new_can_compose_inline = CanComposeInline(); |
1737 | 1750 |
1738 // Only sends text input params if they are changed or if the ime should be | 1751 // Only sends text input params if they are changed or if the ime should be |
1739 // shown. | 1752 // shown. |
1740 if (show_ime_if_needed || (text_input_type_ != new_type | 1753 if (show_ime_if_needed || (text_input_type_ != new_type |
1741 || text_input_info_ != new_info | 1754 || text_input_info_ != new_info |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1975 | 1988 |
1976 bool RenderWidget::WebWidgetHandlesCompositorScheduling() const { | 1989 bool RenderWidget::WebWidgetHandlesCompositorScheduling() const { |
1977 return false; | 1990 return false; |
1978 } | 1991 } |
1979 | 1992 |
1980 bool RenderWidget::HasTouchEventHandlersAt(const gfx::Point& point) const { | 1993 bool RenderWidget::HasTouchEventHandlersAt(const gfx::Point& point) const { |
1981 return true; | 1994 return true; |
1982 } | 1995 } |
1983 | 1996 |
1984 } // namespace content | 1997 } // namespace content |
OLD | NEW |