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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 if (NetworkHandler::Get()->network_connection_handler()-> | 180 if (NetworkHandler::Get()->network_connection_handler()-> |
181 HasPendingConnectRequest()) | 181 HasPendingConnectRequest()) |
182 return; | 182 return; |
183 | 183 |
184 int carrier_deal_promo_pref = kNotificationCountPrefDefault; | 184 int carrier_deal_promo_pref = kNotificationCountPrefDefault; |
185 const MobileConfig::CarrierDeal* deal = NULL; | 185 const MobileConfig::CarrierDeal* deal = NULL; |
186 const MobileConfig::Carrier* carrier = GetCarrier(default_network); | 186 const MobileConfig::Carrier* carrier = GetCarrier(default_network); |
187 if (carrier) | 187 if (carrier) |
188 deal = GetCarrierDeal(carrier); | 188 deal = GetCarrierDeal(carrier); |
189 | 189 |
190 string16 message = l10n_util::GetStringUTF16(IDS_3G_NOTIFICATION_MESSAGE); | 190 base::string16 message = l10n_util::GetStringUTF16(IDS_3G_NOTIFICATION_MESSAGE
); |
191 std::string info_url; | 191 std::string info_url; |
192 if (deal) { | 192 if (deal) { |
193 carrier_deal_promo_pref = GetCarrierDealPromoShown(); | 193 carrier_deal_promo_pref = GetCarrierDealPromoShown(); |
194 const std::string locale = g_browser_process->GetApplicationLocale(); | 194 const std::string locale = g_browser_process->GetApplicationLocale(); |
195 std::string deal_text = | 195 std::string deal_text = |
196 deal->GetLocalizedString(locale, "notification_text"); | 196 deal->GetLocalizedString(locale, "notification_text"); |
197 message = UTF8ToUTF16(deal_text + "\n\n") + message; | 197 message = UTF8ToUTF16(deal_text + "\n\n") + message; |
198 info_url = deal->info_url(); | 198 info_url = deal->info_url(); |
199 if (info_url.empty() && carrier) | 199 if (info_url.empty() && carrier) |
200 info_url = carrier->top_up_url(); | 200 info_url = carrier->top_up_url(); |
(...skipping 20 matching lines...) Expand all Loading... |
221 base::Bind(&NotificationClicked, | 221 base::Bind(&NotificationClicked, |
222 default_network->path(), info_url))); | 222 default_network->path(), info_url))); |
223 | 223 |
224 check_for_promo_ = false; | 224 check_for_promo_ = false; |
225 SetShow3gPromoNotification(false); | 225 SetShow3gPromoNotification(false); |
226 if (carrier_deal_promo_pref != kNotificationCountPrefDefault) | 226 if (carrier_deal_promo_pref != kNotificationCountPrefDefault) |
227 SetCarrierDealPromoShown(carrier_deal_promo_pref + 1); | 227 SetCarrierDealPromoShown(carrier_deal_promo_pref + 1); |
228 } | 228 } |
229 | 229 |
230 } // namespace chromeos | 230 } // namespace chromeos |
OLD | NEW |