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 <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 | 80 |
81 // static | 81 // static |
82 void TranslateBubbleView::ShowBubble( | 82 void TranslateBubbleView::ShowBubble( |
83 views::View* anchor_view, | 83 views::View* anchor_view, |
84 content::WebContents* web_contents, | 84 content::WebContents* web_contents, |
85 translate::TranslateStep step, | 85 translate::TranslateStep step, |
86 translate::TranslateErrors::Type error_type, | 86 translate::TranslateErrors::Type error_type, |
87 bool is_user_gesture) { | 87 bool is_user_gesture) { |
88 if (translate_bubble_view_) { | 88 if (translate_bubble_view_) { |
89 // When the user reads the advanced setting panel, the bubble should not be | 89 // When the user reads the advanced setting panel, the bubble should not be |
90 // changed because he/she is focusing on the bubble. | 90 // changed because they are focusing on the bubble. |
91 if (translate_bubble_view_->web_contents() == web_contents && | 91 if (translate_bubble_view_->web_contents() == web_contents && |
92 translate_bubble_view_->model()->GetViewState() == | 92 translate_bubble_view_->model()->GetViewState() == |
93 TranslateBubbleModel::VIEW_STATE_ADVANCED) { | 93 TranslateBubbleModel::VIEW_STATE_ADVANCED) { |
94 return; | 94 return; |
95 } | 95 } |
96 if (step != translate::TRANSLATE_STEP_TRANSLATE_ERROR) { | 96 if (step != translate::TRANSLATE_STEP_TRANSLATE_ERROR) { |
97 TranslateBubbleModel::ViewState state = | 97 TranslateBubbleModel::ViewState state = |
98 TranslateBubbleModelImpl::TranslateStepToViewState(step); | 98 TranslateBubbleModelImpl::TranslateStepToViewState(step); |
99 translate_bubble_view_->SwitchView(state); | 99 translate_bubble_view_->SwitchView(state); |
100 } else { | 100 } else { |
(...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
759 base::string16 label; | 759 base::string16 label; |
760 if (model_->IsPageTranslatedInCurrentLanguages()) | 760 if (model_->IsPageTranslatedInCurrentLanguages()) |
761 label = l10n_util::GetStringUTF16(IDS_DONE); | 761 label = l10n_util::GetStringUTF16(IDS_DONE); |
762 else | 762 else |
763 label = l10n_util::GetStringUTF16(IDS_TRANSLATE_BUBBLE_ACCEPT); | 763 label = l10n_util::GetStringUTF16(IDS_TRANSLATE_BUBBLE_ACCEPT); |
764 advanced_done_button_->SetText(label); | 764 advanced_done_button_->SetText(label); |
765 advanced_done_button_->SizeToPreferredSize(); | 765 advanced_done_button_->SizeToPreferredSize(); |
766 if (advanced_view_) | 766 if (advanced_view_) |
767 advanced_view_->Layout(); | 767 advanced_view_->Layout(); |
768 } | 768 } |
OLD | NEW |