| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/views/translate/translate_bubble_view.h" | 5 #include "chrome/browser/ui/views/translate/translate_bubble_view.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <algorithm> | 8 #include <algorithm> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 return advanced_view_; | 389 return advanced_view_; |
| 390 } | 390 } |
| 391 NOTREACHED(); | 391 NOTREACHED(); |
| 392 return NULL; | 392 return NULL; |
| 393 } | 393 } |
| 394 | 394 |
| 395 void TranslateBubbleView::HandleButtonPressed( | 395 void TranslateBubbleView::HandleButtonPressed( |
| 396 TranslateBubbleView::ButtonID sender_id) { | 396 TranslateBubbleView::ButtonID sender_id) { |
| 397 switch (sender_id) { | 397 switch (sender_id) { |
| 398 case BUTTON_ID_TRANSLATE: { | 398 case BUTTON_ID_TRANSLATE: { |
| 399 if (always_translate_checkbox_) |
| 400 model_->SetAlwaysTranslate(always_translate_checkbox_->checked()); |
| 399 model_->Translate(); | 401 model_->Translate(); |
| 400 ReportUiAction(translate::TRANSLATE_BUTTON_CLICKED); | 402 ReportUiAction(translate::TRANSLATE_BUTTON_CLICKED); |
| 401 break; | 403 break; |
| 402 } | 404 } |
| 403 case BUTTON_ID_DONE: { | 405 case BUTTON_ID_DONE: { |
| 404 if (always_translate_checkbox_) | 406 if (always_translate_checkbox_) |
| 405 model_->SetAlwaysTranslate(always_translate_checkbox_->checked()); | 407 model_->SetAlwaysTranslate(always_translate_checkbox_->checked()); |
| 406 if (model_->IsPageTranslatedInCurrentLanguages()) { | 408 if (model_->IsPageTranslatedInCurrentLanguages()) { |
| 407 model_->GoBackFromAdvanced(); | 409 model_->GoBackFromAdvanced(); |
| 408 UpdateChildVisibilities(); | 410 UpdateChildVisibilities(); |
| (...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 934 advanced_done_button_->SizeToPreferredSize(); | 936 advanced_done_button_->SizeToPreferredSize(); |
| 935 if (advanced_view_) | 937 if (advanced_view_) |
| 936 advanced_view_->Layout(); | 938 advanced_view_->Layout(); |
| 937 } | 939 } |
| 938 | 940 |
| 939 void TranslateBubbleView::ReportUiAction( | 941 void TranslateBubbleView::ReportUiAction( |
| 940 translate::TranslateBubbleUiEvent action) { | 942 translate::TranslateBubbleUiEvent action) { |
| 941 UMA_HISTOGRAM_ENUMERATION(kTranslateBubbleUIEvent, action, | 943 UMA_HISTOGRAM_ENUMERATION(kTranslateBubbleUIEvent, action, |
| 942 translate::TRANSLATE_BUBBLE_UI_EVENT_MAX); | 944 translate::TRANSLATE_BUBBLE_UI_EVENT_MAX); |
| 943 } | 945 } |
| OLD | NEW |