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/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
540 ui::MenuModel* model = controller_->MenuModelForAccountChooser(); | 540 ui::MenuModel* model = controller_->MenuModelForAccountChooser(); |
541 if (!model) | 541 if (!model) |
542 return; | 542 return; |
543 | 543 |
544 menu_runner_.reset(new views::MenuRunner(model)); | 544 menu_runner_.reset(new views::MenuRunner(model)); |
545 ignore_result( | 545 ignore_result( |
546 menu_runner_->RunMenuAt(GetWidget(), | 546 menu_runner_->RunMenuAt(GetWidget(), |
547 NULL, | 547 NULL, |
548 GetBoundsInScreen(), | 548 GetBoundsInScreen(), |
549 views::MenuItemView::TOPRIGHT, | 549 views::MenuItemView::TOPRIGHT, |
| 550 ui::MENU_SOURCE_MOUSE, |
550 0)); | 551 0)); |
551 } | 552 } |
552 | 553 |
553 void AutofillDialogViews::AccountChooser::LinkClicked(views::Link* source, | 554 void AutofillDialogViews::AccountChooser::LinkClicked(views::Link* source, |
554 int event_flags) { | 555 int event_flags) { |
555 controller_->SignInLinkClicked(); | 556 controller_->SignInLinkClicked(); |
556 } | 557 } |
557 | 558 |
558 // AutofillDialogViews::NotificationArea --------------------------------------- | 559 // AutofillDialogViews::NotificationArea --------------------------------------- |
559 | 560 |
(...skipping 733 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1293 views::Button::ButtonState state = group->suggested_button->state(); | 1294 views::Button::ButtonState state = group->suggested_button->state(); |
1294 group->suggested_button->SetState(views::Button::STATE_PRESSED); | 1295 group->suggested_button->SetState(views::Button::STATE_PRESSED); |
1295 // Ignore the result since we don't need to handle a deleted menu specially. | 1296 // Ignore the result since we don't need to handle a deleted menu specially. |
1296 gfx::Rect bounds = group->suggested_button->GetBoundsInScreen(); | 1297 gfx::Rect bounds = group->suggested_button->GetBoundsInScreen(); |
1297 bounds.Inset(group->suggested_button->GetInsets()); | 1298 bounds.Inset(group->suggested_button->GetInsets()); |
1298 ignore_result( | 1299 ignore_result( |
1299 menu_runner_->RunMenuAt(sender->GetWidget(), | 1300 menu_runner_->RunMenuAt(sender->GetWidget(), |
1300 NULL, | 1301 NULL, |
1301 bounds, | 1302 bounds, |
1302 views::MenuItemView::TOPRIGHT, | 1303 views::MenuItemView::TOPRIGHT, |
| 1304 ui::GetMenuSourceTypeForEvent(event), |
1303 0)); | 1305 0)); |
1304 group->container->SetActive(false); | 1306 group->container->SetActive(false); |
1305 group->suggested_button->SetState(state); | 1307 group->suggested_button->SetState(state); |
1306 } | 1308 } |
1307 | 1309 |
1308 void AutofillDialogViews::ContentsChanged(views::Textfield* sender, | 1310 void AutofillDialogViews::ContentsChanged(views::Textfield* sender, |
1309 const string16& new_contents) { | 1311 const string16& new_contents) { |
1310 TextfieldEditedOrActivated(sender, true); | 1312 TextfieldEditedOrActivated(sender, true); |
1311 } | 1313 } |
1312 | 1314 |
(...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1935 AutofillDialogViews::DetailsGroup::DetailsGroup(DialogSection section) | 1937 AutofillDialogViews::DetailsGroup::DetailsGroup(DialogSection section) |
1936 : section(section), | 1938 : section(section), |
1937 container(NULL), | 1939 container(NULL), |
1938 manual_input(NULL), | 1940 manual_input(NULL), |
1939 suggested_info(NULL), | 1941 suggested_info(NULL), |
1940 suggested_button(NULL) {} | 1942 suggested_button(NULL) {} |
1941 | 1943 |
1942 AutofillDialogViews::DetailsGroup::~DetailsGroup() {} | 1944 AutofillDialogViews::DetailsGroup::~DetailsGroup() {} |
1943 | 1945 |
1944 } // namespace autofill | 1946 } // namespace autofill |
OLD | NEW |