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 809 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
820 return; | 820 return; |
821 } | 821 } |
822 } | 822 } |
823 | 823 |
824 NSInteger tag = [sender tag]; | 824 NSInteger tag = [sender tag]; |
825 switch (tag) { | 825 switch (tag) { |
826 case IDC_NEW_TAB: | 826 case IDC_NEW_TAB: |
827 // Create a new tab in an existing browser window (which we activate) if | 827 // Create a new tab in an existing browser window (which we activate) if |
828 // possible. | 828 // possible. |
829 if (Browser* browser = ActivateBrowser(lastProfile)) { | 829 if (Browser* browser = ActivateBrowser(lastProfile)) { |
830 browser->ExecuteCommand(IDC_NEW_TAB); | 830 chrome::ExecuteCommand(browser, IDC_NEW_TAB); |
831 break; | 831 break; |
832 } | 832 } |
833 // Else fall through to create new window. | 833 // Else fall through to create new window. |
834 case IDC_NEW_WINDOW: | 834 case IDC_NEW_WINDOW: |
835 CreateBrowser(lastProfile); | 835 CreateBrowser(lastProfile); |
836 break; | 836 break; |
837 case IDC_FOCUS_LOCATION: | 837 case IDC_FOCUS_LOCATION: |
838 ActivateOrCreateBrowser(lastProfile)->ExecuteCommand(IDC_FOCUS_LOCATION); | 838 chrome::ExecuteCommand(ActivateOrCreateBrowser(lastProfile), |
| 839 IDC_FOCUS_LOCATION); |
839 break; | 840 break; |
840 case IDC_FOCUS_SEARCH: | 841 case IDC_FOCUS_SEARCH: |
841 ActivateOrCreateBrowser(lastProfile)->ExecuteCommand(IDC_FOCUS_SEARCH); | 842 chrome::ExecuteCommand(ActivateOrCreateBrowser(lastProfile), |
| 843 IDC_FOCUS_SEARCH); |
842 break; | 844 break; |
843 case IDC_NEW_INCOGNITO_WINDOW: | 845 case IDC_NEW_INCOGNITO_WINDOW: |
844 CreateBrowser(lastProfile->GetOffTheRecordProfile()); | 846 CreateBrowser(lastProfile->GetOffTheRecordProfile()); |
845 break; | 847 break; |
846 case IDC_RESTORE_TAB: | 848 case IDC_RESTORE_TAB: |
847 chrome::OpenWindowWithRestoredTabs(lastProfile); | 849 chrome::OpenWindowWithRestoredTabs(lastProfile); |
848 break; | 850 break; |
849 case IDC_OPEN_FILE: | 851 case IDC_OPEN_FILE: |
850 CreateBrowser(lastProfile)->ExecuteCommand(IDC_OPEN_FILE); | 852 chrome::ExecuteCommand(CreateBrowser(lastProfile), IDC_OPEN_FILE); |
851 break; | 853 break; |
852 case IDC_CLEAR_BROWSING_DATA: { | 854 case IDC_CLEAR_BROWSING_DATA: { |
853 // There may not be a browser open, so use the default profile. | 855 // There may not be a browser open, so use the default profile. |
854 if (Browser* browser = ActivateBrowser(lastProfile)) { | 856 if (Browser* browser = ActivateBrowser(lastProfile)) { |
855 chrome::ShowClearBrowsingDataDialog(browser); | 857 chrome::ShowClearBrowsingDataDialog(browser); |
856 } else { | 858 } else { |
857 chrome::OpenClearBrowsingDataDialogWindow(lastProfile); | 859 chrome::OpenClearBrowsingDataDialogWindow(lastProfile); |
858 } | 860 } |
859 break; | 861 break; |
860 } | 862 } |
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1319 | 1321 |
1320 } // namespace browser | 1322 } // namespace browser |
1321 | 1323 |
1322 namespace app_controller_mac { | 1324 namespace app_controller_mac { |
1323 | 1325 |
1324 bool IsOpeningNewWindow() { | 1326 bool IsOpeningNewWindow() { |
1325 return g_is_opening_new_window; | 1327 return g_is_opening_new_window; |
1326 } | 1328 } |
1327 | 1329 |
1328 } // namespace app_controller_mac | 1330 } // namespace app_controller_mac |
OLD | NEW |