| 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 760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 771 // http://code.google.com/p/chromium/issues/detail?id=43048 . | 771 // http://code.google.com/p/chromium/issues/detail?id=43048 . |
| 772 // | 772 // |
| 773 // TODO(akalin,viettrungluu): Figure out whether this method | 773 // TODO(akalin,viettrungluu): Figure out whether this method |
| 774 // can be prevented from being called if lastProfile is | 774 // can be prevented from being called if lastProfile is |
| 775 // NULL. | 775 // NULL. |
| 776 if (!lastProfile) { | 776 if (!lastProfile) { |
| 777 LOG(WARNING) | 777 LOG(WARNING) |
| 778 << "NULL lastProfile detected -- not doing anything"; | 778 << "NULL lastProfile detected -- not doing anything"; |
| 779 break; | 779 break; |
| 780 } | 780 } |
| 781 enable = lastProfile->IsSyncAccessible() && | 781 enable = ![self keyWindowIsModal]; |
| 782 ![self keyWindowIsModal]; | |
| 783 [BrowserWindowController updateSigninItem:item | 782 [BrowserWindowController updateSigninItem:item |
| 784 shouldShow:enable | 783 shouldShow:enable |
| 785 currentProfile:lastProfile]; | 784 currentProfile:lastProfile]; |
| 786 break; | 785 break; |
| 787 } | 786 } |
| 788 case IDC_FEEDBACK: | 787 case IDC_FEEDBACK: |
| 789 enable = NO; | 788 enable = NO; |
| 790 break; | 789 break; |
| 791 default: | 790 default: |
| 792 enable = menuState_->IsCommandEnabled(tag) ? | 791 enable = menuState_->IsCommandEnabled(tag) ? |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 911 chrome::OpenExtensionsWindow(lastProfile); | 910 chrome::OpenExtensionsWindow(lastProfile); |
| 912 break; | 911 break; |
| 913 case IDC_HELP_PAGE_VIA_MENU: | 912 case IDC_HELP_PAGE_VIA_MENU: |
| 914 if (Browser* browser = ActivateBrowser(lastProfile)) | 913 if (Browser* browser = ActivateBrowser(lastProfile)) |
| 915 chrome::ShowHelp(browser, chrome::HELP_SOURCE_MENU); | 914 chrome::ShowHelp(browser, chrome::HELP_SOURCE_MENU); |
| 916 else | 915 else |
| 917 chrome::OpenHelpWindow(lastProfile, chrome::HELP_SOURCE_MENU); | 916 chrome::OpenHelpWindow(lastProfile, chrome::HELP_SOURCE_MENU); |
| 918 break; | 917 break; |
| 919 case IDC_SHOW_SYNC_SETUP: | 918 case IDC_SHOW_SYNC_SETUP: |
| 920 if (Browser* browser = ActivateBrowser(lastProfile)) | 919 if (Browser* browser = ActivateBrowser(lastProfile)) |
| 921 chrome::ShowSyncSetup(browser, SyncPromoUI::SOURCE_MENU); | 920 chrome::ShowBrowserSignin(browser, SyncPromoUI::SOURCE_MENU); |
| 922 else | 921 else |
| 923 chrome::OpenSyncSetupWindow(lastProfile, SyncPromoUI::SOURCE_MENU); | 922 chrome::OpenSyncSetupWindow(lastProfile, SyncPromoUI::SOURCE_MENU); |
| 924 break; | 923 break; |
| 925 case IDC_TASK_MANAGER: | 924 case IDC_TASK_MANAGER: |
| 926 content::RecordAction(UserMetricsAction("TaskManager")); | 925 content::RecordAction(UserMetricsAction("TaskManager")); |
| 927 TaskManagerMac::Show(false); | 926 TaskManagerMac::Show(false); |
| 928 break; | 927 break; |
| 929 case IDC_OPTIONS: | 928 case IDC_OPTIONS: |
| 930 [self showPreferences:sender]; | 929 [self showPreferences:sender]; |
| 931 break; | 930 break; |
| (...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1350 | 1349 |
| 1351 //--------------------------------------------------------------------------- | 1350 //--------------------------------------------------------------------------- |
| 1352 | 1351 |
| 1353 namespace app_controller_mac { | 1352 namespace app_controller_mac { |
| 1354 | 1353 |
| 1355 bool IsOpeningNewWindow() { | 1354 bool IsOpeningNewWindow() { |
| 1356 return g_is_opening_new_window; | 1355 return g_is_opening_new_window; |
| 1357 } | 1356 } |
| 1358 | 1357 |
| 1359 } // namespace app_controller_mac | 1358 } // namespace app_controller_mac |
| OLD | NEW |