Index: chrome/browser/ui/views/translate/translate_bubble_view.cc |
diff --git a/chrome/browser/ui/views/translate/translate_bubble_view.cc b/chrome/browser/ui/views/translate/translate_bubble_view.cc |
index a4f83eaf8396f5e4053481ee38e8f44ac050188a..294da029b739c47d58ac1b31df4ed0a2f08540fc 100644 |
--- a/chrome/browser/ui/views/translate/translate_bubble_view.cc |
+++ b/chrome/browser/ui/views/translate/translate_bubble_view.cc |
@@ -167,15 +167,6 @@ void TranslateBubbleView::ButtonPressed(views::Button* sender, |
} |
void TranslateBubbleView::WindowClosing() { |
groby-ooo-7-16
2016/01/26 01:07:22
This means we would lose all metrics that are due
ftang
2016/01/26 01:30:35
The function called "TranslationDeclined()" so no
|
- // The operations for |model_| are valid only when a WebContents is alive. |
- // TODO(hajimehoshi): TranslateBubbleViewModel(Impl) should not hold a |
- // WebContents as a member variable because the WebContents might be destroyed |
- // while the TranslateBubbleViewModel(Impl) is still alive. Instead, |
- // TranslateBubbleViewModel should take a reference of a WebContents at each |
- // method. (crbug/320497) |
- if (!translate_executed_ && web_contents()) |
- model_->TranslationDeclined(denial_button_clicked_); |
- |
// We have to reset |translate_bubble_view_| here, not in our destructor, |
// because we'll be destroyed asynchronously and the shown state will be |
// checked before then. |
@@ -381,6 +372,15 @@ void TranslateBubbleView::HandleComboboxPerformAction( |
break; |
} |
GetWidget()->Close(); |
+ // The operations for |model_| are valid only when a WebContents is alive. |
+ // TODO(hajimehoshi): TranslateBubbleViewModel(Impl) should not hold a |
+ // WebContents as a member variable because the WebContents might be |
+ // destroyed while the TranslateBubbleViewModel(Impl) is still alive. |
+ // Instead, |
+ // TranslateBubbleViewModel should take a reference of a WebContents at |
+ // each method. (crbug/320497) |
+ if (!translate_executed_ && web_contents()) |
+ model_->TranslationDeclined(denial_button_clicked_); |
break; |
} |
case COMBOBOX_ID_SOURCE_LANGUAGE: { |