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

Side by Side Diff: components/translate/core/browser/options_menu_model.cc

Issue 2140963002: Added default implementations of GetAcceleratorForCommandId. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@acceleratorprovider-const
Patch Set: Rebase. 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "components/translate/core/browser/options_menu_model.h" 5 #include "components/translate/core/browser/options_menu_model.h"
6 6
7 #include "base/metrics/histogram.h" 7 #include "base/metrics/histogram.h"
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 #include "components/translate/core/browser/translate_driver.h" 9 #include "components/translate/core/browser/translate_driver.h"
10 #include "components/translate/core/browser/translate_infobar_delegate.h" 10 #include "components/translate/core/browser/translate_infobar_delegate.h"
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 case ALWAYS_TRANSLATE: 93 case ALWAYS_TRANSLATE:
94 return (translate_infobar_delegate_->IsTranslatableLanguageByPrefs() && 94 return (translate_infobar_delegate_->IsTranslatableLanguageByPrefs() &&
95 !translate_infobar_delegate_->IsSiteBlacklisted()); 95 !translate_infobar_delegate_->IsSiteBlacklisted());
96 96
97 default: 97 default:
98 break; 98 break;
99 } 99 }
100 return true; 100 return true;
101 } 101 }
102 102
103 bool OptionsMenuModel::GetAcceleratorForCommandId(
104 int command_id,
105 ui::Accelerator* accelerator) const {
106 return false;
107 }
108
109 void OptionsMenuModel::ExecuteCommand(int command_id, int event_flags) { 103 void OptionsMenuModel::ExecuteCommand(int command_id, int event_flags) {
110 switch (command_id) { 104 switch (command_id) {
111 case NEVER_TRANSLATE_LANGUAGE: 105 case NEVER_TRANSLATE_LANGUAGE:
112 translate_infobar_delegate_->ToggleTranslatableLanguageByPrefs(); 106 translate_infobar_delegate_->ToggleTranslatableLanguageByPrefs();
113 break; 107 break;
114 108
115 case NEVER_TRANSLATE_SITE: 109 case NEVER_TRANSLATE_SITE:
116 translate_infobar_delegate_->ToggleSiteBlacklist(); 110 translate_infobar_delegate_->ToggleSiteBlacklist();
117 break; 111 break;
118 112
(...skipping 13 matching lines...) Expand all
132 break; 126 break;
133 } 127 }
134 128
135 default: 129 default:
136 NOTREACHED() << "Invalid command id from menu."; 130 NOTREACHED() << "Invalid command id from menu.";
137 break; 131 break;
138 } 132 }
139 } 133 }
140 134
141 } // namespace translate 135 } // namespace translate
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698