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 817 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
828 if ([delegate isKindOfClass:[BrowserWindowController class]]) { | 828 if ([delegate isKindOfClass:[BrowserWindowController class]]) { |
829 [delegate commandDispatch:sender]; | 829 [delegate commandDispatch:sender]; |
830 return; | 830 return; |
831 } | 831 } |
832 } | 832 } |
833 | 833 |
834 // Ignore commands during session restore's browser creation. It uses a | 834 // Ignore commands during session restore's browser creation. It uses a |
835 // nested message loop and commands dispatched during this operation cause | 835 // nested message loop and commands dispatched during this operation cause |
836 // havoc. | 836 // havoc. |
837 if (SessionRestore::IsRestoring(lastProfile) && | 837 if (SessionRestore::IsRestoring(lastProfile) && |
838 MessageLoop::current()->IsNested()) | 838 base::MessageLoop::current()->IsNested()) |
839 return; | 839 return; |
840 | 840 |
841 NSInteger tag = [sender tag]; | 841 NSInteger tag = [sender tag]; |
842 switch (tag) { | 842 switch (tag) { |
843 case IDC_NEW_TAB: | 843 case IDC_NEW_TAB: |
844 // Create a new tab in an existing browser window (which we activate) if | 844 // Create a new tab in an existing browser window (which we activate) if |
845 // possible. | 845 // possible. |
846 if (Browser* browser = ActivateBrowser(lastProfile)) { | 846 if (Browser* browser = ActivateBrowser(lastProfile)) { |
847 chrome::ExecuteCommand(browser, IDC_NEW_TAB); | 847 chrome::ExecuteCommand(browser, IDC_NEW_TAB); |
848 break; | 848 break; |
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1316 | 1316 |
1317 //--------------------------------------------------------------------------- | 1317 //--------------------------------------------------------------------------- |
1318 | 1318 |
1319 namespace app_controller_mac { | 1319 namespace app_controller_mac { |
1320 | 1320 |
1321 bool IsOpeningNewWindow() { | 1321 bool IsOpeningNewWindow() { |
1322 return g_is_opening_new_window; | 1322 return g_is_opening_new_window; |
1323 } | 1323 } |
1324 | 1324 |
1325 } // namespace app_controller_mac | 1325 } // namespace app_controller_mac |
OLD | NEW |