| OLD | NEW |
| 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_CHROMEOS_NOTIFICATIONS_SYSTEM_NOTIFICATION_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_NOTIFICATIONS_SYSTEM_NOTIFICATION_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_NOTIFICATIONS_SYSTEM_NOTIFICATION_H_ | 6 #define CHROME_BROWSER_CHROMEOS_NOTIFICATIONS_SYSTEM_NOTIFICATION_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 13 #include "base/string16.h" | 13 #include "base/string16.h" |
| 14 #include "chrome/browser/chromeos/notifications/balloon_view_host_chromeos.h" /
/ MessageCallback | 14 #include "chrome/browser/chromeos/notifications/balloon_view_host_chromeos.h" /
/ MessageCallback |
| 15 #include "chrome/browser/notifications/notification_delegate.h" | 15 #include "chrome/browser/notifications/notification_delegate.h" |
| 16 #include "chromeos/dbus/power_manager_client.h" | 16 #include "chromeos/dbus/session_manager_client.h" |
| 17 #include "googleurl/src/gurl.h" | 17 #include "googleurl/src/gurl.h" |
| 18 | 18 |
| 19 class BalloonCollectionImplAsh; | 19 class BalloonCollectionImplAsh; |
| 20 class Notification; | 20 class Notification; |
| 21 class Profile; | 21 class Profile; |
| 22 | 22 |
| 23 namespace chromeos { | 23 namespace chromeos { |
| 24 | 24 |
| 25 // The system notification object handles the display of a system notification | 25 // The system notification object handles the display of a system notification |
| 26 | 26 |
| 27 class SystemNotification : public PowerManagerClient::Observer { | 27 class SystemNotification : public SessionManagerClient::Observer { |
| 28 public: | 28 public: |
| 29 // The profile is the current user profile. The id is any string used | 29 // The profile is the current user profile. The id is any string used |
| 30 // to uniquely identify this notification. The title is the title of | 30 // to uniquely identify this notification. The title is the title of |
| 31 // the message to be displayed. On creation, the message is hidden. | 31 // the message to be displayed. On creation, the message is hidden. |
| 32 SystemNotification(Profile* profile, | 32 SystemNotification(Profile* profile, |
| 33 const std::string& id, | 33 const std::string& id, |
| 34 int icon_resource_id, | 34 int icon_resource_id, |
| 35 const string16& title); | 35 const string16& title); |
| 36 | 36 |
| 37 // Allows to provide custom NotificationDelegate. | 37 // Allows to provide custom NotificationDelegate. |
| 38 SystemNotification(Profile* profile, | 38 SystemNotification(Profile* profile, |
| 39 NotificationDelegate* delegate, | 39 NotificationDelegate* delegate, |
| 40 int icon_resource_id, | 40 int icon_resource_id, |
| 41 const string16& title); | 41 const string16& title); |
| 42 | 42 |
| 43 virtual ~SystemNotification(); | 43 virtual ~SystemNotification(); |
| 44 | 44 |
| 45 // PowerManagerClient::Observer override. | 45 // SessionManagerClient::Observer override. |
| 46 virtual void UnlockScreen() OVERRIDE; | 46 virtual void UnlockScreen() OVERRIDE; |
| 47 | 47 |
| 48 void set_title(const string16& title) { title_ = title; } | 48 void set_title(const string16& title) { title_ = title; } |
| 49 | 49 |
| 50 // Show will show or update the message for this notification | 50 // Show will show or update the message for this notification |
| 51 // on a transition to urgent, the notification will be shown if it was | 51 // on a transition to urgent, the notification will be shown if it was |
| 52 // previously hidden or minimized by the user. | 52 // previously hidden or minimized by the user. |
| 53 void Show(const string16& message, bool urgent, bool sticky); | 53 void Show(const string16& message, bool urgent, bool sticky); |
| 54 | 54 |
| 55 // Same as Show() above with a footer link at the bottom and a callback | 55 // Same as Show() above with a footer link at the bottom and a callback |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 bool sticky_; | 103 bool sticky_; |
| 104 bool urgent_; | 104 bool urgent_; |
| 105 bool show_on_unlock_; | 105 bool show_on_unlock_; |
| 106 | 106 |
| 107 DISALLOW_COPY_AND_ASSIGN(SystemNotification); | 107 DISALLOW_COPY_AND_ASSIGN(SystemNotification); |
| 108 }; | 108 }; |
| 109 | 109 |
| 110 } // namespace chromeos | 110 } // namespace chromeos |
| 111 | 111 |
| 112 #endif // CHROME_BROWSER_CHROMEOS_NOTIFICATIONS_SYSTEM_NOTIFICATION_H_ | 112 #endif // CHROME_BROWSER_CHROMEOS_NOTIFICATIONS_SYSTEM_NOTIFICATION_H_ |
| OLD | NEW |