OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "app/l10n_util_mac.h" | 8 #include "app/l10n_util_mac.h" |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
11 #include "base/file_path.h" | 11 #include "base/file_path.h" |
12 #include "base/mac_util.h" | 12 #include "base/mac/mac_util.h" |
13 #include "base/message_loop.h" | 13 #include "base/message_loop.h" |
14 #include "base/string_number_conversions.h" | 14 #include "base/string_number_conversions.h" |
15 #include "base/sys_string_conversions.h" | 15 #include "base/sys_string_conversions.h" |
16 #include "chrome/app/chrome_command_ids.h" | 16 #include "chrome/app/chrome_command_ids.h" |
17 #include "chrome/browser/background_application_list_model.h" | 17 #include "chrome/browser/background_application_list_model.h" |
18 #include "chrome/browser/browser_process.h" | 18 #include "chrome/browser/browser_process.h" |
19 #include "chrome/browser/browser_shutdown.h" | 19 #include "chrome/browser/browser_shutdown.h" |
20 #include "chrome/browser/browser_thread.h" | 20 #include "chrome/browser/browser_thread.h" |
21 #include "chrome/browser/command_updater.h" | 21 #include "chrome/browser/command_updater.h" |
22 #include "chrome/browser/download/download_manager.h" | 22 #include "chrome/browser/download/download_manager.h" |
(...skipping 965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
988 return YES; | 988 return YES; |
989 | 989 |
990 // If launched as a hidden login item (due to installation of a persistent app | 990 // If launched as a hidden login item (due to installation of a persistent app |
991 // or by the user, for example in System Preferenecs->Accounts->Login Items), | 991 // or by the user, for example in System Preferenecs->Accounts->Login Items), |
992 // allow session to be restored first time the user clicks on a Dock icon. | 992 // allow session to be restored first time the user clicks on a Dock icon. |
993 // Normally, it'd just open a new empty page. | 993 // Normally, it'd just open a new empty page. |
994 { | 994 { |
995 static BOOL doneOnce = NO; | 995 static BOOL doneOnce = NO; |
996 if (!doneOnce) { | 996 if (!doneOnce) { |
997 doneOnce = YES; | 997 doneOnce = YES; |
998 if (mac_util::WasLaunchedAsHiddenLoginItem()) { | 998 if (base::mac::WasLaunchedAsHiddenLoginItem()) { |
999 SessionService* sessionService = | 999 SessionService* sessionService = |
1000 [self defaultProfile]->GetSessionService(); | 1000 [self defaultProfile]->GetSessionService(); |
1001 if (sessionService && | 1001 if (sessionService && |
1002 sessionService->RestoreIfNecessary(std::vector<GURL>())) | 1002 sessionService->RestoreIfNecessary(std::vector<GURL>())) |
1003 return NO; | 1003 return NO; |
1004 } | 1004 } |
1005 } | 1005 } |
1006 } | 1006 } |
1007 // Otherwise open a new window. | 1007 // Otherwise open a new window. |
1008 { | 1008 { |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1261 [appController showPreferencesWindow:nil page:page profile:profile]; | 1261 [appController showPreferencesWindow:nil page:page profile:profile]; |
1262 } | 1262 } |
1263 | 1263 |
1264 namespace app_controller_mac { | 1264 namespace app_controller_mac { |
1265 | 1265 |
1266 bool IsOpeningNewWindow() { | 1266 bool IsOpeningNewWindow() { |
1267 return g_is_opening_new_window; | 1267 return g_is_opening_new_window; |
1268 } | 1268 } |
1269 | 1269 |
1270 } // namespace app_controller_mac | 1270 } // namespace app_controller_mac |
OLD | NEW |