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

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

Issue 22891016: Add support for rect-based event targeting in views (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tests added Created 7 years, 1 month 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
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 "chrome/browser/ui/views/autofill/autofill_dialog_views.h" 5 #include "chrome/browser/ui/views/autofill/autofill_dialog_views.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 1000 matching lines...) Expand 10 before | Expand all | Expand 10 after
1011 } 1011 }
1012 1012
1013 void AutofillDialogViews::SectionContainer::OnMouseReleased( 1013 void AutofillDialogViews::SectionContainer::OnMouseReleased(
1014 const ui::MouseEvent& event) { 1014 const ui::MouseEvent& event) {
1015 if (!ShouldForwardEvent(event)) 1015 if (!ShouldForwardEvent(event))
1016 return; 1016 return;
1017 1017
1018 proxy_button_->OnMouseReleased(ProxyEvent(event)); 1018 proxy_button_->OnMouseReleased(ProxyEvent(event));
1019 } 1019 }
1020 1020
1021 views::View* AutofillDialogViews::SectionContainer::GetEventHandlerForPoint( 1021 views::View* AutofillDialogViews::SectionContainer::GetEventHandlerForRect(
1022 const gfx::Point& point) { 1022 const gfx::Rect& rect) {
1023 views::View* handler = views::View::GetEventHandlerForPoint(point); 1023 // TODO(tdanderson): Modify this function to support rect-based event
1024 // targeting.
1025
1026 views::View* handler = views::View::GetEventHandlerForRect(rect);
1024 // If the event is not in the label bar and there's no background to be 1027 // If the event is not in the label bar and there's no background to be
1025 // cleared, let normal event handling take place. 1028 // cleared, let normal event handling take place.
1026 if (!background() && 1029 if (!background() &&
1027 point.y() > child_at(0)->bounds().bottom()) { 1030 rect.CenterPoint().y() > child_at(0)->bounds().bottom()) {
1028 return handler; 1031 return handler;
1029 } 1032 }
1030 1033
1031 // Special case for (CVC) inputs in the suggestion view. 1034 // Special case for (CVC) inputs in the suggestion view.
1032 if (forward_mouse_events_ && 1035 if (forward_mouse_events_ &&
1033 handler->GetAncestorWithClassName(DecoratedTextfield::kViewClassName)) { 1036 handler->GetAncestorWithClassName(DecoratedTextfield::kViewClassName)) {
1034 return handler; 1037 return handler;
1035 } 1038 }
1036 1039
1037 // Special case for the proxy button itself. 1040 // Special case for the proxy button itself.
(...skipping 1541 matching lines...) Expand 10 before | Expand all | Expand 10 after
2579 AutofillDialogViews::DetailsGroup::DetailsGroup(DialogSection section) 2582 AutofillDialogViews::DetailsGroup::DetailsGroup(DialogSection section)
2580 : section(section), 2583 : section(section),
2581 container(NULL), 2584 container(NULL),
2582 manual_input(NULL), 2585 manual_input(NULL),
2583 suggested_info(NULL), 2586 suggested_info(NULL),
2584 suggested_button(NULL) {} 2587 suggested_button(NULL) {}
2585 2588
2586 AutofillDialogViews::DetailsGroup::~DetailsGroup() {} 2589 AutofillDialogViews::DetailsGroup::~DetailsGroup() {}
2587 2590
2588 } // namespace autofill 2591 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698