Index: chrome/browser/ui/views/intent_picker_bubble_view.cc |
diff --git a/chrome/browser/ui/views/intent_picker_bubble_view.cc b/chrome/browser/ui/views/intent_picker_bubble_view.cc |
index 0be935dad8bf46596ba2651e2c661fa333bf26d3..f805497fdfcbe26a0f4d2c9f66b2797e7893ca6e 100644 |
--- a/chrome/browser/ui/views/intent_picker_bubble_view.cc |
+++ b/chrome/browser/ui/views/intent_picker_bubble_view.cc |
@@ -236,10 +236,10 @@ IntentPickerBubbleView::~IntentPickerBubbleView() { |
// the callback so the caller can Resume the navigation. |
void IntentPickerBubbleView::OnWidgetDestroying(views::Widget* widget) { |
if (!was_callback_run_) { |
+ was_callback_run_ = true; |
throttle_cb_.Run( |
kAppTagNoneSelected, |
arc::ArcNavigationThrottle::CloseReason::DIALOG_DEACTIVATED); |
- was_callback_run_ = true; |
} |
} |
@@ -251,16 +251,16 @@ void IntentPickerBubbleView::ButtonPressed(views::Button* sender, |
const ui::Event& event) { |
switch (sender->tag()) { |
case static_cast<int>(Option::ALWAYS): |
+ was_callback_run_ = true; |
throttle_cb_.Run(selected_app_tag_, |
arc::ArcNavigationThrottle::CloseReason::ALWAYS_PRESSED); |
- was_callback_run_ = true; |
GetWidget()->Close(); |
break; |
case static_cast<int>(Option::JUST_ONCE): |
+ was_callback_run_ = true; |
throttle_cb_.Run( |
selected_app_tag_, |
arc::ArcNavigationThrottle::CloseReason::JUST_ONCE_PRESSED); |
- was_callback_run_ = true; |
GetWidget()->Close(); |
break; |
default: |
@@ -297,9 +297,9 @@ gfx::Size IntentPickerBubbleView::GetPreferredSize() const { |
// should inform the caller about this error. |
void IntentPickerBubbleView::WebContentsDestroyed() { |
if (!was_callback_run_) { |
+ was_callback_run_ = true; |
throttle_cb_.Run(kAppTagNoneSelected, |
arc::ArcNavigationThrottle::CloseReason::ERROR); |
- was_callback_run_ = true; |
} |
GetWidget()->Close(); |
} |