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

Side by Side Diff: chrome/browser/ui/views/autofill/autofill_popup_base_view.cc

Issue 294043017: Thwart clickjacking in autofill popups by ignoring double clicks (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: way simpler Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/ui/views/autofill/autofill_popup_base_view_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/ui/views/autofill/autofill_popup_base_view.h" 5 #include "chrome/browser/ui/views/autofill/autofill_popup_base_view.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "chrome/browser/ui/autofill/popup_constants.h" 10 #include "chrome/browser/ui/autofill/popup_constants.h"
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 } 154 }
155 155
156 void AutofillPopupBaseView::OnMouseMoved(const ui::MouseEvent& event) { 156 void AutofillPopupBaseView::OnMouseMoved(const ui::MouseEvent& event) {
157 if (HitTestPoint(event.location())) 157 if (HitTestPoint(event.location()))
158 SetSelection(event.location()); 158 SetSelection(event.location());
159 else 159 else
160 ClearSelection(); 160 ClearSelection();
161 } 161 }
162 162
163 bool AutofillPopupBaseView::OnMousePressed(const ui::MouseEvent& event) { 163 bool AutofillPopupBaseView::OnMousePressed(const ui::MouseEvent& event) {
164 return true; 164 return event.GetClickCount() == 1;
Ilya Sherman 2014/05/30 23:07:15 Should there be a corresponding change for Mac?
Evan Stade 2014/06/02 18:30:26 yes
Ilya Sherman 2014/06/02 22:08:08 I meant: Should this CL include a corresponding ch
Evan Stade 2014/06/02 22:19:30 I could take a stab at the mac code, but I have no
165 } 165 }
166 166
167 void AutofillPopupBaseView::OnMouseReleased(const ui::MouseEvent& event) { 167 void AutofillPopupBaseView::OnMouseReleased(const ui::MouseEvent& event) {
168 // We only care about the left click. 168 // We only care about the left click.
169 if (event.IsOnlyLeftMouseButton() && HitTestPoint(event.location())) 169 if (event.IsOnlyLeftMouseButton() && HitTestPoint(event.location()))
170 AcceptSelection(event.location()); 170 AcceptSelection(event.location());
171 } 171 }
172 172
173 void AutofillPopupBaseView::OnGestureEvent(ui::GestureEvent* event) { 173 void AutofillPopupBaseView::OnGestureEvent(ui::GestureEvent* event) {
174 switch (event->type()) { 174 switch (event->type()) {
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 233
234 void AutofillPopupBaseView::HideController() { 234 void AutofillPopupBaseView::HideController() {
235 if (delegate_) 235 if (delegate_)
236 delegate_->Hide(); 236 delegate_->Hide();
237 } 237 }
238 238
239 gfx::NativeView AutofillPopupBaseView::container_view() { 239 gfx::NativeView AutofillPopupBaseView::container_view() {
240 return delegate_->container_view(); 240 return delegate_->container_view();
241 } 241 }
242 242
243
244 } // namespace autofill 243 } // namespace autofill
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/autofill/autofill_popup_base_view_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698