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

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

Issue 1388283002: Fix OSK flickering issue (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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
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/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 1872 matching lines...) Expand 10 before | Expand all | Expand 10 after
1883 #if defined(OS_ANDROID) 1883 #if defined(OS_ANDROID)
1884 UpdateTextInputState(NO_SHOW_IME, FROM_IME); 1884 UpdateTextInputState(NO_SHOW_IME, FROM_IME);
1885 #endif 1885 #endif
1886 } 1886 }
1887 1887
1888 void RenderWidget::UpdateTextInputState(ShowIme show_ime, 1888 void RenderWidget::UpdateTextInputState(ShowIme show_ime,
1889 ChangeSource change_source) { 1889 ChangeSource change_source) {
1890 TRACE_EVENT0("renderer", "RenderWidget::UpdateTextInputState"); 1890 TRACE_EVENT0("renderer", "RenderWidget::UpdateTextInputState");
1891 if (handling_ime_event_) 1891 if (handling_ime_event_)
1892 return; 1892 return;
1893 ui::TextInputType new_type = GetTextInputType(); 1893
1894 #if defined(OS_ANDROID)
aelias_OOO_until_Jul13 2015/10/15 19:58:40 I don't think we should make this kind of change b
Changwan Ryu 2015/10/16 02:10:16 Done.
1895 // We could be called in the middle of focus change, or in some other
1896 // intermediary state.
1897 base::ThreadTaskRunnerHandle::Get()->PostTask(
1898 FROM_HERE, base::Bind(&RenderWidget::UpdateTextInputStateInternal, this,
1899 show_ime, change_source));
1900 #else
1901 UpdateTextInputStateInternal(show_ime, change_source);
1902 #endif // defined(OS_ANDROID)
1903 }
1904
1905 void RenderWidget::UpdateTextInputStateInternal(ShowIme show_ime,
1906 ChangeSource change_source) {
1907 blink::WebTextInputInfo new_info;
1908 if (webwidget_)
1909 new_info = webwidget_->textInputInfo();
1910
1911 ui::TextInputType new_type = WebKitToUiTextInputType(new_info.type);
1894 if (IsDateTimeInput(new_type)) 1912 if (IsDateTimeInput(new_type))
1895 return; // Not considered as a text input field in WebKit/Chromium. 1913 return; // Not considered as a text input field in WebKit/Chromium.
1896 1914
1897 blink::WebTextInputInfo new_info;
1898 if (webwidget_)
1899 new_info = webwidget_->textInputInfo();
1900 const ui::TextInputMode new_mode = ConvertInputMode(new_info.inputMode); 1915 const ui::TextInputMode new_mode = ConvertInputMode(new_info.inputMode);
1901 1916
1902 bool new_can_compose_inline = CanComposeInline(); 1917 bool new_can_compose_inline = CanComposeInline();
1903 1918
1904 // Only sends text input params if they are changed or if the ime should be 1919 // Only sends text input params if they are changed or if the ime should be
1905 // shown. 1920 // shown.
1906 if (show_ime == SHOW_IME_IF_NEEDED || 1921 if (show_ime == SHOW_IME_IF_NEEDED ||
1907 (text_input_type_ != new_type || 1922 (text_input_type_ != new_type ||
1908 text_input_mode_ != new_mode || 1923 text_input_mode_ != new_mode ||
1909 text_input_info_ != new_info || 1924 text_input_info_ != new_info ||
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after
2385 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { 2400 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) {
2386 video_hole_frames_.AddObserver(frame); 2401 video_hole_frames_.AddObserver(frame);
2387 } 2402 }
2388 2403
2389 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { 2404 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) {
2390 video_hole_frames_.RemoveObserver(frame); 2405 video_hole_frames_.RemoveObserver(frame);
2391 } 2406 }
2392 #endif // defined(VIDEO_HOLE) 2407 #endif // defined(VIDEO_HOLE)
2393 2408
2394 } // namespace content 2409 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698