| 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 "apps/app_shim/extension_app_shim_handler_mac.h" | 7 #include "apps/app_shim/extension_app_shim_handler_mac.h" |
| 8 #include "apps/app_window_registry.h" | 8 #include "apps/app_window_registry.h" |
| 9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 [[NSNotificationCenter defaultCenter] removeObserver:self]; | 356 [[NSNotificationCenter defaultCenter] removeObserver:self]; |
| 357 [[[NSWorkspace sharedWorkspace] notificationCenter] removeObserver:self]; | 357 [[[NSWorkspace sharedWorkspace] notificationCenter] removeObserver:self]; |
| 358 } | 358 } |
| 359 | 359 |
| 360 // (NSApplicationDelegate protocol) This is the Apple-approved place to override | 360 // (NSApplicationDelegate protocol) This is the Apple-approved place to override |
| 361 // the default handlers. | 361 // the default handlers. |
| 362 - (void)applicationWillFinishLaunching:(NSNotification*)notification { | 362 - (void)applicationWillFinishLaunching:(NSNotification*)notification { |
| 363 // Nothing here right now. | 363 // Nothing here right now. |
| 364 } | 364 } |
| 365 | 365 |
| 366 - (void)applicationWillHide:(NSNotification*)notification { |
| 367 apps::ExtensionAppShimHandler::OnChromeWillHide(); |
| 368 } |
| 369 |
| 366 - (BOOL)tryToTerminateApplication:(NSApplication*)app { | 370 - (BOOL)tryToTerminateApplication:(NSApplication*)app { |
| 367 // Check for in-process downloads, and prompt the user if they really want | 371 // Check for in-process downloads, and prompt the user if they really want |
| 368 // to quit (and thus cancel downloads). Only check if we're not already | 372 // to quit (and thus cancel downloads). Only check if we're not already |
| 369 // shutting down, else the user might be prompted multiple times if the | 373 // shutting down, else the user might be prompted multiple times if the |
| 370 // download isn't stopped before terminate is called again. | 374 // download isn't stopped before terminate is called again. |
| 371 if (!browser_shutdown::IsTryingToQuit() && | 375 if (!browser_shutdown::IsTryingToQuit() && |
| 372 ![self shouldQuitWithInProgressDownloads]) | 376 ![self shouldQuitWithInProgressDownloads]) |
| 373 return NO; | 377 return NO; |
| 374 | 378 |
| 375 // TODO(viettrungluu): Remove Apple Event handlers here? (It's safe to leave | 379 // TODO(viettrungluu): Remove Apple Event handlers here? (It's safe to leave |
| (...skipping 1161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1537 | 1541 |
| 1538 //--------------------------------------------------------------------------- | 1542 //--------------------------------------------------------------------------- |
| 1539 | 1543 |
| 1540 namespace app_controller_mac { | 1544 namespace app_controller_mac { |
| 1541 | 1545 |
| 1542 bool IsOpeningNewWindow() { | 1546 bool IsOpeningNewWindow() { |
| 1543 return g_is_opening_new_window; | 1547 return g_is_opening_new_window; |
| 1544 } | 1548 } |
| 1545 | 1549 |
| 1546 } // namespace app_controller_mac | 1550 } // namespace app_controller_mac |
| OLD | NEW |