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_NOTIFICATION_H_
6 #define CHROME_BROWSER_DOWNLOAD_NOTIFICATION_DOWNLOAD_NOTIFICATION_H_
8 #include "base/strings/string_number_conversions.h"
9 #include "chrome/browser/download/download_commands.h"
10 #include "chrome/browser/notifications/notification.h"
11 #include "chrome/browser/notifications/notification_delegate.h"
12 #include "chrome/browser/notifications/notification_test_util.h"
13 #include "content/public/browser/download_item.h"
14 #include "grit/theme_resources.h"
15 #include "ui/message_center/message_center.h"
16 #include "ui/message_center/message_center_observer.h"
19 class DownloadItemNotificationTest
;
22 class DownloadNotificationManagerForProfile
;
24 class DownloadNotification
{
26 DownloadNotification();
27 virtual ~DownloadNotification();
29 static const char kDownloadNotificationOrigin
[];
31 virtual void OnDownloadUpdated(content::DownloadItem
* item
) = 0;
32 virtual void OnDownloadRemoved(content::DownloadItem
* item
) = 0;
34 virtual bool HasNotificationClickedListener();
35 virtual void OnNotificationClose() {}
36 virtual void OnNotificationClick() {}
37 virtual void OnNotificationButtonClick(int button_index
) {}
38 virtual std::string
GetNotificationId() const = 0;
40 // This method may break a layout of notification center. See the comment in
41 // message_center::MessageCenter::ForceNotificationFlush() for detail.
42 void InvokeUnsafeForceNotificationFlush(
43 message_center::MessageCenter
* message_center
, const std::string
& id
);
46 NotificationDelegate
* watcher() const;
49 scoped_refptr
<NotificationDelegate
> watcher_
;
51 DISALLOW_COPY_AND_ASSIGN(DownloadNotification
);
54 #endif // CHROME_BROWSER_DOWNLOAD_NOTIFICATION_DOWNLOAD_NOTIFICATION_H_