| 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/file_path.h" | 10 #include "base/file_path.h" |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 if (!browser_shutdown::IsTryingToQuit() && | 316 if (!browser_shutdown::IsTryingToQuit() && |
| 317 [self applicationShouldTerminate:app] != NSTerminateNow) | 317 [self applicationShouldTerminate:app] != NSTerminateNow) |
| 318 return NO; | 318 return NO; |
| 319 | 319 |
| 320 size_t num_browsers = BrowserList::size(); | 320 size_t num_browsers = BrowserList::size(); |
| 321 | 321 |
| 322 // Initiate a shutdown (via browser::CloseAllBrowsers()) if we aren't | 322 // Initiate a shutdown (via browser::CloseAllBrowsers()) if we aren't |
| 323 // already shutting down. | 323 // already shutting down. |
| 324 if (!browser_shutdown::IsTryingToQuit()) { | 324 if (!browser_shutdown::IsTryingToQuit()) { |
| 325 content::NotificationService::current()->Notify( | 325 content::NotificationService::current()->Notify( |
| 326 content::NOTIFICATION_CLOSE_ALL_BROWSERS_REQUEST, | 326 chrome::NOTIFICATION_CLOSE_ALL_BROWSERS_REQUEST, |
| 327 content::NotificationService::AllSources(), | 327 content::NotificationService::AllSources(), |
| 328 content::NotificationService::NoDetails()); | 328 content::NotificationService::NoDetails()); |
| 329 browser::CloseAllBrowsers(); | 329 browser::CloseAllBrowsers(); |
| 330 } | 330 } |
| 331 | 331 |
| 332 return num_browsers == 0 ? YES : NO; | 332 return num_browsers == 0 ? YES : NO; |
| 333 } | 333 } |
| 334 | 334 |
| 335 - (void)stopTryingToTerminateApplication:(NSApplication*)app { | 335 - (void)stopTryingToTerminateApplication:(NSApplication*)app { |
| 336 if (browser_shutdown::IsTryingToQuit()) { | 336 if (browser_shutdown::IsTryingToQuit()) { |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 538 | 538 |
| 539 historyMenuBridge_.reset(new HistoryMenuBridge(lastProfile_)); | 539 historyMenuBridge_.reset(new HistoryMenuBridge(lastProfile_)); |
| 540 historyMenuBridge_->BuildMenu(); | 540 historyMenuBridge_->BuildMenu(); |
| 541 } | 541 } |
| 542 | 542 |
| 543 - (void)checkForAnyKeyWindows { | 543 - (void)checkForAnyKeyWindows { |
| 544 if ([NSApp keyWindow]) | 544 if ([NSApp keyWindow]) |
| 545 return; | 545 return; |
| 546 | 546 |
| 547 content::NotificationService::current()->Notify( | 547 content::NotificationService::current()->Notify( |
| 548 content::NOTIFICATION_NO_KEY_WINDOW, | 548 chrome::NOTIFICATION_NO_KEY_WINDOW, |
| 549 content::NotificationService::AllSources(), | 549 content::NotificationService::AllSources(), |
| 550 content::NotificationService::NoDetails()); | 550 content::NotificationService::NoDetails()); |
| 551 } | 551 } |
| 552 | 552 |
| 553 // If the auto-update interval is not set, make it 5 hours. | 553 // If the auto-update interval is not set, make it 5 hours. |
| 554 // This code is specific to Mac Chrome Dev Channel. | 554 // This code is specific to Mac Chrome Dev Channel. |
| 555 // Placed here for 2 reasons: | 555 // Placed here for 2 reasons: |
| 556 // 1) Same spot as other Pref stuff | 556 // 1) Same spot as other Pref stuff |
| 557 // 2) Try and be friendly by keeping this after app launch | 557 // 2) Try and be friendly by keeping this after app launch |
| 558 // TODO(jrg): remove once we go Beta. | 558 // TODO(jrg): remove once we go Beta. |
| (...skipping 759 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1318 | 1318 |
| 1319 } // namespace browser | 1319 } // namespace browser |
| 1320 | 1320 |
| 1321 namespace app_controller_mac { | 1321 namespace app_controller_mac { |
| 1322 | 1322 |
| 1323 bool IsOpeningNewWindow() { | 1323 bool IsOpeningNewWindow() { |
| 1324 return g_is_opening_new_window; | 1324 return g_is_opening_new_window; |
| 1325 } | 1325 } |
| 1326 | 1326 |
| 1327 } // namespace app_controller_mac | 1327 } // namespace app_controller_mac |
| OLD | NEW |