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 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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( | 319 bool TranslateBubbleView::GetAcceleratorForCommandId( |
320 int command_id, | 320 int command_id, |
321 ui::Accelerator* accelerator) { | 321 ui::Accelerator* accelerator) const { |
322 return false; | 322 return false; |
323 } | 323 } |
324 | 324 |
325 void TranslateBubbleView::ExecuteCommand(int command_id, int event_flags) { | 325 void TranslateBubbleView::ExecuteCommand(int command_id, int event_flags) { |
326 model_->DeclineTranslation(); | 326 model_->DeclineTranslation(); |
327 switch (command_id) { | 327 switch (command_id) { |
328 case DenialMenuItem::NEVER_TRANSLATE_LANGUAGE: | 328 case DenialMenuItem::NEVER_TRANSLATE_LANGUAGE: |
329 model_->SetNeverTranslateLanguage(true); | 329 model_->SetNeverTranslateLanguage(true); |
330 translate::ReportUiAction( | 330 translate::ReportUiAction( |
331 translate::NEVER_TRANSLATE_LANGUAGE_MENU_CLICKED); | 331 translate::NEVER_TRANSLATE_LANGUAGE_MENU_CLICKED); |
(...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
964 base::string16 label; | 964 base::string16 label; |
965 if (model_->IsPageTranslatedInCurrentLanguages()) | 965 if (model_->IsPageTranslatedInCurrentLanguages()) |
966 label = l10n_util::GetStringUTF16(IDS_DONE); | 966 label = l10n_util::GetStringUTF16(IDS_DONE); |
967 else | 967 else |
968 label = l10n_util::GetStringUTF16(IDS_TRANSLATE_BUBBLE_ACCEPT); | 968 label = l10n_util::GetStringUTF16(IDS_TRANSLATE_BUBBLE_ACCEPT); |
969 advanced_done_button_->SetText(label); | 969 advanced_done_button_->SetText(label); |
970 advanced_done_button_->SizeToPreferredSize(); | 970 advanced_done_button_->SizeToPreferredSize(); |
971 if (advanced_view_) | 971 if (advanced_view_) |
972 advanced_view_->Layout(); | 972 advanced_view_->Layout(); |
973 } | 973 } |
OLD | NEW |