Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / browser / chromeos / status / data_promo_notification.h
blob88a58fd4ba4ba5c03a7a3771536614dedbfb37f2
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.
5 #ifndef CHROME_BROWSER_CHROMEOS_STATUS_DATA_PROMO_NOTIFICATION_H_
6 #define CHROME_BROWSER_CHROMEOS_STATUS_DATA_PROMO_NOTIFICATION_H_
8 #include "base/basictypes.h"
9 #include "base/memory/weak_ptr.h"
10 #include "chromeos/network/network_state_handler_observer.h"
12 class PrefRegistrySimple;
14 namespace views {
15 class View;
18 namespace chromeos {
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.
25 class DataPromoNotification : public NetworkStateHandlerObserver {
26 public:
27 DataPromoNotification();
28 ~DataPromoNotification() override;
30 static void RegisterPrefs(PrefRegistrySimple* registry);
32 private:
33 // NetworkStateHandlerObserver
34 void NetworkPropertiesUpdated(const NetworkState* network) override;
35 void DefaultNetworkChanged(const NetworkState* network) override;
37 // Shows 3G promo notification if needed.
38 void ShowOptionalMobileDataPromoNotification();
40 // Show notification prompting user to install Data Saver extension.
41 bool ShowDataSaverNotification();
43 // True if we've shown notifications during this session, or won't need to.
44 bool notifications_shown_;
46 // Factory for delaying showing promo notification.
47 base::WeakPtrFactory<DataPromoNotification> weak_ptr_factory_;
49 DISALLOW_COPY_AND_ASSIGN(DataPromoNotification);
52 } // namespace chromeos
54 #endif // CHROME_BROWSER_CHROMEOS_STATUS_DATA_PROMO_NOTIFICATION_H_