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 #include "chrome/browser/notifications/extension_welcome_notification.h" | 5 #include "chrome/browser/notifications/extension_welcome_notification.h" |
6 | 6 |
7 #include "base/guid.h" | 7 #include "base/guid.h" |
8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
11 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
12 #include "chrome/browser/browser_process.h" | 12 #include "chrome/browser/browser_process.h" |
13 #include "chrome/browser/notifications/notification.h" | 13 #include "chrome/browser/notifications/notification.h" |
14 #include "chrome/browser/prefs/pref_service_syncable.h" | 14 #include "chrome/browser/prefs/pref_service_syncable.h" |
15 #include "chrome/browser/profiles/profile.h" | 15 #include "chrome/browser/profiles/profile.h" |
16 #include "chrome/browser/ui/browser_navigator.h" | 16 #include "chrome/browser/ui/browser_navigator.h" |
17 #include "chrome/common/pref_names.h" | 17 #include "chrome/common/pref_names.h" |
18 #include "chrome/common/url_constants.h" | 18 #include "chrome/common/url_constants.h" |
19 #include "components/user_prefs/pref_registry_syncable.h" | 19 #include "components/pref_registry/pref_registry_syncable.h" |
20 #include "grit/generated_resources.h" | 20 #include "grit/generated_resources.h" |
21 #include "grit/theme_resources.h" | 21 #include "grit/theme_resources.h" |
22 #include "ui/base/l10n/l10n_util.h" | 22 #include "ui/base/l10n/l10n_util.h" |
23 #include "ui/base/resource/resource_bundle.h" | 23 #include "ui/base/resource/resource_bundle.h" |
24 #include "ui/message_center/message_center.h" | 24 #include "ui/message_center/message_center.h" |
25 #include "ui/message_center/notification.h" | 25 #include "ui/message_center/notification.h" |
26 #include "ui/message_center/notification_delegate.h" | 26 #include "ui/message_center/notification_delegate.h" |
27 #include "ui/message_center/notification_types.h" | 27 #include "ui/message_center/notification_types.h" |
28 | 28 |
29 const int ExtensionWelcomeNotification::kRequestedShowTimeDays = 14; | 29 const int ExtensionWelcomeNotification::kRequestedShowTimeDays = 14; |
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 prefs::kWelcomeNotificationExpirationTimestamp, | 359 prefs::kWelcomeNotificationExpirationTimestamp, |
360 (delegate_->GetCurrentTime() + | 360 (delegate_->GetCurrentTime() + |
361 base::TimeDelta::FromDays(kRequestedShowTimeDays)).ToInternalValue()); | 361 base::TimeDelta::FromDays(kRequestedShowTimeDays)).ToInternalValue()); |
362 } | 362 } |
363 | 363 |
364 bool ExtensionWelcomeNotification::IsWelcomeNotificationExpired() const { | 364 bool ExtensionWelcomeNotification::IsWelcomeNotificationExpired() const { |
365 const base::Time expiration_timestamp = GetExpirationTimestamp(); | 365 const base::Time expiration_timestamp = GetExpirationTimestamp(); |
366 return !expiration_timestamp.is_null() && | 366 return !expiration_timestamp.is_null() && |
367 (expiration_timestamp <= delegate_->GetCurrentTime()); | 367 (expiration_timestamp <= delegate_->GetCurrentTime()); |
368 } | 368 } |
OLD | NEW |