| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 #import "chrome/browser/ui/cocoa/tabs/tab_window_controller.h" | 45 #import "chrome/browser/ui/cocoa/tabs/tab_window_controller.h" |
| 46 #include "chrome/browser/ui/cocoa/task_manager_mac.h" | 46 #include "chrome/browser/ui/cocoa/task_manager_mac.h" |
| 47 #include "chrome/common/app_mode_common_mac.h" | 47 #include "chrome/common/app_mode_common_mac.h" |
| 48 #include "chrome/common/chrome_paths_internal.h" | 48 #include "chrome/common/chrome_paths_internal.h" |
| 49 #include "chrome/common/chrome_switches.h" | 49 #include "chrome/common/chrome_switches.h" |
| 50 #include "chrome/common/pref_names.h" | 50 #include "chrome/common/pref_names.h" |
| 51 #include "chrome/common/url_constants.h" | 51 #include "chrome/common/url_constants.h" |
| 52 #include "content/browser/browser_thread.h" | 52 #include "content/browser/browser_thread.h" |
| 53 #include "content/browser/tab_contents/tab_contents.h" | 53 #include "content/browser/tab_contents/tab_contents.h" |
| 54 #include "content/browser/user_metrics.h" | 54 #include "content/browser/user_metrics.h" |
| 55 #include "content/common/content_notification_types.h" |
| 55 #include "content/common/notification_service.h" | 56 #include "content/common/notification_service.h" |
| 56 #include "grit/chromium_strings.h" | 57 #include "grit/chromium_strings.h" |
| 57 #include "grit/generated_resources.h" | 58 #include "grit/generated_resources.h" |
| 58 #include "net/base/net_util.h" | 59 #include "net/base/net_util.h" |
| 59 #include "ui/base/l10n/l10n_util.h" | 60 #include "ui/base/l10n/l10n_util.h" |
| 60 #include "ui/base/l10n/l10n_util_mac.h" | 61 #include "ui/base/l10n/l10n_util_mac.h" |
| 61 #include "ui/base/models/accelerator_cocoa.h" | 62 #include "ui/base/models/accelerator_cocoa.h" |
| 62 | 63 |
| 63 // 10.6 adds a public API for the Spotlight-backed search menu item in the Help | 64 // 10.6 adds a public API for the Spotlight-backed search menu item in the Help |
| 64 // menu. Provide the declaration so it can be called below when building with | 65 // menu. Provide the declaration so it can be called below when building with |
| (...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 467 | 468 |
| 468 historyMenuBridge_.reset(new HistoryMenuBridge(lastProfile_)); | 469 historyMenuBridge_.reset(new HistoryMenuBridge(lastProfile_)); |
| 469 historyMenuBridge_->BuildMenu(); | 470 historyMenuBridge_->BuildMenu(); |
| 470 } | 471 } |
| 471 | 472 |
| 472 - (void)checkForAnyKeyWindows { | 473 - (void)checkForAnyKeyWindows { |
| 473 if ([NSApp keyWindow]) | 474 if ([NSApp keyWindow]) |
| 474 return; | 475 return; |
| 475 | 476 |
| 476 NotificationService::current()->Notify( | 477 NotificationService::current()->Notify( |
| 477 NotificationType::NO_KEY_WINDOW, | 478 chrome::NOTIFICATION_NO_KEY_WINDOW, |
| 478 NotificationService::AllSources(), | 479 NotificationService::AllSources(), |
| 479 NotificationService::NoDetails()); | 480 NotificationService::NoDetails()); |
| 480 } | 481 } |
| 481 | 482 |
| 482 // If the auto-update interval is not set, make it 5 hours. | 483 // If the auto-update interval is not set, make it 5 hours. |
| 483 // This code is specific to Mac Chrome Dev Channel. | 484 // This code is specific to Mac Chrome Dev Channel. |
| 484 // Placed here for 2 reasons: | 485 // Placed here for 2 reasons: |
| 485 // 1) Same spot as other Pref stuff | 486 // 1) Same spot as other Pref stuff |
| 486 // 2) Try and be friendly by keeping this after app launch | 487 // 2) Try and be friendly by keeping this after app launch |
| 487 // TODO(jrg): remove once we go Beta. | 488 // TODO(jrg): remove once we go Beta. |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 542 | 543 |
| 543 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); | 544 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); |
| 544 if (!parsed_command_line.HasSwitch(switches::kEnableExposeForTabs)) { | 545 if (!parsed_command_line.HasSwitch(switches::kEnableExposeForTabs)) { |
| 545 [tabposeMenuItem_ setHidden:YES]; | 546 [tabposeMenuItem_ setHidden:YES]; |
| 546 } | 547 } |
| 547 } | 548 } |
| 548 | 549 |
| 549 // This is called after profiles have been loaded and preferences registered. | 550 // This is called after profiles have been loaded and preferences registered. |
| 550 // It is safe to access the default profile here. | 551 // It is safe to access the default profile here. |
| 551 - (void)applicationDidBecomeActive:(NSNotification*)notify { | 552 - (void)applicationDidBecomeActive:(NSNotification*)notify { |
| 552 NotificationService::current()->Notify(NotificationType::APP_ACTIVATED, | 553 NotificationService::current()->Notify(chrome::NOTIFICATION_APP_ACTIVATED, |
| 553 NotificationService::AllSources(), | 554 NotificationService::AllSources(), |
| 554 NotificationService::NoDetails()); | 555 NotificationService::NoDetails()); |
| 555 } | 556 } |
| 556 | 557 |
| 557 // Helper function for populating and displaying the in progress downloads at | 558 // Helper function for populating and displaying the in progress downloads at |
| 558 // exit alert panel. | 559 // exit alert panel. |
| 559 - (BOOL)userWillWaitForInProgressDownloads:(int)downloadCount { | 560 - (BOOL)userWillWaitForInProgressDownloads:(int)downloadCount { |
| 560 NSString* warningText = nil; | 561 NSString* warningText = nil; |
| 561 NSString* explanationText = nil; | 562 NSString* explanationText = nil; |
| 562 NSString* waitTitle = nil; | 563 NSString* waitTitle = nil; |
| (...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1197 | 1198 |
| 1198 } // namespace browser | 1199 } // namespace browser |
| 1199 | 1200 |
| 1200 namespace app_controller_mac { | 1201 namespace app_controller_mac { |
| 1201 | 1202 |
| 1202 bool IsOpeningNewWindow() { | 1203 bool IsOpeningNewWindow() { |
| 1203 return g_is_opening_new_window; | 1204 return g_is_opening_new_window; |
| 1204 } | 1205 } |
| 1205 | 1206 |
| 1206 } // namespace app_controller_mac | 1207 } // namespace app_controller_mac |
| OLD | NEW |