| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_ANDROID_NTP_CONTENT_SUGGESTIONS_NOTIFICATION_HELPER_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_NTP_CONTENT_SUGGESTIONS_NOTIFICATION_HELPER_H_ |
| 6 #define CHROME_BROWSER_ANDROID_NTP_CONTENT_SUGGESTIONS_NOTIFICATION_HELPER_H_ | 6 #define CHROME_BROWSER_ANDROID_NTP_CONTENT_SUGGESTIONS_NOTIFICATION_HELPER_H_ |
| 7 | 7 |
| 8 #include <jni.h> |
| 8 #include <string> | 9 #include <string> |
| 9 | 10 |
| 10 #include "base/macros.h" | 11 #include "base/macros.h" |
| 11 #include "base/strings/string16.h" | 12 #include "base/strings/string16.h" |
| 12 #include "base/time/time.h" | 13 #include "base/time/time.h" |
| 13 #include "url/gurl.h" | 14 #include "url/gurl.h" |
| 14 | 15 |
| 16 class Profile; |
| 17 |
| 15 namespace gfx { | 18 namespace gfx { |
| 16 class Image; | 19 class Image; |
| 17 } // namespace gfx | 20 } // namespace gfx |
| 18 | 21 |
| 19 namespace ntp_snippets { | 22 namespace ntp_snippets { |
| 20 | 23 |
| 21 class ContentSuggestionsNotificationHelper { | 24 class ContentSuggestionsNotificationHelper { |
| 22 public: | 25 public: |
| 23 static void OpenURL(const GURL& url); | |
| 24 static void SendNotification(const GURL& url, | 26 static void SendNotification(const GURL& url, |
| 25 const base::string16& title, | 27 const base::string16& title, |
| 26 const base::string16& text, | 28 const base::string16& text, |
| 27 const gfx::Image& image, | 29 const gfx::Image& image, |
| 28 base::Time timeout_at); | 30 base::Time timeout_at); |
| 29 static void HideAllNotifications(); | 31 static void HideAllNotifications(); |
| 30 | 32 |
| 33 // True if the user has ignored enough notifications that we no longer think |
| 34 // that the user is interested in them. |
| 35 static bool IsDisabledForProfile(Profile* profile); |
| 36 |
| 37 // Registers JNI methods. |
| 38 static bool Register(JNIEnv* env); |
| 39 |
| 31 private: | 40 private: |
| 32 DISALLOW_IMPLICIT_CONSTRUCTORS(ContentSuggestionsNotificationHelper); | 41 DISALLOW_IMPLICIT_CONSTRUCTORS(ContentSuggestionsNotificationHelper); |
| 33 }; | 42 }; |
| 34 | 43 |
| 35 } // namespace ntp_snippets | 44 } // namespace ntp_snippets |
| 36 | 45 |
| 37 #endif // CHROME_BROWSER_ANDROID_NTP_CONTENT_SUGGESTIONS_NOTIFICATION_HELPER_H_ | 46 #endif // CHROME_BROWSER_ANDROID_NTP_CONTENT_SUGGESTIONS_NOTIFICATION_HELPER_H_ |
| OLD | NEW |