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 3// found in the LICENSE file. 4 5#ifndef CHROME_BROWSER_CHROMEOS_STATUS_DATA_PROMO_NOTIFICATION_H_ 6#define CHROME_BROWSER_CHROMEOS_STATUS_DATA_PROMO_NOTIFICATION_H_ 7 8#include "base/basictypes.h" 9#include "base/memory/weak_ptr.h" 10#include "chromeos/network/network_state_handler_observer.h" 11 12class PrefRegistrySimple; 13 14namespace views { 15class View; 16} 17 18namespace chromeos { 19 20// This class is responsible for triggering cellular network related 21// notifications, specifically: 22// * "Chrome will use mobile data..." when Cellular is the Default network 23// for the first time. 24// * Data Promotion notifications when available / appropriate. 25class DataPromoNotification : public NetworkStateHandlerObserver { 26 public: 27 DataPromoNotification(); 28 virtual ~DataPromoNotification(); 29 30 static void RegisterPrefs(PrefRegistrySimple* registry); 31 32 private: 33 // NetworkStateHandlerObserver 34 virtual void NetworkPropertiesUpdated(const NetworkState* network) OVERRIDE; 35 virtual void DefaultNetworkChanged(const NetworkState* network) OVERRIDE; 36 37 // Shows 3G promo notification if needed. 38 void ShowOptionalMobileDataPromoNotification(); 39 40 // True if check for promo needs to be done, otherwise ignore it for the 41 // current session. 42 bool check_for_promo_; 43 44 // Factory for delaying showing promo notification. 45 base::WeakPtrFactory<DataPromoNotification> weak_ptr_factory_; 46 47 DISALLOW_COPY_AND_ASSIGN(DataPromoNotification); 48}; 49 50} // namespace chromeos 51 52#endif // CHROME_BROWSER_CHROMEOS_STATUS_DATA_PROMO_NOTIFICATION_H_ 53