| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |