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

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

Issue 1026493002: Allow only a user gesture to trigger autofill popup (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Do not show autofill popup if desktop IME is composing. Created 5 years, 8 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 1661 matching lines...) Expand 10 before | Expand all | Expand 10 after
1672 void RenderWidget::OnCandidateWindowHidden() { 1672 void RenderWidget::OnCandidateWindowHidden() {
1673 webwidget_->didHideCandidateWindow(); 1673 webwidget_->didHideCandidateWindow();
1674 } 1674 }
1675 1675
1676 void RenderWidget::OnImeSetComposition( 1676 void RenderWidget::OnImeSetComposition(
1677 const base::string16& text, 1677 const base::string16& text,
1678 const std::vector<WebCompositionUnderline>& underlines, 1678 const std::vector<WebCompositionUnderline>& underlines,
1679 int selection_start, int selection_end) { 1679 int selection_start, int selection_end) {
1680 if (!ShouldHandleImeEvent()) 1680 if (!ShouldHandleImeEvent())
1681 return; 1681 return;
1682
1683 bool is_user_gesture = false;
1684 #if defined(OS_ANDROID)
1685 // Android keyboard goes into IME composition mode to suggest words as you
1686 // type. Mark IME composition as a user gesture on Android to enable such
1687 // features as autofill popup while in IME composition mode.
1688 is_user_gesture = true;
1689 #endif
1690
1691 ImeEventGuard guard(this); 1682 ImeEventGuard guard(this);
1692 if (!webwidget_->setUserGestureComposition( 1683 if (!webwidget_->setComposition(
Evan Stade 2015/04/16 13:58:59 why can't I find the old function anywhere?
please use gerrit instead 2015/04/16 16:08:35 That's a function that I was going to add, but dec
1693 text, WebVector<WebCompositionUnderline>(underlines), 1684 text, WebVector<WebCompositionUnderline>(underlines),
1694 selection_start, selection_end, is_user_gesture)) { 1685 selection_start, selection_end)) {
1695 // If we failed to set the composition text, then we need to let the browser 1686 // If we failed to set the composition text, then we need to let the browser
1696 // process to cancel the input method's ongoing composition session, to make 1687 // process to cancel the input method's ongoing composition session, to make
1697 // sure we are in a consistent state. 1688 // sure we are in a consistent state.
1698 Send(new InputHostMsg_ImeCancelComposition(routing_id())); 1689 Send(new InputHostMsg_ImeCancelComposition(routing_id()));
1699 } 1690 }
1700 UpdateCompositionInfo(true); 1691 UpdateCompositionInfo(true);
1701 } 1692 }
1702 1693
1703 void RenderWidget::OnImeConfirmComposition(const base::string16& text, 1694 void RenderWidget::OnImeConfirmComposition(const base::string16& text,
1704 const gfx::Range& replacement_range, 1695 const gfx::Range& replacement_range,
(...skipping 744 matching lines...) Expand 10 before | Expand all | Expand 10 after
2449 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { 2440 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) {
2450 video_hole_frames_.AddObserver(frame); 2441 video_hole_frames_.AddObserver(frame);
2451 } 2442 }
2452 2443
2453 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { 2444 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) {
2454 video_hole_frames_.RemoveObserver(frame); 2445 video_hole_frames_.RemoveObserver(frame);
2455 } 2446 }
2456 #endif // defined(VIDEO_HOLE) 2447 #endif // defined(VIDEO_HOLE)
2457 2448
2458 } // namespace content 2449 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698