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 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 } | 309 } |
310 | 310 |
311 bool TranslateBubbleView::IsCommandIdChecked(int command_id) const { | 311 bool TranslateBubbleView::IsCommandIdChecked(int command_id) const { |
312 return false; | 312 return false; |
313 } | 313 } |
314 | 314 |
315 bool TranslateBubbleView::IsCommandIdEnabled(int command_id) const { | 315 bool TranslateBubbleView::IsCommandIdEnabled(int command_id) const { |
316 return true; | 316 return true; |
317 } | 317 } |
318 | 318 |
319 bool TranslateBubbleView::GetAcceleratorForCommandId( | |
320 int command_id, | |
321 ui::Accelerator* accelerator) const { | |
322 return false; | |
323 } | |
324 | |
325 void TranslateBubbleView::ExecuteCommand(int command_id, int event_flags) { | 319 void TranslateBubbleView::ExecuteCommand(int command_id, int event_flags) { |
326 model_->DeclineTranslation(); | 320 model_->DeclineTranslation(); |
327 switch (command_id) { | 321 switch (command_id) { |
328 case DenialMenuItem::NEVER_TRANSLATE_LANGUAGE: | 322 case DenialMenuItem::NEVER_TRANSLATE_LANGUAGE: |
329 model_->SetNeverTranslateLanguage(true); | 323 model_->SetNeverTranslateLanguage(true); |
330 translate::ReportUiAction( | 324 translate::ReportUiAction( |
331 translate::NEVER_TRANSLATE_LANGUAGE_MENU_CLICKED); | 325 translate::NEVER_TRANSLATE_LANGUAGE_MENU_CLICKED); |
332 break; | 326 break; |
333 case DenialMenuItem::NEVER_TRANSLATE_SITE: | 327 case DenialMenuItem::NEVER_TRANSLATE_SITE: |
334 model_->SetNeverTranslateSite(true); | 328 model_->SetNeverTranslateSite(true); |
(...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
964 base::string16 label; | 958 base::string16 label; |
965 if (model_->IsPageTranslatedInCurrentLanguages()) | 959 if (model_->IsPageTranslatedInCurrentLanguages()) |
966 label = l10n_util::GetStringUTF16(IDS_DONE); | 960 label = l10n_util::GetStringUTF16(IDS_DONE); |
967 else | 961 else |
968 label = l10n_util::GetStringUTF16(IDS_TRANSLATE_BUBBLE_ACCEPT); | 962 label = l10n_util::GetStringUTF16(IDS_TRANSLATE_BUBBLE_ACCEPT); |
969 advanced_done_button_->SetText(label); | 963 advanced_done_button_->SetText(label); |
970 advanced_done_button_->SizeToPreferredSize(); | 964 advanced_done_button_->SizeToPreferredSize(); |
971 if (advanced_view_) | 965 if (advanced_view_) |
972 advanced_view_->Layout(); | 966 advanced_view_->Layout(); |
973 } | 967 } |
OLD | NEW |