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

Side by Side Diff: chrome/browser/ui/views/translate/translate_bubble_view.cc

Issue 2133013002: AcceleratorProvider: Make GetAcceleratorForCommandId const. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix overrides on Mac and Chrome OS. Created 4 years, 5 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 unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/translate/translate_bubble_view.h ('k') | chrome/browser/ui/website_settings/permission_menu_model.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698