• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
3 // found in the LICENSE file.
4 
5 #ifndef CHROME_BROWSER_NOTIFICATIONS_SYNC_NOTIFIER_WELCOME_DELEGATE_H_
6 #define CHROME_BROWSER_NOTIFICATIONS_SYNC_NOTIFIER_WELCOME_DELEGATE_H_
7 
8 #include "chrome/browser/notifications/notification_delegate.h"
9 #include "ui/message_center/notifier_settings.h"
10 
11 class Profile;
12 
13 namespace notifier {
14 
15 // A class that can handle user actions for per-service welcome notifications.
16 // The main action will be ButtonClick which will be used to disable the
17 // service.
18 class WelcomeDelegate : public NotificationDelegate {
19  public:
20   explicit WelcomeDelegate(const std::string& notification_id,
21                            Profile* profile,
22                            const message_center::NotifierId notifier_id,
23                            const GURL& on_click_link);
24 
25   // NotificationDelegate interface.
26   virtual void Display() OVERRIDE;
27   virtual void Error() OVERRIDE;
28   virtual void Close(bool by_user) OVERRIDE;
29   virtual void Click() OVERRIDE;
30   virtual bool HasClickedListener() OVERRIDE;
31   virtual void ButtonClick(int button_index) OVERRIDE;
32   virtual content::WebContents* GetWebContents() const OVERRIDE;
33   virtual std::string id() const OVERRIDE;
34 
35  private:
36   virtual ~WelcomeDelegate();
37 
38   const std::string notification_id_;
39   Profile* profile_;  // Weak.
40   const message_center::NotifierId notifier_id_;
41   GURL on_click_link_;
42 
43   DISALLOW_COPY_AND_ASSIGN(WelcomeDelegate);
44 };
45 
46 }  // namespace notifier
47 
48 #endif  // CHROME_BROWSER_NOTIFICATIONS_SYNC_NOTIFIER_WELCOME_DELEGATE_H_
49