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