| 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/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/shell_window_ids.h" | 8 #include "ash/shell_window_ids.h" |
| 9 #include "ash/system/chromeos/network/network_observer.h" | 9 #include "ash/system/chromeos/network/network_observer.h" |
| 10 #include "ash/system/tray/system_tray.h" | 10 #include "ash/system/tray/system_tray.h" |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 | 120 |
| 121 DataPromoNotification::DataPromoNotification() | 121 DataPromoNotification::DataPromoNotification() |
| 122 : check_for_promo_(true), | 122 : check_for_promo_(true), |
| 123 ALLOW_THIS_IN_INITIALIZER_LIST(weak_ptr_factory_(this)) { | 123 ALLOW_THIS_IN_INITIALIZER_LIST(weak_ptr_factory_(this)) { |
| 124 } | 124 } |
| 125 | 125 |
| 126 DataPromoNotification::~DataPromoNotification() { | 126 DataPromoNotification::~DataPromoNotification() { |
| 127 CloseNotification(); | 127 CloseNotification(); |
| 128 } | 128 } |
| 129 | 129 |
| 130 void DataPromoNotification::RegisterPrefs(PrefService* local_state) { | 130 void DataPromoNotification::RegisterPrefs(PrefServiceSimple* local_state) { |
| 131 // Carrier deal notification shown count defaults to 0. | 131 // Carrier deal notification shown count defaults to 0. |
| 132 local_state->RegisterIntegerPref(prefs::kCarrierDealPromoShown, 0); | 132 local_state->RegisterIntegerPref(prefs::kCarrierDealPromoShown, 0); |
| 133 } | 133 } |
| 134 | 134 |
| 135 void DataPromoNotification::ShowOptionalMobileDataPromoNotification( | 135 void DataPromoNotification::ShowOptionalMobileDataPromoNotification( |
| 136 NetworkLibrary* cros, | 136 NetworkLibrary* cros, |
| 137 views::View* host, | 137 views::View* host, |
| 138 ash::NetworkTrayDelegate* listener) { | 138 ash::NetworkTrayDelegate* listener) { |
| 139 // Display one-time notification for non-Guest users on first use | 139 // Display one-time notification for non-Guest users on first use |
| 140 // of Mobile Data connection or if there's a carrier deal defined | 140 // of Mobile Data connection or if there's a carrier deal defined |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 SetCarrierDealPromoShown(carrier_deal_promo_pref + 1); | 212 SetCarrierDealPromoShown(carrier_deal_promo_pref + 1); |
| 213 } | 213 } |
| 214 } | 214 } |
| 215 | 215 |
| 216 void DataPromoNotification::CloseNotification() { | 216 void DataPromoNotification::CloseNotification() { |
| 217 ash::Shell::GetInstance()->system_tray_notifier()->NotifyClearNetworkMessage( | 217 ash::Shell::GetInstance()->system_tray_notifier()->NotifyClearNetworkMessage( |
| 218 ash::NetworkObserver::MESSAGE_DATA_PROMO); | 218 ash::NetworkObserver::MESSAGE_DATA_PROMO); |
| 219 } | 219 } |
| 220 | 220 |
| 221 } // namespace chromeos | 221 } // namespace chromeos |
| OLD | NEW |