Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(782)

Side by Side Diff: content/renderer/render_widget.cc

Issue 299793002: Forcibly notify text input type changed when RenderWidgetHostViewAura gets focused. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/debug/trace_event_synthetic_delay.h" 10 #include "base/debug/trace_event_synthetic_delay.h"
(...skipping 1605 matching lines...) Expand 10 before | Expand all | Expand 10 after
1616 // TextInputTypeChanged IPC on Windows. 1616 // TextInputTypeChanged IPC on Windows.
1617 // TODO(yukawa, yoichio): Consider to stop checking |input_method_is_active_| 1617 // TODO(yukawa, yoichio): Consider to stop checking |input_method_is_active_|
1618 // on other platforms as well as Windows if the overhead is acceptable. 1618 // on other platforms as well as Windows if the overhead is acceptable.
1619 #if !defined(OS_WIN) 1619 #if !defined(OS_WIN)
1620 if (!input_method_is_active_) 1620 if (!input_method_is_active_)
1621 return; 1621 return;
1622 #endif 1622 #endif
1623 1623
1624 ui::TextInputType new_type = GetTextInputType(); 1624 ui::TextInputType new_type = GetTextInputType();
1625 if (IsDateTimeInput(new_type)) 1625 if (IsDateTimeInput(new_type))
1626 return; // Not considered as a text input field in WebKit/Chromium. 1626 return; // Not considered as a text input field in WebKit/Chromium.
Yuki 2014/05/24 12:11:33 http://google-styleguide.googlecode.com/svn/trunk/
Shu Chen 2014/05/24 13:42:59 Done.
1627 1627
1628 bool new_can_compose_inline = CanComposeInline(); 1628 bool new_can_compose_inline = CanComposeInline();
1629 1629
1630 blink::WebTextInputInfo new_info; 1630 blink::WebTextInputInfo new_info;
1631 if (webwidget_) 1631 if (webwidget_)
1632 new_info = webwidget_->textInputInfo(); 1632 new_info = webwidget_->textInputInfo();
1633 const ui::TextInputMode new_mode = ConvertInputMode(new_info.inputMode); 1633 const ui::TextInputMode new_mode = ConvertInputMode(new_info.inputMode);
1634 1634
1635 if (text_input_type_ != new_type 1635 if (text_input_type_ != new_type
1636 || can_compose_inline_ != new_can_compose_inline 1636 || can_compose_inline_ != new_can_compose_inline
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
1684 #if defined(USE_AURA) 1684 #if defined(USE_AURA)
1685 p.is_non_ime_change = true; 1685 p.is_non_ime_change = true;
1686 #endif 1686 #endif
1687 #if defined(OS_ANDROID) 1687 #if defined(OS_ANDROID)
1688 p.is_non_ime_change = (change_source == FROM_NON_IME) || 1688 p.is_non_ime_change = (change_source == FROM_NON_IME) ||
1689 text_field_is_dirty_; 1689 text_field_is_dirty_;
1690 if (p.is_non_ime_change) 1690 if (p.is_non_ime_change)
1691 IncrementOutstandingImeEventAcks(); 1691 IncrementOutstandingImeEventAcks();
1692 text_field_is_dirty_ = false; 1692 text_field_is_dirty_ = false;
1693 #endif 1693 #endif
1694 #if defined(USE_AURA)
1695 Send(new ViewHostMsg_TextInputTypeChanged(routing_id(),
1696 new_type,
1697 text_input_mode_,
1698 new_can_compose_inline));
1699 #endif
1694 Send(new ViewHostMsg_TextInputStateChanged(routing_id(), p)); 1700 Send(new ViewHostMsg_TextInputStateChanged(routing_id(), p));
1695 1701
1696 text_input_info_ = new_info; 1702 text_input_info_ = new_info;
1697 text_input_type_ = new_type; 1703 text_input_type_ = new_type;
1698 can_compose_inline_ = new_can_compose_inline; 1704 can_compose_inline_ = new_can_compose_inline;
1699 } 1705 }
1700 } 1706 }
1701 #endif 1707 #endif
1702 1708
1703 void RenderWidget::GetSelectionBounds(gfx::Rect* focus, gfx::Rect* anchor) { 1709 void RenderWidget::GetSelectionBounds(gfx::Rect* focus, gfx::Rect* anchor) {
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after
2074 2080
2075 void RenderWidget::RegisterSwappedOutChildFrame(RenderFrameImpl* frame) { 2081 void RenderWidget::RegisterSwappedOutChildFrame(RenderFrameImpl* frame) {
2076 swapped_out_frames_.AddObserver(frame); 2082 swapped_out_frames_.AddObserver(frame);
2077 } 2083 }
2078 2084
2079 void RenderWidget::UnregisterSwappedOutChildFrame(RenderFrameImpl* frame) { 2085 void RenderWidget::UnregisterSwappedOutChildFrame(RenderFrameImpl* frame) {
2080 swapped_out_frames_.RemoveObserver(frame); 2086 swapped_out_frames_.RemoveObserver(frame);
2081 } 2087 }
2082 2088
2083 } // namespace content 2089 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698