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

Unified Diff: chrome/browser/ui/views/intent_picker_bubble_view.cc

Issue 2347273002: Closing unused new tabs for ARC (Closed)
Patch Set: Created 4 years, 3 months 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 side-by-side diff with in-line comments
Download patch
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();
}

Powered by Google App Engine
This is Rietveld 408576698