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

Side by Side Diff: chrome/browser/wrench_menu_model.cc

Issue 3166022: Properly convert the preferences label if it's not ASCII. (Closed)
Patch Set: Created 10 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/wrench_menu_model.h" 5 #include "chrome/browser/wrench_menu_model.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "app/l10n_util.h" 10 #include "app/l10n_util.h"
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 AddItemWithStringId(IDC_SHOW_DOWNLOADS, IDS_SHOW_DOWNLOADS); 317 AddItemWithStringId(IDC_SHOW_DOWNLOADS, IDS_SHOW_DOWNLOADS);
318 AddSeparator(); 318 AddSeparator();
319 319
320 #if defined(OS_MACOSX) 320 #if defined(OS_MACOSX)
321 AddItemWithStringId(IDC_OPTIONS, IDS_PREFERENCES_MAC); 321 AddItemWithStringId(IDC_OPTIONS, IDS_PREFERENCES_MAC);
322 #elif defined(OS_LINUX) 322 #elif defined(OS_LINUX)
323 GtkStockItem stock_item; 323 GtkStockItem stock_item;
324 if (gtk_stock_lookup(GTK_STOCK_PREFERENCES, &stock_item)) { 324 if (gtk_stock_lookup(GTK_STOCK_PREFERENCES, &stock_item)) {
325 const char16 kUnderscore[] = { '_', 0 }; 325 const char16 kUnderscore[] = { '_', 0 };
326 string16 preferences; 326 string16 preferences;
327 RemoveChars(ASCIIToUTF16(stock_item.label), kUnderscore, &preferences); 327 RemoveChars(UTF8ToUTF16(stock_item.label), kUnderscore, &preferences);
328 AddItem(IDC_OPTIONS, preferences); 328 AddItem(IDC_OPTIONS, preferences);
329 } 329 }
330 #else 330 #else
331 AddItemWithStringId(IDC_OPTIONS, IDS_OPTIONS); 331 AddItemWithStringId(IDC_OPTIONS, IDS_OPTIONS);
332 #endif 332 #endif
333 333
334 #if defined(OS_CHROMEOS) 334 #if defined(OS_CHROMEOS)
335 AddCheckItemWithStringId(IDC_TOGGLE_VERTICAL_TABS, 335 AddCheckItemWithStringId(IDC_TOGGLE_VERTICAL_TABS,
336 IDS_TAB_CXMENU_USE_VERTICAL_TABS); 336 IDS_TAB_CXMENU_USE_VERTICAL_TABS);
337 #endif 337 #endif
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 int command_id = GetCommandIdAt(index); 418 int command_id = GetCommandIdAt(index);
419 return command_id == IDC_SYNC_BOOKMARKS || 419 return command_id == IDC_SYNC_BOOKMARKS ||
420 command_id == IDC_ABOUT; 420 command_id == IDC_ABOUT;
421 } 421 }
422 422
423 bool WrenchMenuModel::IsCommandIdEnabled(int command_id) const { 423 bool WrenchMenuModel::IsCommandIdEnabled(int command_id) const {
424 if (delegate_) 424 if (delegate_)
425 return delegate_->IsCommandIdEnabled(command_id); 425 return delegate_->IsCommandIdEnabled(command_id);
426 return true; 426 return true;
427 } 427 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698