Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(168)

Side by Side Diff: chrome/browser/app_controller_mac.mm

Issue 1661713002: Remove the rest of HostDesktopType from c/b/ui/browser_finder.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@metro-mode-11
Patch Set: linux adl Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/captive_portal/captive_portal_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after
528 528
529 [self unregisterEventHandlers]; 529 [self unregisterEventHandlers];
530 530
531 appShimMenuController_.reset(); 531 appShimMenuController_.reset();
532 532
533 STLDeleteContainerPairSecondPointers(profileBookmarkMenuBridgeMap_.begin(), 533 STLDeleteContainerPairSecondPointers(profileBookmarkMenuBridgeMap_.begin(),
534 profileBookmarkMenuBridgeMap_.end()); 534 profileBookmarkMenuBridgeMap_.end());
535 } 535 }
536 536
537 - (void)didEndMainMessageLoop { 537 - (void)didEndMainMessageLoop {
538 DCHECK_EQ(0u, chrome::GetBrowserCount([self lastProfile], 538 DCHECK_EQ(0u, chrome::GetBrowserCount([self lastProfile]));
539 chrome::HOST_DESKTOP_TYPE_NATIVE)); 539 if (!chrome::GetBrowserCount([self lastProfile])) {
540 if (!chrome::GetBrowserCount([self lastProfile],
541 chrome::HOST_DESKTOP_TYPE_NATIVE)) {
542 // As we're shutting down, we need to nuke the TabRestoreService, which 540 // As we're shutting down, we need to nuke the TabRestoreService, which
543 // will start the shutdown of the NavigationControllers and allow for 541 // will start the shutdown of the NavigationControllers and allow for
544 // proper shutdown. If we don't do this, Chrome won't shut down cleanly, 542 // proper shutdown. If we don't do this, Chrome won't shut down cleanly,
545 // and may end up crashing when some thread tries to use the IO thread (or 543 // and may end up crashing when some thread tries to use the IO thread (or
546 // another thread) that is no longer valid. 544 // another thread) that is no longer valid.
547 TabRestoreServiceFactory::ResetForProfile([self lastProfile]); 545 TabRestoreServiceFactory::ResetForProfile([self lastProfile]);
548 } 546 }
549 } 547 }
550 548
551 // If the window has a tab controller, make "close window" be cmd-shift-w, 549 // If the window has a tab controller, make "close window" be cmd-shift-w,
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
844 DownloadServiceFactory::GetForBrowserContext(profiles[i]); 842 DownloadServiceFactory::GetForBrowserContext(profiles[i]);
845 DownloadManager* download_manager = 843 DownloadManager* download_manager =
846 (download_service->HasCreatedDownloadManager() ? 844 (download_service->HasCreatedDownloadManager() ?
847 BrowserContext::GetDownloadManager(profiles[i]) : NULL); 845 BrowserContext::GetDownloadManager(profiles[i]) : NULL);
848 if (download_manager && 846 if (download_manager &&
849 download_manager->NonMaliciousInProgressCount() > 0) { 847 download_manager->NonMaliciousInProgressCount() > 0) {
850 int downloadCount = download_manager->NonMaliciousInProgressCount(); 848 int downloadCount = download_manager->NonMaliciousInProgressCount();
851 if ([self userWillWaitForInProgressDownloads:downloadCount]) { 849 if ([self userWillWaitForInProgressDownloads:downloadCount]) {
852 // Create a new browser window (if necessary) and navigate to the 850 // Create a new browser window (if necessary) and navigate to the
853 // downloads page if the user chooses to wait. 851 // downloads page if the user chooses to wait.
854 Browser* browser = chrome::FindBrowserWithProfile( 852 Browser* browser = chrome::FindBrowserWithProfile(profiles[i]);
855 profiles[i], chrome::HOST_DESKTOP_TYPE_NATIVE);
856 if (!browser) { 853 if (!browser) {
857 browser = new Browser(Browser::CreateParams( 854 browser = new Browser(Browser::CreateParams(
858 profiles[i], chrome::HOST_DESKTOP_TYPE_NATIVE)); 855 profiles[i], chrome::HOST_DESKTOP_TYPE_NATIVE));
859 browser->window()->Show(); 856 browser->window()->Show();
860 } 857 }
861 DCHECK(browser); 858 DCHECK(browser);
862 chrome::ShowDownloads(browser); 859 chrome::ShowDownloads(browser);
863 return NO; 860 return NO;
864 } 861 }
865 862
(...skipping 834 matching lines...) Expand 10 before | Expand all | Expand 10 after
1700 1697
1701 //--------------------------------------------------------------------------- 1698 //---------------------------------------------------------------------------
1702 1699
1703 namespace app_controller_mac { 1700 namespace app_controller_mac {
1704 1701
1705 bool IsOpeningNewWindow() { 1702 bool IsOpeningNewWindow() {
1706 return g_is_opening_new_window; 1703 return g_is_opening_new_window;
1707 } 1704 }
1708 1705
1709 } // namespace app_controller_mac 1706 } // namespace app_controller_mac
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/captive_portal/captive_portal_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698