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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
12 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
13 #include "base/mac/foundation_util.h" | 13 #include "base/mac/foundation_util.h" |
14 #include "base/mac/mac_util.h" | 14 #include "base/mac/mac_util.h" |
15 #include "base/mac/sdk_forward_declarations.h" | 15 #include "base/mac/sdk_forward_declarations.h" |
16 #include "base/macros.h" | 16 #include "base/macros.h" |
17 #include "base/memory/ptr_util.h" | 17 #include "base/memory/ptr_util.h" |
18 #include "base/message_loop/message_loop.h" | |
19 #include "base/metrics/histogram_macros.h" | 18 #include "base/metrics/histogram_macros.h" |
20 #include "base/metrics/user_metrics.h" | 19 #include "base/metrics/user_metrics.h" |
| 20 #include "base/run_loop.h" |
21 #include "base/strings/string_number_conversions.h" | 21 #include "base/strings/string_number_conversions.h" |
22 #include "base/strings/sys_string_conversions.h" | 22 #include "base/strings/sys_string_conversions.h" |
23 #include "base/strings/utf_string_conversions.h" | 23 #include "base/strings/utf_string_conversions.h" |
24 #include "chrome/app/chrome_command_ids.h" | 24 #include "chrome/app/chrome_command_ids.h" |
25 #include "chrome/browser/apps/app_shim/extension_app_shim_handler_mac.h" | 25 #include "chrome/browser/apps/app_shim/extension_app_shim_handler_mac.h" |
26 #include "chrome/browser/apps/app_window_registry_util.h" | 26 #include "chrome/browser/apps/app_window_registry_util.h" |
27 #include "chrome/browser/background/background_application_list_model.h" | 27 #include "chrome/browser/background/background_application_list_model.h" |
28 #include "chrome/browser/background/background_mode_manager.h" | 28 #include "chrome/browser/background/background_mode_manager.h" |
29 #include "chrome/browser/browser_process.h" | 29 #include "chrome/browser/browser_process.h" |
30 #include "chrome/browser/browser_shutdown.h" | 30 #include "chrome/browser/browser_shutdown.h" |
(...skipping 909 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
940 if ([delegate respondsToSelector:@selector(commandDispatch:)]) { | 940 if ([delegate respondsToSelector:@selector(commandDispatch:)]) { |
941 [delegate commandDispatch:sender]; | 941 [delegate commandDispatch:sender]; |
942 return; | 942 return; |
943 } | 943 } |
944 } | 944 } |
945 | 945 |
946 // Ignore commands during session restore's browser creation. It uses a | 946 // Ignore commands during session restore's browser creation. It uses a |
947 // nested message loop and commands dispatched during this operation cause | 947 // nested message loop and commands dispatched during this operation cause |
948 // havoc. | 948 // havoc. |
949 if (SessionRestore::IsRestoring(lastProfile) && | 949 if (SessionRestore::IsRestoring(lastProfile) && |
950 base::MessageLoop::current()->IsNested()) | 950 base::RunLoop::IsNestedOnCurrentThread()) { |
951 return; | 951 return; |
| 952 } |
952 | 953 |
953 NSInteger tag = [sender tag]; | 954 NSInteger tag = [sender tag]; |
954 | 955 |
955 // If there are no browser windows, and we are trying to open a browser | 956 // If there are no browser windows, and we are trying to open a browser |
956 // for a locked profile or the system profile, we have to show the User | 957 // for a locked profile or the system profile, we have to show the User |
957 // Manager instead as the locked profile needs authentication and the system | 958 // Manager instead as the locked profile needs authentication and the system |
958 // profile cannot have a browser. | 959 // profile cannot have a browser. |
959 if (IsProfileSignedOut(lastProfile) || lastProfile->IsSystemProfile()) { | 960 if (IsProfileSignedOut(lastProfile) || lastProfile->IsSystemProfile()) { |
960 UserManager::Show(base::FilePath(), | 961 UserManager::Show(base::FilePath(), |
961 profiles::USER_MANAGER_NO_TUTORIAL, | 962 profiles::USER_MANAGER_NO_TUTORIAL, |
(...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1609 | 1610 |
1610 //--------------------------------------------------------------------------- | 1611 //--------------------------------------------------------------------------- |
1611 | 1612 |
1612 namespace app_controller_mac { | 1613 namespace app_controller_mac { |
1613 | 1614 |
1614 bool IsOpeningNewWindow() { | 1615 bool IsOpeningNewWindow() { |
1615 return g_is_opening_new_window; | 1616 return g_is_opening_new_window; |
1616 } | 1617 } |
1617 | 1618 |
1618 } // namespace app_controller_mac | 1619 } // namespace app_controller_mac |
OLD | NEW |