Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(360)

Side by Side Diff: chrome/browser/app_controller_mac.h

Issue 220373003: Prevent Chrome from quitting when apps are open. (Mac) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync and rebase Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/about_flags.cc ('k') | chrome/browser/app_controller_mac.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 namespace app_controller_mac { 154 namespace app_controller_mac {
150 155
151 // True if we are currently handling an IDC_NEW_{TAB,WINDOW} command. Used in 156 // True if we are currently handling an IDC_NEW_{TAB,WINDOW} command. Used in
152 // SessionService::Observe() to get around windows/linux and mac having 157 // SessionService::Observe() to get around windows/linux and mac having
153 // different models of application lifetime. 158 // different models of application lifetime.
154 bool IsOpeningNewWindow(); 159 bool IsOpeningNewWindow();
155 160
156 } // namespace app_controller_mac 161 } // namespace app_controller_mac
157 162
158 #endif 163 #endif
OLDNEW
« no previous file with comments | « chrome/browser/about_flags.cc ('k') | chrome/browser/app_controller_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698