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

Side by Side Diff: chrome/browser/ui/cocoa/apps/quit_with_apps_controller_mac.h

Issue 580243004: Remove unnecessary image downloading handler of notifications. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: build fix of desktop linux/win Created 6 years, 2 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
OLDNEW
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 class Profile; 13 class Profile;
14 14
15 // QuitWithAppsController checks whether any apps are running and shows a 15 // QuitWithAppsController checks whether any apps are running and shows a
16 // notification to quit all of them. 16 // notification to quit all of them.
17 class QuitWithAppsController : public NotificationDelegate { 17 class QuitWithAppsController : public NotificationDelegate {
18 public: 18 public:
19 static const char kQuitWithAppsNotificationID[]; 19 static const char kQuitWithAppsNotificationID[];
20 20
21 QuitWithAppsController(); 21 QuitWithAppsController();
22 22
23 // NotificationDelegate interface. 23 // NotificationDelegate interface.
24 virtual void Display() override; 24 virtual void Display() override;
25 virtual void Error() override; 25 virtual void Error() override;
26 virtual void Close(bool by_user) override; 26 virtual void Close(bool by_user) override;
27 virtual void Click() override; 27 virtual void Click() override;
28 virtual void ButtonClick(int button_index) override; 28 virtual void ButtonClick(int button_index) override;
29 virtual content::WebContents* GetWebContents() const override;
30 virtual std::string id() const override; 29 virtual std::string id() const override;
31 30
32 // 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
33 // if there are apps running. 32 // if there are apps running.
34 bool ShouldQuit(); 33 bool ShouldQuit();
35 34
36 // Register prefs used by QuitWithAppsController. 35 // Register prefs used by QuitWithAppsController.
37 static void RegisterPrefs(PrefRegistrySimple* registry); 36 static void RegisterPrefs(PrefRegistrySimple* registry);
38 37
39 private: 38 private:
40 virtual ~QuitWithAppsController(); 39 virtual ~QuitWithAppsController();
41 40
42 scoped_ptr<Notification> notification_; 41 scoped_ptr<Notification> notification_;
43 // The Profile instance associated with the notification_. We need to cache 42 // The Profile instance associated with the notification_. We need to cache
44 // 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
45 // 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.
46 // Not owned by this class. 45 // Not owned by this class.
47 Profile* notification_profile_; 46 Profile* notification_profile_;
48 47
49 // 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.
50 bool suppress_for_session_; 49 bool suppress_for_session_;
51 50
52 DISALLOW_COPY_AND_ASSIGN(QuitWithAppsController); 51 DISALLOW_COPY_AND_ASSIGN(QuitWithAppsController);
53 }; 52 };
54 53
55 #endif // CHROME_BROWSER_UI_COCOA_APPS_QUIT_WITH_APPS_CONTROLLER_MAC_H_ 54 #endif // CHROME_BROWSER_UI_COCOA_APPS_QUIT_WITH_APPS_CONTROLLER_MAC_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/ash/screenshot_taker.cc ('k') | chrome/browser/ui/cocoa/apps/quit_with_apps_controller_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698