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

Side by Side Diff: chrome/browser/chromeos/status/data_promo_notification.cc

Issue 11570009: Split PrefService into PrefService, PrefServiceSimple and PrefServiceSyncable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to head again, previous had unrelated broken win_rel test. Created 8 years 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 | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698