OLD | NEW |
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/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
867 DCHECK(group); | 867 DCHECK(group); |
868 | 868 |
869 if (!group->suggested_button->visible()) | 869 if (!group->suggested_button->visible()) |
870 return; | 870 return; |
871 | 871 |
872 menu_runner_.reset(new views::MenuRunner( | 872 menu_runner_.reset(new views::MenuRunner( |
873 controller_->MenuModelForSection(group->section))); | 873 controller_->MenuModelForSection(group->section))); |
874 | 874 |
875 group->container->SetActive(true); | 875 group->container->SetActive(true); |
876 // Ignore the result since we don't need to handle a deleted menu specially. | 876 // Ignore the result since we don't need to handle a deleted menu specially. |
| 877 gfx::Rect bounds = group->suggested_button->GetBoundsInScreen(); |
| 878 bounds.Inset(group->suggested_button->GetInsets()); |
877 ignore_result( | 879 ignore_result( |
878 menu_runner_->RunMenuAt(sender->GetWidget(), | 880 menu_runner_->RunMenuAt(sender->GetWidget(), |
879 NULL, | 881 NULL, |
880 group->suggested_button->GetBoundsInScreen(), | 882 bounds, |
881 views::MenuItemView::TOPRIGHT, | 883 views::MenuItemView::TOPRIGHT, |
882 0)); | 884 0)); |
883 group->container->SetActive(false); | 885 group->container->SetActive(false); |
884 } | 886 } |
885 } | 887 } |
886 | 888 |
887 void AutofillDialogViews::ContentsChanged(views::Textfield* sender, | 889 void AutofillDialogViews::ContentsChanged(views::Textfield* sender, |
888 const string16& new_contents) { | 890 const string16& new_contents) { |
889 TextfieldEditedOrActivated(sender, true); | 891 TextfieldEditedOrActivated(sender, true); |
890 } | 892 } |
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1390 AutofillDialogViews::DetailsGroup::DetailsGroup(DialogSection section) | 1392 AutofillDialogViews::DetailsGroup::DetailsGroup(DialogSection section) |
1391 : section(section), | 1393 : section(section), |
1392 container(NULL), | 1394 container(NULL), |
1393 manual_input(NULL), | 1395 manual_input(NULL), |
1394 suggested_info(NULL), | 1396 suggested_info(NULL), |
1395 suggested_button(NULL) {} | 1397 suggested_button(NULL) {} |
1396 | 1398 |
1397 AutofillDialogViews::DetailsGroup::~DetailsGroup() {} | 1399 AutofillDialogViews::DetailsGroup::~DetailsGroup() {} |
1398 | 1400 |
1399 } // namespace autofill | 1401 } // namespace autofill |
OLD | NEW |