| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/chromeos/status/data_promo_notification.h" | 5 #include "chrome/browser/chromeos/status/data_promo_notification.h" |
| 6 | 6 |
| 7 #include "ash/system/chromeos/network/network_connect.h" | 7 #include "ash/system/chromeos/network/network_connect.h" |
| 8 #include "ash/system/system_notifier.h" | 8 #include "ash/system/system_notifier.h" |
| 9 #include "base/prefs/pref_registry_simple.h" | 9 #include "base/prefs/pref_registry_simple.h" |
| 10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 #include "ui/base/resource/resource_bundle.h" | 33 #include "ui/base/resource/resource_bundle.h" |
| 34 #include "ui/message_center/message_center.h" | 34 #include "ui/message_center/message_center.h" |
| 35 #include "ui/message_center/notification.h" | 35 #include "ui/message_center/notification.h" |
| 36 #include "ui/views/view.h" | 36 #include "ui/views/view.h" |
| 37 #include "ui/views/widget/widget.h" | 37 #include "ui/views/widget/widget.h" |
| 38 | 38 |
| 39 namespace chromeos { | 39 namespace chromeos { |
| 40 | 40 |
| 41 namespace { | 41 namespace { |
| 42 | 42 |
| 43 // Time in milliseconds to delay showing of promo | |
| 44 // notification when Chrome window is not on screen. | |
| 45 const int kPromoShowDelayMs = 10000; | |
| 46 | |
| 47 const int kNotificationCountPrefDefault = -1; | 43 const int kNotificationCountPrefDefault = -1; |
| 48 | 44 |
| 49 bool GetBooleanPref(const char* pref_name) { | 45 bool GetBooleanPref(const char* pref_name) { |
| 50 Profile* profile = ProfileManager::GetDefaultProfileOrOffTheRecord(); | 46 Profile* profile = ProfileManager::GetDefaultProfileOrOffTheRecord(); |
| 51 PrefService* prefs = profile->GetPrefs(); | 47 PrefService* prefs = profile->GetPrefs(); |
| 52 return prefs->GetBoolean(pref_name); | 48 return prefs->GetBoolean(pref_name); |
| 53 } | 49 } |
| 54 | 50 |
| 55 int GetIntegerLocalPref(const char* pref_name) { | 51 int GetIntegerLocalPref(const char* pref_name) { |
| 56 PrefService* prefs = g_browser_process->local_state(); | 52 PrefService* prefs = g_browser_process->local_state(); |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 base::Bind(&NotificationClicked, | 223 base::Bind(&NotificationClicked, |
| 228 default_network->path(), info_url))); | 224 default_network->path(), info_url))); |
| 229 | 225 |
| 230 check_for_promo_ = false; | 226 check_for_promo_ = false; |
| 231 SetShow3gPromoNotification(false); | 227 SetShow3gPromoNotification(false); |
| 232 if (carrier_deal_promo_pref != kNotificationCountPrefDefault) | 228 if (carrier_deal_promo_pref != kNotificationCountPrefDefault) |
| 233 SetCarrierDealPromoShown(carrier_deal_promo_pref + 1); | 229 SetCarrierDealPromoShown(carrier_deal_promo_pref + 1); |
| 234 } | 230 } |
| 235 | 231 |
| 236 } // namespace chromeos | 232 } // namespace chromeos |
| OLD | NEW |