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 <memory> |
| 9 |
8 #include "base/macros.h" | 10 #include "base/macros.h" |
9 #include "base/memory/scoped_ptr.h" | |
10 #include "chrome/browser/notifications/notification.h" | 11 #include "chrome/browser/notifications/notification.h" |
11 | 12 |
12 class PrefRegistrySimple; | 13 class PrefRegistrySimple; |
13 class Profile; | 14 class Profile; |
14 | 15 |
15 // QuitWithAppsController checks whether any apps are running and shows a | 16 // QuitWithAppsController checks whether any apps are running and shows a |
16 // notification to quit all of them. | 17 // notification to quit all of them. |
17 class QuitWithAppsController : public NotificationDelegate { | 18 class QuitWithAppsController : public NotificationDelegate { |
18 public: | 19 public: |
19 static const char kQuitWithAppsNotificationID[]; | 20 static const char kQuitWithAppsNotificationID[]; |
(...skipping 10 matching lines...) Expand all Loading... |
30 // 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 |
31 // if there are apps running. | 32 // if there are apps running. |
32 bool ShouldQuit(); | 33 bool ShouldQuit(); |
33 | 34 |
34 // Register prefs used by QuitWithAppsController. | 35 // Register prefs used by QuitWithAppsController. |
35 static void RegisterPrefs(PrefRegistrySimple* registry); | 36 static void RegisterPrefs(PrefRegistrySimple* registry); |
36 | 37 |
37 private: | 38 private: |
38 ~QuitWithAppsController() override; | 39 ~QuitWithAppsController() override; |
39 | 40 |
40 scoped_ptr<Notification> notification_; | 41 std::unique_ptr<Notification> notification_; |
41 // The Profile instance associated with the notification_. We need to cache | 42 // The Profile instance associated with the notification_. We need to cache |
42 // the instance here because when we want to cancel the notification we need | 43 // the instance here because when we want to cancel the notification we need |
43 // to provide the profile which was used to add the notification previously. | 44 // to provide the profile which was used to add the notification previously. |
44 // Not owned by this class. | 45 // Not owned by this class. |
45 Profile* notification_profile_; | 46 Profile* notification_profile_; |
46 | 47 |
47 // Whether to suppress showing the notification for the rest of the session. | 48 // Whether to suppress showing the notification for the rest of the session. |
48 bool suppress_for_session_; | 49 bool suppress_for_session_; |
49 | 50 |
50 // Display a notification when quitting Chrome with hosted apps running? | 51 // Display a notification when quitting Chrome with hosted apps running? |
51 bool hosted_app_quit_notification_; | 52 bool hosted_app_quit_notification_; |
52 | 53 |
53 DISALLOW_COPY_AND_ASSIGN(QuitWithAppsController); | 54 DISALLOW_COPY_AND_ASSIGN(QuitWithAppsController); |
54 }; | 55 }; |
55 | 56 |
56 #endif // CHROME_BROWSER_UI_COCOA_APPS_QUIT_WITH_APPS_CONTROLLER_MAC_H_ | 57 #endif // CHROME_BROWSER_UI_COCOA_APPS_QUIT_WITH_APPS_CONTROLLER_MAC_H_ |
OLD | NEW |