| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
| 10 #include "base/mac/foundation_util.h" | 10 #include "base/mac/foundation_util.h" |
| (...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 646 for (size_t i = 0; i < profiles.size(); ++i) { | 646 for (size_t i = 0; i < profiles.size(); ++i) { |
| 647 DownloadManager* download_manager = profiles[i]->GetDownloadManager(); | 647 DownloadManager* download_manager = profiles[i]->GetDownloadManager(); |
| 648 if (download_manager && download_manager->in_progress_count() > 0) { | 648 if (download_manager && download_manager->in_progress_count() > 0) { |
| 649 int downloadCount = download_manager->in_progress_count(); | 649 int downloadCount = download_manager->in_progress_count(); |
| 650 if ([self userWillWaitForInProgressDownloads:downloadCount]) { | 650 if ([self userWillWaitForInProgressDownloads:downloadCount]) { |
| 651 // Create a new browser window (if necessary) and navigate to the | 651 // Create a new browser window (if necessary) and navigate to the |
| 652 // downloads page if the user chooses to wait. | 652 // downloads page if the user chooses to wait. |
| 653 Browser* browser = BrowserList::FindBrowserWithProfile(profiles[i]); | 653 Browser* browser = BrowserList::FindBrowserWithProfile(profiles[i]); |
| 654 if (!browser) { | 654 if (!browser) { |
| 655 browser = Browser::Create(profiles[i]); | 655 browser = Browser::Create(profiles[i]); |
| 656 browser->window()->Show(); | 656 browser->window()->Show(BrowserWindow::SHOW_CONTEXT_NORMAL); |
| 657 } | 657 } |
| 658 DCHECK(browser); | 658 DCHECK(browser); |
| 659 browser->ShowDownloadsTab(); | 659 browser->ShowDownloadsTab(); |
| 660 return NO; | 660 return NO; |
| 661 } | 661 } |
| 662 | 662 |
| 663 // User wants to exit. | 663 // User wants to exit. |
| 664 return YES; | 664 return YES; |
| 665 } | 665 } |
| 666 } | 666 } |
| (...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1068 // If the browser hasn't started yet, just queue up the URLs. | 1068 // If the browser hasn't started yet, just queue up the URLs. |
| 1069 if (!startupComplete_) { | 1069 if (!startupComplete_) { |
| 1070 startupUrls_.insert(startupUrls_.end(), urls.begin(), urls.end()); | 1070 startupUrls_.insert(startupUrls_.end(), urls.begin(), urls.end()); |
| 1071 return; | 1071 return; |
| 1072 } | 1072 } |
| 1073 | 1073 |
| 1074 Browser* browser = BrowserList::GetLastActive(); | 1074 Browser* browser = BrowserList::GetLastActive(); |
| 1075 // if no browser window exists then create one with no tabs to be filled in | 1075 // if no browser window exists then create one with no tabs to be filled in |
| 1076 if (!browser) { | 1076 if (!browser) { |
| 1077 browser = Browser::Create([self lastProfile]); | 1077 browser = Browser::Create([self lastProfile]); |
| 1078 browser->window()->Show(); | 1078 browser->window()->Show(BrowserWindow::SHOW_CONTEXT_NORMAL); |
| 1079 } | 1079 } |
| 1080 | 1080 |
| 1081 CommandLine dummy(CommandLine::NO_PROGRAM); | 1081 CommandLine dummy(CommandLine::NO_PROGRAM); |
| 1082 BrowserInit::LaunchWithProfile launch(FilePath(), dummy); | 1082 BrowserInit::LaunchWithProfile launch(FilePath(), dummy); |
| 1083 launch.OpenURLsInBrowser(browser, false, urls); | 1083 launch.OpenURLsInBrowser(browser, false, urls); |
| 1084 } | 1084 } |
| 1085 | 1085 |
| 1086 - (void)getUrl:(NSAppleEventDescriptor*)event | 1086 - (void)getUrl:(NSAppleEventDescriptor*)event |
| 1087 withReply:(NSAppleEventDescriptor*)reply { | 1087 withReply:(NSAppleEventDescriptor*)reply { |
| 1088 NSString* urlStr = [[event paramDescriptorForKeyword:keyDirectObject] | 1088 NSString* urlStr = [[event paramDescriptorForKeyword:keyDirectObject] |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1287 | 1287 |
| 1288 } // namespace browser | 1288 } // namespace browser |
| 1289 | 1289 |
| 1290 namespace app_controller_mac { | 1290 namespace app_controller_mac { |
| 1291 | 1291 |
| 1292 bool IsOpeningNewWindow() { | 1292 bool IsOpeningNewWindow() { |
| 1293 return g_is_opening_new_window; | 1293 return g_is_opening_new_window; |
| 1294 } | 1294 } |
| 1295 | 1295 |
| 1296 } // namespace app_controller_mac | 1296 } // namespace app_controller_mac |
| OLD | NEW |