| 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 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 [[[NSWorkspace sharedWorkspace] notificationCenter] removeObserver:self]; | 360 [[[NSWorkspace sharedWorkspace] notificationCenter] removeObserver:self]; |
| 361 } | 361 } |
| 362 | 362 |
| 363 // (NSApplicationDelegate protocol) This is the Apple-approved place to override | 363 // (NSApplicationDelegate protocol) This is the Apple-approved place to override |
| 364 // the default handlers. | 364 // the default handlers. |
| 365 - (void)applicationWillFinishLaunching:(NSNotification*)notification { | 365 - (void)applicationWillFinishLaunching:(NSNotification*)notification { |
| 366 MacStartupProfiler::GetInstance()->Profile( | 366 MacStartupProfiler::GetInstance()->Profile( |
| 367 MacStartupProfiler::WILL_FINISH_LAUNCHING); | 367 MacStartupProfiler::WILL_FINISH_LAUNCHING); |
| 368 } | 368 } |
| 369 | 369 |
| 370 - (void)applicationWillHide:(NSNotification*)notification { |
| 371 apps::ExtensionAppShimHandler::OnChromeWillHide(); |
| 372 } |
| 373 |
| 370 - (BOOL)tryToTerminateApplication:(NSApplication*)app { | 374 - (BOOL)tryToTerminateApplication:(NSApplication*)app { |
| 371 // Check for in-process downloads, and prompt the user if they really want | 375 // Check for in-process downloads, and prompt the user if they really want |
| 372 // to quit (and thus cancel downloads). Only check if we're not already | 376 // to quit (and thus cancel downloads). Only check if we're not already |
| 373 // shutting down, else the user might be prompted multiple times if the | 377 // shutting down, else the user might be prompted multiple times if the |
| 374 // download isn't stopped before terminate is called again. | 378 // download isn't stopped before terminate is called again. |
| 375 if (!browser_shutdown::IsTryingToQuit() && | 379 if (!browser_shutdown::IsTryingToQuit() && |
| 376 ![self shouldQuitWithInProgressDownloads]) | 380 ![self shouldQuitWithInProgressDownloads]) |
| 377 return NO; | 381 return NO; |
| 378 | 382 |
| 379 // TODO(viettrungluu): Remove Apple Event handlers here? (It's safe to leave | 383 // TODO(viettrungluu): Remove Apple Event handlers here? (It's safe to leave |
| (...skipping 1165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1545 | 1549 |
| 1546 //--------------------------------------------------------------------------- | 1550 //--------------------------------------------------------------------------- |
| 1547 | 1551 |
| 1548 namespace app_controller_mac { | 1552 namespace app_controller_mac { |
| 1549 | 1553 |
| 1550 bool IsOpeningNewWindow() { | 1554 bool IsOpeningNewWindow() { |
| 1551 return g_is_opening_new_window; | 1555 return g_is_opening_new_window; |
| 1552 } | 1556 } |
| 1553 | 1557 |
| 1554 } // namespace app_controller_mac | 1558 } // namespace app_controller_mac |
| OLD | NEW |