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

Side by Side Diff: chrome/browser/ui/cocoa/apps/quit_with_apps_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: 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
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_UI_COCOA_APPS_QUIT_WITH_APPS_CONTROLLER_MAC_H_
6 #define CHROME_BROWSER_UI_COCOA_APPS_QUIT_WITH_APPS_CONTROLLER_MAC_H_
7
8 #include "chrome/browser/notifications/notification.h"
tapted 2014/04/01 08:09:45 nit: #include scoped_ptr some would say you shoul
jackhou1 2014/04/02 06:38:38 Done.
9
10 // QuitWithAppsController checks whether any apps are running and shows a
11 // notification to quit all of them.
12 class QuitWithAppsController : public NotificationDelegate {
13 public:
14 QuitWithAppsController();
15
16 static const char kQuitWithApps[];
tapted 2014/04/01 08:09:45 nit: maybe 'kQuitWithAppsNotificationID' also I t
jackhou1 2014/04/02 06:38:38 Done.
17
18 // NotificationDelegate interface.
19 virtual void Display() OVERRIDE;
20 virtual void Error() OVERRIDE;
21 virtual void Close(bool by_user) OVERRIDE;
22 virtual void Click() OVERRIDE;
23 virtual void ButtonClick(int button_index) OVERRIDE;
24 virtual content::RenderViewHost* GetRenderViewHost() const OVERRIDE;
25 virtual std::string id() const OVERRIDE;
26
27 // Attempt to quit Chrome. This will display a notification and return false
28 // if there are apps running.
29 bool ShouldQuit();
30
31 private:
32 virtual ~QuitWithAppsController();
33
34 scoped_ptr<Notification> notification_;
35
36 bool suppress_for_session_;
tapted 2014/04/01 08:09:45 nit: maybe a comment for this - i had to look up a
jackhou1 2014/04/02 06:38:38 Done.
37
38 DISALLOW_COPY_AND_ASSIGN(QuitWithAppsController);
39 };
40
41 #endif // CHROME_BROWSER_UI_COCOA_APPS_QUIT_WITH_APPS_CONTROLLER_MAC_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698