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 #ifndef CHROME_BROWSER_APP_CONTROLLER_MAC_H_ | 5 #ifndef CHROME_BROWSER_APP_CONTROLLER_MAC_H_ |
6 #define CHROME_BROWSER_APP_CONTROLLER_MAC_H_ | 6 #define CHROME_BROWSER_APP_CONTROLLER_MAC_H_ |
7 | 7 |
8 #if defined(__OBJC__) | 8 #if defined(__OBJC__) |
9 | 9 |
10 #import <Cocoa/Cocoa.h> | 10 #import <Cocoa/Cocoa.h> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/mac/scoped_nsobject.h" | 13 #include "base/mac/scoped_nsobject.h" |
14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
15 #include "base/observer_list.h" | 15 #include "base/observer_list.h" |
16 #include "base/prefs/pref_change_registrar.h" | 16 #include "base/prefs/pref_change_registrar.h" |
17 #include "base/time/time.h" | 17 #include "base/time/time.h" |
18 #include "ui/base/work_area_watcher_observer.h" | 18 #include "ui/base/work_area_watcher_observer.h" |
19 | 19 |
20 class AppControllerProfileObserver; | 20 class AppControllerProfileObserver; |
21 @class AppShimMenuController; | 21 @class AppShimMenuController; |
22 class BookmarkMenuBridge; | 22 class BookmarkMenuBridge; |
23 class CommandUpdater; | 23 class CommandUpdater; |
24 class GURL; | 24 class GURL; |
25 class HistoryMenuBridge; | 25 class HistoryMenuBridge; |
26 class Profile; | 26 class Profile; |
27 @class ProfileMenuController; | 27 @class ProfileMenuController; |
| 28 class QuitWithAppsController; |
| 29 |
28 namespace ui { | 30 namespace ui { |
29 class WorkAreaWatcherObserver; | 31 class WorkAreaWatcherObserver; |
30 } | 32 } |
31 | 33 |
32 // The application controller object, created by loading the MainMenu nib. | 34 // The application controller object, created by loading the MainMenu nib. |
33 // This handles things like responding to menus when there are no windows | 35 // This handles things like responding to menus when there are no windows |
34 // open, etc and acts as the NSApplication delegate. | 36 // open, etc and acts as the NSApplication delegate. |
35 @interface AppController : NSObject<NSUserInterfaceValidations, | 37 @interface AppController : NSObject<NSUserInterfaceValidations, |
36 NSApplicationDelegate> { | 38 NSApplicationDelegate> { |
37 @private | 39 @private |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 | 82 |
81 // If we are expecting a workspace change in response to a reopen | 83 // If we are expecting a workspace change in response to a reopen |
82 // event, the time we got the event. A null time otherwise. | 84 // event, the time we got the event. A null time otherwise. |
83 base::TimeTicks reopenTime_; | 85 base::TimeTicks reopenTime_; |
84 | 86 |
85 // Observers that listen to the work area changes. | 87 // Observers that listen to the work area changes. |
86 ObserverList<ui::WorkAreaWatcherObserver> workAreaChangeObservers_; | 88 ObserverList<ui::WorkAreaWatcherObserver> workAreaChangeObservers_; |
87 | 89 |
88 scoped_ptr<PrefChangeRegistrar> profilePrefRegistrar_; | 90 scoped_ptr<PrefChangeRegistrar> profilePrefRegistrar_; |
89 PrefChangeRegistrar localPrefRegistrar_; | 91 PrefChangeRegistrar localPrefRegistrar_; |
| 92 |
| 93 // Displays a notification when quitting while apps are running. |
| 94 scoped_refptr<QuitWithAppsController> quitWithAppsController_; |
90 } | 95 } |
91 | 96 |
92 @property(readonly, nonatomic) BOOL startupComplete; | 97 @property(readonly, nonatomic) BOOL startupComplete; |
93 @property(readonly, nonatomic) Profile* lastProfile; | 98 @property(readonly, nonatomic) Profile* lastProfile; |
94 | 99 |
95 - (void)didEndMainMessageLoop; | 100 - (void)didEndMainMessageLoop; |
96 | 101 |
97 // Try to close all browser windows, and if that succeeds then quit. | 102 // Try to close all browser windows, and if that succeeds then quit. |
98 - (BOOL)tryToTerminateApplication:(NSApplication*)app; | 103 - (BOOL)tryToTerminateApplication:(NSApplication*)app; |
99 | 104 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 namespace app_controller_mac { | 151 namespace app_controller_mac { |
147 | 152 |
148 // True if we are currently handling an IDC_NEW_{TAB,WINDOW} command. Used in | 153 // True if we are currently handling an IDC_NEW_{TAB,WINDOW} command. Used in |
149 // SessionService::Observe() to get around windows/linux and mac having | 154 // SessionService::Observe() to get around windows/linux and mac having |
150 // different models of application lifetime. | 155 // different models of application lifetime. |
151 bool IsOpeningNewWindow(); | 156 bool IsOpeningNewWindow(); |
152 | 157 |
153 } // namespace app_controller_mac | 158 } // namespace app_controller_mac |
154 | 159 |
155 #endif | 160 #endif |
OLD | NEW |