OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #import "chrome/browser/app_controller_mac.h" | 5 #import "chrome/browser/app_controller_mac.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 910 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
921 chrome::OpenHelpWindow(lastProfile, chrome::HELP_SOURCE_MENU); | 921 chrome::OpenHelpWindow(lastProfile, chrome::HELP_SOURCE_MENU); |
922 break; | 922 break; |
923 case IDC_SHOW_SYNC_SETUP: | 923 case IDC_SHOW_SYNC_SETUP: |
924 if (Browser* browser = ActivateBrowser(lastProfile)) | 924 if (Browser* browser = ActivateBrowser(lastProfile)) |
925 chrome::ShowBrowserSignin(browser, SyncPromoUI::SOURCE_MENU); | 925 chrome::ShowBrowserSignin(browser, SyncPromoUI::SOURCE_MENU); |
926 else | 926 else |
927 chrome::OpenSyncSetupWindow(lastProfile, SyncPromoUI::SOURCE_MENU); | 927 chrome::OpenSyncSetupWindow(lastProfile, SyncPromoUI::SOURCE_MENU); |
928 break; | 928 break; |
929 case IDC_TASK_MANAGER: | 929 case IDC_TASK_MANAGER: |
930 content::RecordAction(UserMetricsAction("TaskManager")); | 930 content::RecordAction(UserMetricsAction("TaskManager")); |
931 TaskManagerMac::Show(false); | 931 TaskManagerMac::Show(); |
932 break; | 932 break; |
933 case IDC_OPTIONS: | 933 case IDC_OPTIONS: |
934 [self showPreferences:sender]; | 934 [self showPreferences:sender]; |
935 break; | 935 break; |
936 } | 936 } |
937 } | 937 } |
938 | 938 |
939 // Run a (background) application in a new tab. | 939 // Run a (background) application in a new tab. |
940 - (void)executeApplication:(id)sender { | 940 - (void)executeApplication:(id)sender { |
941 NSInteger tag = [sender tag]; | 941 NSInteger tag = [sender tag]; |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1264 NSString* itemStr = | 1264 NSString* itemStr = |
1265 base::SysUTF16ToNSString(UTF8ToUTF16((*cursor)->name())); | 1265 base::SysUTF16ToNSString(UTF8ToUTF16((*cursor)->name())); |
1266 scoped_nsobject<NSMenuItem> appItem([[NSMenuItem alloc] | 1266 scoped_nsobject<NSMenuItem> appItem([[NSMenuItem alloc] |
1267 initWithTitle:itemStr | 1267 initWithTitle:itemStr |
1268 action:@selector(executeApplication:) | 1268 action:@selector(executeApplication:) |
1269 keyEquivalent:@""]); | 1269 keyEquivalent:@""]); |
1270 [appItem setTarget:self]; | 1270 [appItem setTarget:self]; |
1271 [appItem setTag:position]; | 1271 [appItem setTag:position]; |
1272 [appMenu addItem:appItem]; | 1272 [appMenu addItem:appItem]; |
1273 } | 1273 } |
1274 | |
1275 scoped_nsobject<NSMenuItem> appMenuItem([[NSMenuItem alloc] | |
1276 initWithTitle:menuStr | |
1277 action:@selector(executeApplication:) | |
1278 keyEquivalent:@""]); | |
1279 [appMenuItem setTarget:self]; | |
1280 [appMenuItem setTag:IDC_VIEW_BACKGROUND_PAGES]; | |
1281 [appMenuItem setSubmenu:appMenu]; | |
1282 [dockMenu addItem:appMenuItem]; | |
1283 } | 1274 } |
1284 } | 1275 } |
1285 | 1276 |
1286 return dockMenu; | 1277 return dockMenu; |
1287 } | 1278 } |
1288 | 1279 |
1289 - (const std::vector<GURL>&)startupUrls { | 1280 - (const std::vector<GURL>&)startupUrls { |
1290 return startupUrls_; | 1281 return startupUrls_; |
1291 } | 1282 } |
1292 | 1283 |
(...skipping 29 matching lines...) Expand all Loading... |
1322 | 1313 |
1323 //--------------------------------------------------------------------------- | 1314 //--------------------------------------------------------------------------- |
1324 | 1315 |
1325 namespace app_controller_mac { | 1316 namespace app_controller_mac { |
1326 | 1317 |
1327 bool IsOpeningNewWindow() { | 1318 bool IsOpeningNewWindow() { |
1328 return g_is_opening_new_window; | 1319 return g_is_opening_new_window; |
1329 } | 1320 } |
1330 | 1321 |
1331 } // namespace app_controller_mac | 1322 } // namespace app_controller_mac |
OLD | NEW |