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

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

Issue 11312139: Add SystemTrayObservers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add comment. Created 8 years, 1 month 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"
11 #include "ash/system/tray/system_tray_notifier.h"
11 #include "base/utf_string_conversions.h" 12 #include "base/utf_string_conversions.h"
12 #include "chrome/browser/browser_process.h" 13 #include "chrome/browser/browser_process.h"
13 #include "chrome/browser/chromeos/cros/cros_library.h" 14 #include "chrome/browser/chromeos/cros/cros_library.h"
14 #include "chrome/browser/chromeos/cros/network_library.h" 15 #include "chrome/browser/chromeos/cros/network_library.h"
15 #include "chrome/browser/chromeos/login/helper.h" 16 #include "chrome/browser/chromeos/login/helper.h"
16 #include "chrome/browser/chromeos/login/user_manager.h" 17 #include "chrome/browser/chromeos/login/user_manager.h"
17 #include "chrome/browser/chromeos/mobile_config.h" 18 #include "chrome/browser/chromeos/mobile_config.h"
18 #include "chrome/browser/prefs/pref_service.h" 19 #include "chrome/browser/prefs/pref_service.h"
19 #include "chrome/browser/profiles/profile.h" 20 #include "chrome/browser/profiles/profile.h"
20 #include "chrome/browser/profiles/profile_manager.h" 21 #include "chrome/browser/profiles/profile_manager.h"
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 int link_message_id; 196 int link_message_id;
196 if (deal_topup_url_.empty()) 197 if (deal_topup_url_.empty())
197 link_message_id = IDS_OFFLINE_NETWORK_SETTINGS; 198 link_message_id = IDS_OFFLINE_NETWORK_SETTINGS;
198 else 199 else
199 link_message_id = IDS_STATUSBAR_NETWORK_VIEW_ACCOUNT; 200 link_message_id = IDS_STATUSBAR_NETWORK_VIEW_ACCOUNT;
200 201
201 std::vector<string16> links; 202 std::vector<string16> links;
202 links.push_back(l10n_util::GetStringUTF16(link_message_id)); 203 links.push_back(l10n_util::GetStringUTF16(link_message_id));
203 if (!deal_info_url_.empty()) 204 if (!deal_info_url_.empty())
204 links.push_back(l10n_util::GetStringUTF16(IDS_LEARN_MORE)); 205 links.push_back(l10n_util::GetStringUTF16(IDS_LEARN_MORE));
205 if (ash::Shell::GetInstance()->system_tray()->network_observer()) { 206 ash::Shell::GetInstance()->system_tray_notifier()->NotifySetNetworkMessage(
206 ash::Shell::GetInstance()->system_tray()->network_observer()-> 207 listener, ash::NetworkObserver::MESSAGE_DATA_PROMO,
207 SetNetworkMessage(listener, ash::NetworkObserver::MESSAGE_DATA_PROMO, 208 string16(), message, links);
208 string16(), message, links);
209 }
210
211 check_for_promo_ = false; 209 check_for_promo_ = false;
212 SetShow3gPromoNotification(false); 210 SetShow3gPromoNotification(false);
213 if (carrier_deal_promo_pref != kNotificationCountPrefDefault) 211 if (carrier_deal_promo_pref != kNotificationCountPrefDefault)
214 SetCarrierDealPromoShown(carrier_deal_promo_pref + 1); 212 SetCarrierDealPromoShown(carrier_deal_promo_pref + 1);
215 } 213 }
216 } 214 }
217 215
218 void DataPromoNotification::CloseNotification() { 216 void DataPromoNotification::CloseNotification() {
219 if (ash::Shell::GetInstance()->status_area_widget() && 217 ash::Shell::GetInstance()->system_tray_notifier()->NotifyClearNetworkMessage(
220 ash::Shell::GetInstance()->system_tray()->network_observer()) { 218 ash::NetworkObserver::MESSAGE_DATA_PROMO);
221 ash::Shell::GetInstance()->system_tray()->network_observer()->
222 ClearNetworkMessage(ash::NetworkObserver::MESSAGE_DATA_PROMO);
223 }
224 } 219 }
225 220
226 } // namespace chromeos 221 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/sms_observer.cc ('k') | chrome/browser/chromeos/system/ash_system_tray_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698