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/location.h" | 10 #include "base/location.h" |
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
530 DCHECK_EQ(menu_button_, source); | 530 DCHECK_EQ(menu_button_, source); |
531 | 531 |
532 ui::MenuModel* model = delegate_->MenuModelForAccountChooser(); | 532 ui::MenuModel* model = delegate_->MenuModelForAccountChooser(); |
533 if (!model) | 533 if (!model) |
534 return; | 534 return; |
535 | 535 |
536 menu_runner_.reset(new views::MenuRunner(model)); | 536 menu_runner_.reset(new views::MenuRunner(model)); |
537 if (menu_runner_->RunMenuAt(source->GetWidget(), | 537 if (menu_runner_->RunMenuAt(source->GetWidget(), |
538 NULL, | 538 NULL, |
539 source->GetBoundsInScreen(), | 539 source->GetBoundsInScreen(), |
540 views::MenuItemView::TOPRIGHT, | 540 views::MENU_ANCHOR_TOPRIGHT, |
541 ui::MENU_SOURCE_NONE, | 541 ui::MENU_SOURCE_NONE, |
542 0) == views::MenuRunner::MENU_DELETED) { | 542 0) == views::MenuRunner::MENU_DELETED) { |
543 return; | 543 return; |
544 } | 544 } |
545 } | 545 } |
546 | 546 |
547 views::View* AutofillDialogViews::GetLoadingShieldForTesting() { | 547 views::View* AutofillDialogViews::GetLoadingShieldForTesting() { |
548 return loading_shield_; | 548 return loading_shield_; |
549 } | 549 } |
550 | 550 |
(...skipping 1194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1745 | 1745 |
1746 group->container->SetActive(true); | 1746 group->container->SetActive(true); |
1747 views::Button::ButtonState state = group->suggested_button->state(); | 1747 views::Button::ButtonState state = group->suggested_button->state(); |
1748 group->suggested_button->SetState(views::Button::STATE_PRESSED); | 1748 group->suggested_button->SetState(views::Button::STATE_PRESSED); |
1749 | 1749 |
1750 gfx::Rect screen_bounds = source->GetBoundsInScreen(); | 1750 gfx::Rect screen_bounds = source->GetBoundsInScreen(); |
1751 screen_bounds.Inset(source->GetInsets()); | 1751 screen_bounds.Inset(source->GetInsets()); |
1752 if (menu_runner_->RunMenuAt(source->GetWidget(), | 1752 if (menu_runner_->RunMenuAt(source->GetWidget(), |
1753 NULL, | 1753 NULL, |
1754 screen_bounds, | 1754 screen_bounds, |
1755 views::MenuItemView::TOPRIGHT, | 1755 views::MENU_ANCHOR_TOPRIGHT, |
1756 ui::MENU_SOURCE_NONE, | 1756 ui::MENU_SOURCE_NONE, |
1757 0) == views::MenuRunner::MENU_DELETED) { | 1757 0) == views::MenuRunner::MENU_DELETED) { |
1758 return; | 1758 return; |
1759 } | 1759 } |
1760 | 1760 |
1761 group->container->SetActive(false); | 1761 group->container->SetActive(false); |
1762 group->suggested_button->SetState(state); | 1762 group->suggested_button->SetState(state); |
1763 } | 1763 } |
1764 | 1764 |
1765 gfx::Size AutofillDialogViews::CalculatePreferredSize(bool get_minimum_size) { | 1765 gfx::Size AutofillDialogViews::CalculatePreferredSize(bool get_minimum_size) { |
(...skipping 741 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2507 AutofillDialogViews::DetailsGroup::DetailsGroup(DialogSection section) | 2507 AutofillDialogViews::DetailsGroup::DetailsGroup(DialogSection section) |
2508 : section(section), | 2508 : section(section), |
2509 container(NULL), | 2509 container(NULL), |
2510 manual_input(NULL), | 2510 manual_input(NULL), |
2511 suggested_info(NULL), | 2511 suggested_info(NULL), |
2512 suggested_button(NULL) {} | 2512 suggested_button(NULL) {} |
2513 | 2513 |
2514 AutofillDialogViews::DetailsGroup::~DetailsGroup() {} | 2514 AutofillDialogViews::DetailsGroup::~DetailsGroup() {} |
2515 | 2515 |
2516 } // namespace autofill | 2516 } // namespace autofill |
OLD | NEW |