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 <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
11 #include "base/guid.h" | 11 #include "base/guid.h" |
12 #include "base/lazy_instance.h" | 12 #include "base/lazy_instance.h" |
13 #include "base/location.h" | 13 #include "base/location.h" |
14 #include "base/macros.h" | 14 #include "base/macros.h" |
15 #include "base/single_thread_task_runner.h" | 15 #include "base/single_thread_task_runner.h" |
16 #include "base/strings/utf_string_conversions.h" | 16 #include "base/strings/utf_string_conversions.h" |
17 #include "base/thread_task_runner_handle.h" | 17 #include "base/threading/thread_task_runner_handle.h" |
18 #include "chrome/browser/browser_process.h" | 18 #include "chrome/browser/browser_process.h" |
19 #include "chrome/browser/notifications/notification.h" | 19 #include "chrome/browser/notifications/notification.h" |
20 #include "chrome/browser/prefs/pref_service_syncable_util.h" | 20 #include "chrome/browser/prefs/pref_service_syncable_util.h" |
21 #include "chrome/browser/profiles/profile.h" | 21 #include "chrome/browser/profiles/profile.h" |
22 #include "chrome/browser/ui/browser_navigator.h" | 22 #include "chrome/browser/ui/browser_navigator.h" |
23 #include "chrome/browser/ui/browser_navigator_params.h" | 23 #include "chrome/browser/ui/browser_navigator_params.h" |
24 #include "chrome/common/pref_names.h" | 24 #include "chrome/common/pref_names.h" |
25 #include "chrome/common/url_constants.h" | 25 #include "chrome/common/url_constants.h" |
26 #include "chrome/grit/generated_resources.h" | 26 #include "chrome/grit/generated_resources.h" |
27 #include "components/pref_registry/pref_registry_syncable.h" | 27 #include "components/pref_registry/pref_registry_syncable.h" |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 prefs::kWelcomeNotificationExpirationTimestamp, | 352 prefs::kWelcomeNotificationExpirationTimestamp, |
353 (delegate_->GetCurrentTime() + | 353 (delegate_->GetCurrentTime() + |
354 base::TimeDelta::FromDays(kRequestedShowTimeDays)).ToInternalValue()); | 354 base::TimeDelta::FromDays(kRequestedShowTimeDays)).ToInternalValue()); |
355 } | 355 } |
356 | 356 |
357 bool ExtensionWelcomeNotification::IsWelcomeNotificationExpired() const { | 357 bool ExtensionWelcomeNotification::IsWelcomeNotificationExpired() const { |
358 const base::Time expiration_timestamp = GetExpirationTimestamp(); | 358 const base::Time expiration_timestamp = GetExpirationTimestamp(); |
359 return !expiration_timestamp.is_null() && | 359 return !expiration_timestamp.is_null() && |
360 (expiration_timestamp <= delegate_->GetCurrentTime()); | 360 (expiration_timestamp <= delegate_->GetCurrentTime()); |
361 } | 361 } |
OLD | NEW |