OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/views/toolbar_view.h" | 5 #include "chrome/browser/views/toolbar_view.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "app/drag_drop_types.h" | 9 #include "app/drag_drop_types.h" |
10 #include "app/gfx/canvas.h" | 10 #include "app/gfx/canvas.h" |
(...skipping 1155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1166 app_menu_contents_->AddItemWithStringId(IDC_SHOW_BOOKMARK_MANAGER, | 1166 app_menu_contents_->AddItemWithStringId(IDC_SHOW_BOOKMARK_MANAGER, |
1167 IDS_BOOKMARK_MANAGER); | 1167 IDS_BOOKMARK_MANAGER); |
1168 app_menu_contents_->AddItemWithStringId(IDC_SHOW_DOWNLOADS, | 1168 app_menu_contents_->AddItemWithStringId(IDC_SHOW_DOWNLOADS, |
1169 IDS_SHOW_DOWNLOADS); | 1169 IDS_SHOW_DOWNLOADS); |
1170 | 1170 |
1171 // Create the manage extensions menu item. | 1171 // Create the manage extensions menu item. |
1172 app_menu_contents_->AddItemWithStringId(IDC_MANAGE_EXTENSIONS, | 1172 app_menu_contents_->AddItemWithStringId(IDC_MANAGE_EXTENSIONS, |
1173 IDS_SHOW_EXTENSIONS); | 1173 IDS_SHOW_EXTENSIONS); |
1174 | 1174 |
1175 app_menu_contents_->AddSeparator(); | 1175 app_menu_contents_->AddSeparator(); |
1176 #if defined(BROWSER_SYNC) | |
1177 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableSync)) { | 1176 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableSync)) { |
1178 string16 label; | 1177 string16 label; |
1179 string16 link; | 1178 string16 link; |
1180 // TODO(timsteele): Need a ui helper method to just get the type without | 1179 // TODO(timsteele): Need a ui helper method to just get the type without |
1181 // needing labels. | 1180 // needing labels. |
1182 SyncStatusUIHelper::MessageType type = SyncStatusUIHelper::GetLabels( | 1181 SyncStatusUIHelper::MessageType type = SyncStatusUIHelper::GetLabels( |
1183 browser_->profile()->GetProfileSyncService(), &label, &link); | 1182 browser_->profile()->GetProfileSyncService(), &label, &link); |
1184 label = type == SyncStatusUIHelper::SYNCED ? | 1183 label = type == SyncStatusUIHelper::SYNCED ? |
1185 l10n_util::GetStringUTF16(IDS_SYNC_MENU_BOOKMARKS_SYNCED_LABEL) : | 1184 l10n_util::GetStringUTF16(IDS_SYNC_MENU_BOOKMARKS_SYNCED_LABEL) : |
1186 type == SyncStatusUIHelper::SYNC_ERROR ? | 1185 type == SyncStatusUIHelper::SYNC_ERROR ? |
1187 l10n_util::GetStringUTF16(IDS_SYNC_MENU_BOOKMARK_SYNC_ERROR_LABEL) : | 1186 l10n_util::GetStringUTF16(IDS_SYNC_MENU_BOOKMARK_SYNC_ERROR_LABEL) : |
1188 l10n_util::GetStringUTF16(IDS_SYNC_START_SYNC_BUTTON_LABEL); | 1187 l10n_util::GetStringUTF16(IDS_SYNC_START_SYNC_BUTTON_LABEL); |
1189 app_menu_contents_->AddItem(IDC_SYNC_BOOKMARKS, label); | 1188 app_menu_contents_->AddItem(IDC_SYNC_BOOKMARKS, label); |
1190 app_menu_contents_->AddSeparator(); | 1189 app_menu_contents_->AddSeparator(); |
1191 } | 1190 } |
1192 #endif | |
1193 app_menu_contents_->AddItem(IDC_OPTIONS, | 1191 app_menu_contents_->AddItem(IDC_OPTIONS, |
1194 l10n_util::GetStringFUTF16( | 1192 l10n_util::GetStringFUTF16( |
1195 IDS_OPTIONS, | 1193 IDS_OPTIONS, |
1196 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME))); | 1194 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME))); |
1197 app_menu_contents_->AddItem(IDC_ABOUT, | 1195 app_menu_contents_->AddItem(IDC_ABOUT, |
1198 l10n_util::GetStringFUTF16( | 1196 l10n_util::GetStringFUTF16( |
1199 IDS_ABOUT, | 1197 IDS_ABOUT, |
1200 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME))); | 1198 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME))); |
1201 app_menu_contents_->AddItemWithStringId(IDC_HELP_PAGE, IDS_HELP_PAGE); | 1199 app_menu_contents_->AddItemWithStringId(IDC_HELP_PAGE, IDS_HELP_PAGE); |
1202 app_menu_contents_->AddSeparator(); | 1200 app_menu_contents_->AddSeparator(); |
1203 app_menu_contents_->AddItemWithStringId(IDC_EXIT, IDS_EXIT); | 1201 app_menu_contents_->AddItemWithStringId(IDC_EXIT, IDS_EXIT); |
1204 | 1202 |
1205 app_menu_menu_.reset(new views::Menu2(app_menu_contents_.get())); | 1203 app_menu_menu_.reset(new views::Menu2(app_menu_contents_.get())); |
1206 } | 1204 } |
OLD | NEW |