| 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 1074 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1085 if (g_browser_process->have_inspector_files()) { | 1085 if (g_browser_process->have_inspector_files()) { |
| 1086 devtools_menu_contents_->AddItem(IDC_DEV_TOOLS, | 1086 devtools_menu_contents_->AddItem(IDC_DEV_TOOLS, |
| 1087 l10n_util::GetString(IDS_DEV_TOOLS)); | 1087 l10n_util::GetString(IDS_DEV_TOOLS)); |
| 1088 } | 1088 } |
| 1089 devtools_menu_contents_->AddItem(IDC_TASK_MANAGER, | 1089 devtools_menu_contents_->AddItem(IDC_TASK_MANAGER, |
| 1090 l10n_util::GetString(IDS_TASK_MANAGER)); | 1090 l10n_util::GetString(IDS_TASK_MANAGER)); |
| 1091 } | 1091 } |
| 1092 #endif | 1092 #endif |
| 1093 | 1093 |
| 1094 void ToolbarView::CreateAppMenu() { | 1094 void ToolbarView::CreateAppMenu() { |
| 1095 if (app_menu_contents_.get()) | 1095 // We always rebuild the app menu so that we can get the current state of |
| 1096 return; | 1096 // the sync system. |
| 1097 | 1097 |
| 1098 app_menu_contents_.reset(new views::SimpleMenuModel(this)); | 1098 app_menu_contents_.reset(new views::SimpleMenuModel(this)); |
| 1099 app_menu_contents_->AddItemWithStringId(IDC_NEW_TAB, IDS_NEW_TAB); | 1099 app_menu_contents_->AddItemWithStringId(IDC_NEW_TAB, IDS_NEW_TAB); |
| 1100 app_menu_contents_->AddItemWithStringId(IDC_NEW_WINDOW, IDS_NEW_WINDOW); | 1100 app_menu_contents_->AddItemWithStringId(IDC_NEW_WINDOW, IDS_NEW_WINDOW); |
| 1101 app_menu_contents_->AddItemWithStringId(IDC_NEW_INCOGNITO_WINDOW, | 1101 app_menu_contents_->AddItemWithStringId(IDC_NEW_INCOGNITO_WINDOW, |
| 1102 IDS_NEW_INCOGNITO_WINDOW); | 1102 IDS_NEW_INCOGNITO_WINDOW); |
| 1103 // Enumerate profiles asynchronously and then create the parent menu item. | 1103 // Enumerate profiles asynchronously and then create the parent menu item. |
| 1104 // We will create the child menu items for this once the asynchronous call is | 1104 // We will create the child menu items for this once the asynchronous call is |
| 1105 // done. See OnGetProfilesDone(). | 1105 // done. See OnGetProfilesDone(). |
| 1106 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 1106 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1156 app_menu_contents_->AddItem(IDC_ABOUT, | 1156 app_menu_contents_->AddItem(IDC_ABOUT, |
| 1157 l10n_util::GetStringFUTF16( | 1157 l10n_util::GetStringFUTF16( |
| 1158 IDS_ABOUT, | 1158 IDS_ABOUT, |
| 1159 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME))); | 1159 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME))); |
| 1160 app_menu_contents_->AddItemWithStringId(IDC_HELP_PAGE, IDS_HELP_PAGE); | 1160 app_menu_contents_->AddItemWithStringId(IDC_HELP_PAGE, IDS_HELP_PAGE); |
| 1161 app_menu_contents_->AddSeparator(); | 1161 app_menu_contents_->AddSeparator(); |
| 1162 app_menu_contents_->AddItemWithStringId(IDC_EXIT, IDS_EXIT); | 1162 app_menu_contents_->AddItemWithStringId(IDC_EXIT, IDS_EXIT); |
| 1163 | 1163 |
| 1164 app_menu_menu_.reset(new views::Menu2(app_menu_contents_.get())); | 1164 app_menu_menu_.reset(new views::Menu2(app_menu_contents_.get())); |
| 1165 } | 1165 } |
| OLD | NEW |