1 // Copyright 2015 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.
5 #ifndef CHROME_BROWSER_DOWNLOAD_NOTIFICATION_DOWNLOAD_GROUP_NOTIFICATION_H_
6 #define CHROME_BROWSER_DOWNLOAD_NOTIFICATION_DOWNLOAD_GROUP_NOTIFICATION_H_
10 #include "chrome/browser/download/notification/download_notification.h"
11 #include "chrome/browser/notifications/notification.h"
12 #include "chrome/browser/profiles/profile.h"
13 #include "content/public/browser/download_item.h"
15 class DownloadNotificationManagerForProfile
;
17 class DownloadGroupNotification
: public DownloadNotification
{
19 DownloadGroupNotification(
20 Profile
* profile
, DownloadNotificationManagerForProfile
* manager
);
21 ~DownloadGroupNotification() override
;
24 void OnDownloadAdded(content::DownloadItem
* download
);
26 // Methods called from NotificationWatcher.
27 void OnDownloadUpdated(content::DownloadItem
* download
) override
;
28 void OnDownloadRemoved(content::DownloadItem
* download
) override
;
29 void OnNotificationClose() override
;
30 void OnNotificationClick() override
;
31 void OnNotificationButtonClick(int button_index
) override
;
32 std::string
GetNotificationId() const override
;
34 bool visible() const { return visible_
; }
38 void UpdateNotificationData();
45 Profile
* profile_
= nullptr;
46 // Flag to show the notification on the next update.
47 bool show_next_
= false;
48 // Hides the notification on the next udpate.
49 bool hide_next_
= false;
50 // Current vilibility status of the notification.
51 bool visible_
= false;
53 scoped_ptr
<Notification
> notification_
;
54 std::set
<content::DownloadItem
*> items_
;
56 DISALLOW_COPY_AND_ASSIGN(DownloadGroupNotification
);
59 #endif // CHROME_BROWSER_DOWNLOAD_NOTIFICATION_DOWNLOAD_GROUP_NOTIFICATION_H_