Chromium Code Reviews| 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/file_path.h" | 10 #include "base/file_path.h" |
| (...skipping 873 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 884 browser->ShowDownloadsTab(); | 884 browser->ShowDownloadsTab(); |
| 885 else | 885 else |
| 886 Browser::OpenDownloadsWindow(lastProfile); | 886 Browser::OpenDownloadsWindow(lastProfile); |
| 887 break; | 887 break; |
| 888 case IDC_MANAGE_EXTENSIONS: | 888 case IDC_MANAGE_EXTENSIONS: |
| 889 if (Browser* browser = ActivateBrowser(lastProfile)) | 889 if (Browser* browser = ActivateBrowser(lastProfile)) |
| 890 browser->ShowExtensionsTab(); | 890 browser->ShowExtensionsTab(); |
| 891 else | 891 else |
| 892 Browser::OpenExtensionsWindow(lastProfile); | 892 Browser::OpenExtensionsWindow(lastProfile); |
| 893 break; | 893 break; |
| 894 case IDC_HELP_PAGE: | 894 case IDC_HELP_PAGE_VIA_KEYBOARD: |
| 895 case IDC_HELP_PAGE_VIA_MENU: { | |
| 896 Browser::HelpSource source = (tag == IDC_HELP_PAGE_VIA_KEYBOARD) ? | |
| 897 Browser::HELP_SOURCE_KEYBOARD : | |
| 898 Browser::HELP_SOURCE_MENU; | |
| 895 if (Browser* browser = ActivateBrowser(lastProfile)) | 899 if (Browser* browser = ActivateBrowser(lastProfile)) |
| 896 browser->ShowHelpTab(); | 900 browser->ShowHelpTab(source); |
| 897 else | 901 else |
| 898 Browser::OpenHelpWindow(lastProfile); | 902 Browser::OpenHelpWindow(lastProfile, source); |
| 899 break; | 903 break; |
| 904 } | |
| 900 case IDC_SHOW_SYNC_SETUP: | 905 case IDC_SHOW_SYNC_SETUP: |
| 901 if (Browser* browser = ActivateBrowser(lastProfile)) | 906 if (Browser* browser = ActivateBrowser(lastProfile)) |
| 902 browser->ShowSyncSetup(SyncPromoUI::SOURCE_MENU); | 907 browser->ShowSyncSetup(SyncPromoUI::SOURCE_MENU); |
| 903 else | 908 else |
| 904 Browser::OpenSyncSetupWindow(lastProfile, SyncPromoUI::SOURCE_MENU); | 909 Browser::OpenSyncSetupWindow(lastProfile, SyncPromoUI::SOURCE_MENU); |
| 905 break; | 910 break; |
| 906 case IDC_TASK_MANAGER: | 911 case IDC_TASK_MANAGER: |
| 907 content::RecordAction(UserMetricsAction("TaskManager")); | 912 content::RecordAction(UserMetricsAction("TaskManager")); |
| 908 TaskManagerMac::Show(false); | 913 TaskManagerMac::Show(false); |
| 909 break; | 914 break; |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1017 menuState_->UpdateCommandEnabled(IDC_NEW_INCOGNITO_WINDOW, true); | 1022 menuState_->UpdateCommandEnabled(IDC_NEW_INCOGNITO_WINDOW, true); |
| 1018 menuState_->UpdateCommandEnabled(IDC_OPEN_FILE, true); | 1023 menuState_->UpdateCommandEnabled(IDC_OPEN_FILE, true); |
| 1019 menuState_->UpdateCommandEnabled(IDC_CLEAR_BROWSING_DATA, true); | 1024 menuState_->UpdateCommandEnabled(IDC_CLEAR_BROWSING_DATA, true); |
| 1020 menuState_->UpdateCommandEnabled(IDC_RESTORE_TAB, false); | 1025 menuState_->UpdateCommandEnabled(IDC_RESTORE_TAB, false); |
| 1021 menuState_->UpdateCommandEnabled(IDC_FOCUS_LOCATION, true); | 1026 menuState_->UpdateCommandEnabled(IDC_FOCUS_LOCATION, true); |
| 1022 menuState_->UpdateCommandEnabled(IDC_FOCUS_SEARCH, true); | 1027 menuState_->UpdateCommandEnabled(IDC_FOCUS_SEARCH, true); |
| 1023 menuState_->UpdateCommandEnabled(IDC_SHOW_BOOKMARK_MANAGER, true); | 1028 menuState_->UpdateCommandEnabled(IDC_SHOW_BOOKMARK_MANAGER, true); |
| 1024 menuState_->UpdateCommandEnabled(IDC_SHOW_HISTORY, true); | 1029 menuState_->UpdateCommandEnabled(IDC_SHOW_HISTORY, true); |
| 1025 menuState_->UpdateCommandEnabled(IDC_SHOW_DOWNLOADS, true); | 1030 menuState_->UpdateCommandEnabled(IDC_SHOW_DOWNLOADS, true); |
| 1026 menuState_->UpdateCommandEnabled(IDC_MANAGE_EXTENSIONS, true); | 1031 menuState_->UpdateCommandEnabled(IDC_MANAGE_EXTENSIONS, true); |
| 1027 menuState_->UpdateCommandEnabled(IDC_HELP_PAGE, true); | 1032 menuState_->UpdateCommandEnabled(IDC_HELP_PAGE_VIA_MENU, true); |
|
Daniel Erat
2012/06/08 21:07:11
Should I also be calling this for IDC_HELP_PAGE_VI
Avi (use Gerrit)
2012/06/11 20:54:06
There's no "help" keyboard shortcut on the Mac; I
Daniel Erat
2012/06/11 21:05:37
Thanks, that answers it. I've removed IDC_HELP_PA
| |
| 1028 menuState_->UpdateCommandEnabled(IDC_IMPORT_SETTINGS, true); | 1033 menuState_->UpdateCommandEnabled(IDC_IMPORT_SETTINGS, true); |
| 1029 menuState_->UpdateCommandEnabled(IDC_FEEDBACK, true); | 1034 menuState_->UpdateCommandEnabled(IDC_FEEDBACK, true); |
| 1030 menuState_->UpdateCommandEnabled(IDC_SHOW_SYNC_SETUP, true); | 1035 menuState_->UpdateCommandEnabled(IDC_SHOW_SYNC_SETUP, true); |
| 1031 menuState_->UpdateCommandEnabled(IDC_TASK_MANAGER, true); | 1036 menuState_->UpdateCommandEnabled(IDC_TASK_MANAGER, true); |
| 1032 } | 1037 } |
| 1033 | 1038 |
| 1034 // Conditionally adds the Profile menu to the main menu bar. | 1039 // Conditionally adds the Profile menu to the main menu bar. |
| 1035 - (void)initProfileMenu { | 1040 - (void)initProfileMenu { |
| 1036 NSMenu* mainMenu = [NSApp mainMenu]; | 1041 NSMenu* mainMenu = [NSApp mainMenu]; |
| 1037 NSMenuItem* profileMenu = [mainMenu itemWithTag:IDC_PROFILE_MAIN_MENU]; | 1042 NSMenuItem* profileMenu = [mainMenu itemWithTag:IDC_PROFILE_MAIN_MENU]; |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1318 | 1323 |
| 1319 } // namespace browser | 1324 } // namespace browser |
| 1320 | 1325 |
| 1321 namespace app_controller_mac { | 1326 namespace app_controller_mac { |
| 1322 | 1327 |
| 1323 bool IsOpeningNewWindow() { | 1328 bool IsOpeningNewWindow() { |
| 1324 return g_is_opening_new_window; | 1329 return g_is_opening_new_window; |
| 1325 } | 1330 } |
| 1326 | 1331 |
| 1327 } // namespace app_controller_mac | 1332 } // namespace app_controller_mac |
| OLD | NEW |