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

Unified Diff: chrome/browser/ui/views/translate/translate_bubble_view.cc

Issue 1632953002: Change the TranslateDeclined() to only count decline if the explicit_closed is set to true (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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: {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698