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

Side by Side Diff: chrome/browser/notifications/extension_welcome_notification.cc

Issue 1658793002: Update chrome for new prefs location. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 unified diff | Download patch
OLDNEW
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/prefs/pref_service.h"
16 #include "base/single_thread_task_runner.h" 15 #include "base/single_thread_task_runner.h"
17 #include "base/strings/utf_string_conversions.h" 16 #include "base/strings/utf_string_conversions.h"
18 #include "base/thread_task_runner_handle.h" 17 #include "base/thread_task_runner_handle.h"
19 #include "chrome/browser/browser_process.h" 18 #include "chrome/browser/browser_process.h"
20 #include "chrome/browser/notifications/notification.h" 19 #include "chrome/browser/notifications/notification.h"
21 #include "chrome/browser/prefs/pref_service_syncable_util.h" 20 #include "chrome/browser/prefs/pref_service_syncable_util.h"
22 #include "chrome/browser/profiles/profile.h" 21 #include "chrome/browser/profiles/profile.h"
23 #include "chrome/browser/ui/browser_navigator.h" 22 #include "chrome/browser/ui/browser_navigator.h"
24 #include "chrome/browser/ui/browser_navigator_params.h" 23 #include "chrome/browser/ui/browser_navigator_params.h"
25 #include "chrome/common/pref_names.h" 24 #include "chrome/common/pref_names.h"
26 #include "chrome/common/url_constants.h" 25 #include "chrome/common/url_constants.h"
27 #include "chrome/grit/generated_resources.h" 26 #include "chrome/grit/generated_resources.h"
28 #include "components/pref_registry/pref_registry_syncable.h" 27 #include "components/pref_registry/pref_registry_syncable.h"
28 #include "components/prefs/pref_service.h"
29 #include "components/syncable_prefs/pref_service_syncable.h" 29 #include "components/syncable_prefs/pref_service_syncable.h"
30 #include "grit/theme_resources.h" 30 #include "grit/theme_resources.h"
31 #include "ui/base/l10n/l10n_util.h" 31 #include "ui/base/l10n/l10n_util.h"
32 #include "ui/base/resource/resource_bundle.h" 32 #include "ui/base/resource/resource_bundle.h"
33 #include "ui/message_center/message_center.h" 33 #include "ui/message_center/message_center.h"
34 #include "ui/message_center/notification.h" 34 #include "ui/message_center/notification.h"
35 #include "ui/message_center/notification_delegate.h" 35 #include "ui/message_center/notification_delegate.h"
36 #include "ui/message_center/notification_types.h" 36 #include "ui/message_center/notification_types.h"
37 37
38 const int ExtensionWelcomeNotification::kRequestedShowTimeDays = 14; 38 const int ExtensionWelcomeNotification::kRequestedShowTimeDays = 14;
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698