OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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_UI_COCOA_APPS_QUIT_WITH_APPS_CONTROLLER_MAC_H_ | 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_ | 6 #define CHROME_BROWSER_UI_COCOA_APPS_QUIT_WITH_APPS_CONTROLLER_MAC_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "chrome/browser/notifications/notification.h" | 10 #include "chrome/browser/notifications/notification.h" |
11 | 11 |
12 class PrefRegistrySimple; | 12 class PrefRegistrySimple; |
13 | 13 |
14 // QuitWithAppsController checks whether any apps are running and shows a | 14 // QuitWithAppsController checks whether any apps are running and shows a |
15 // notification to quit all of them. | 15 // notification to quit all of them. |
16 class QuitWithAppsController : public NotificationDelegate { | 16 class QuitWithAppsController : public NotificationDelegate { |
17 public: | 17 public: |
18 static const char kQuitWithAppsNotificationID[]; | 18 static const char kQuitWithAppsNotificationID[]; |
19 | 19 |
20 QuitWithAppsController(); | 20 QuitWithAppsController(); |
21 | 21 |
22 // NotificationDelegate interface. | 22 // NotificationDelegate interface. |
23 virtual void Display() OVERRIDE; | 23 virtual void Display() override; |
24 virtual void Error() OVERRIDE; | 24 virtual void Error() override; |
25 virtual void Close(bool by_user) OVERRIDE; | 25 virtual void Close(bool by_user) override; |
26 virtual void Click() OVERRIDE; | 26 virtual void Click() override; |
27 virtual void ButtonClick(int button_index) OVERRIDE; | 27 virtual void ButtonClick(int button_index) override; |
28 virtual content::WebContents* GetWebContents() const OVERRIDE; | 28 virtual content::WebContents* GetWebContents() const override; |
29 virtual std::string id() const OVERRIDE; | 29 virtual std::string id() const override; |
30 | 30 |
31 // Attempt to quit Chrome. This will display a notification and return false | 31 // Attempt to quit Chrome. This will display a notification and return false |
32 // if there are apps running. | 32 // if there are apps running. |
33 bool ShouldQuit(); | 33 bool ShouldQuit(); |
34 | 34 |
35 // Register prefs used by QuitWithAppsController. | 35 // Register prefs used by QuitWithAppsController. |
36 static void RegisterPrefs(PrefRegistrySimple* registry); | 36 static void RegisterPrefs(PrefRegistrySimple* registry); |
37 | 37 |
38 private: | 38 private: |
39 virtual ~QuitWithAppsController(); | 39 virtual ~QuitWithAppsController(); |
40 | 40 |
41 scoped_ptr<Notification> notification_; | 41 scoped_ptr<Notification> notification_; |
42 | 42 |
43 // Whether to suppress showing the notification for the rest of the session. | 43 // Whether to suppress showing the notification for the rest of the session. |
44 bool suppress_for_session_; | 44 bool suppress_for_session_; |
45 | 45 |
46 DISALLOW_COPY_AND_ASSIGN(QuitWithAppsController); | 46 DISALLOW_COPY_AND_ASSIGN(QuitWithAppsController); |
47 }; | 47 }; |
48 | 48 |
49 #endif // CHROME_BROWSER_UI_COCOA_APPS_QUIT_WITH_APPS_CONTROLLER_MAC_H_ | 49 #endif // CHROME_BROWSER_UI_COCOA_APPS_QUIT_WITH_APPS_CONTROLLER_MAC_H_ |
OLD | NEW |