Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2220)

Unified Diff: chrome/browser/chromeos/hats/hats_notification_controller.h

Issue 2103293003: Checks the age of device before initializing HaTS Notification (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Checks the age of device before initializing HaTS Notification Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/hats/hats_notification_controller.h
diff --git a/chrome/browser/chromeos/hats/hats_notification_controller.h b/chrome/browser/chromeos/hats/hats_notification_controller.h
index 95b75d66f47de3bb349ee554ce9468d41d4d64e1..0247620aa8777387852d0182fc456fbb58a86c87 100644
--- a/chrome/browser/chromeos/hats/hats_notification_controller.h
+++ b/chrome/browser/chromeos/hats/hats_notification_controller.h
@@ -6,6 +6,7 @@
#define CHROME_BROWSER_CHROMEOS_HATS_HATS_NOTIFICATION_CONTROLLER_H_
#include "base/macros.h"
+#include "base/memory/weak_ptr.h"
#include "base/time/time.h"
#include "chrome/browser/notifications/notification.h"
#include "chrome/browser/notifications/notification_delegate.h"
@@ -24,6 +25,9 @@ class HatsNotificationController : public NotificationDelegate,
// Minimum amount of time before the notification is displayed again after a
// user has interacted with it.
static const base::TimeDelta kHatsThresholdTime;
+ // Minimum amount of time after initial login or oobe after which we can show
+ // the HaTS notification.
+ static const base::TimeDelta kHatsNewDeviceThresholdTime;
static const char kDelegateId[];
static const char kNotificationId[];
stevenjb 2016/06/29 23:35:55 Any of these that are not used outside of hats_not
malaykeshav 2016/06/30 01:30:16 These are used in the unittests. Would have to mov
@@ -36,6 +40,7 @@ class HatsNotificationController : public NotificationDelegate,
~HatsNotificationController() override;
// NotificationDelegate overrides:
+ void Initialize(bool is_new_device);
void ButtonClick(int button_index) override;
void Close(bool by_user) override;
std::string id() const override;
@@ -49,6 +54,7 @@ class HatsNotificationController : public NotificationDelegate,
void UpdateLastInteractionTime();
Profile* profile_;
+ base::WeakPtrFactory<HatsNotificationController> weak_pointer_factory_;
DISALLOW_COPY_AND_ASSIGN(HatsNotificationController);
};

Powered by Google App Engine
This is Rietveld 408576698