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

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

Issue 25373009: Translate: New Bubble UX (for the view toolkit) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Bug fix: view id on tests Created 7 years, 2 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 | « chrome/browser/ui/views/translate/translate_bubble_view.h ('k') | chrome/chrome_browser.gypi » ('j') | 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 f24b9360031a742de7f1409cae430098802b1d34..10bcd2b4ebc207a0d0ba40c2462d724a06ca70f0 100644
--- a/chrome/browser/ui/views/translate/translate_bubble_view.cc
+++ b/chrome/browser/ui/views/translate/translate_bubble_view.cc
@@ -160,6 +160,11 @@ bool TranslateBubbleView::IsShowing() {
return translate_bubble_view_ != NULL;
}
+// static
+TranslateBubbleView* TranslateBubbleView::GetCurrentBubble() {
+ return translate_bubble_view_;
+}
+
void TranslateBubbleView::Init() {
SetLayoutManager(new views::BoxLayout(views::BoxLayout::kVertical,
0, 0, 0));
@@ -187,8 +192,10 @@ void TranslateBubbleView::ButtonPressed(views::Button* sender,
}
void TranslateBubbleView::WindowClosing() {
- if (!translate_executed_)
+ if (!translate_executed_ &&
+ (browser_ == NULL || !browser_->IsAttemptingToCloseBrowser())) {
model_->TranslationDeclined();
+ }
// We have to reset |translate_bubble_view_| here, not in our destructor,
// because we'll be destroyed asynchronously and the shown state will be
« no previous file with comments | « chrome/browser/ui/views/translate/translate_bubble_view.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698