| 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 #ifndef CHROME_BROWSER_CHROMEOS_STATUS_DATA_PROMO_NOTIFICATION_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_STATUS_DATA_PROMO_NOTIFICATION_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_STATUS_DATA_PROMO_NOTIFICATION_H_ | 6 #define CHROME_BROWSER_CHROMEOS_STATUS_DATA_PROMO_NOTIFICATION_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "ui/views/widget/widget_observer.h" | |
| 11 | 10 |
| 12 class PrefService; | 11 class PrefService; |
| 13 | 12 |
| 13 namespace ash { |
| 14 class NetworkTrayDelegate; |
| 15 } |
| 16 |
| 14 namespace views { | 17 namespace views { |
| 15 class View; | 18 class View; |
| 16 } | 19 } |
| 17 | 20 |
| 18 namespace chromeos { | 21 namespace chromeos { |
| 19 class MessageBubble; | |
| 20 class MessageBubbleLinkListener; | |
| 21 class NetworkLibrary; | 22 class NetworkLibrary; |
| 22 | 23 |
| 23 class DataPromoNotification : public views::WidgetObserver { | 24 class DataPromoNotification { |
| 24 public: | 25 public: |
| 25 DataPromoNotification(); | 26 DataPromoNotification(); |
| 26 virtual ~DataPromoNotification(); | 27 virtual ~DataPromoNotification(); |
| 27 | 28 |
| 28 static void RegisterPrefs(PrefService* local_state); | 29 static void RegisterPrefs(PrefService* local_state); |
| 29 | 30 |
| 30 const std::string& deal_info_url() const { return deal_info_url_; } | 31 const std::string& deal_info_url() const { return deal_info_url_; } |
| 31 const std::string& deal_topup_url() const { return deal_topup_url_; } | 32 const std::string& deal_topup_url() const { return deal_topup_url_; } |
| 32 | 33 |
| 33 // Shows 3G promo notification if needed. | 34 // Shows 3G promo notification if needed. |
| 34 void ShowOptionalMobileDataPromoNotification( | 35 void ShowOptionalMobileDataPromoNotification( |
| 35 NetworkLibrary* cros, | 36 NetworkLibrary* cros, |
| 36 views::View* host, | 37 views::View* host, |
| 37 MessageBubbleLinkListener* listener); | 38 ash::NetworkTrayDelegate* listener); |
| 38 | 39 |
| 39 // Closes message bubble. | 40 // Closes message bubble. |
| 40 void CloseNotification(); | 41 void CloseNotification(); |
| 41 | 42 |
| 42 private: | 43 private: |
| 43 // Overridden from views::WidgetObserver: | |
| 44 virtual void OnWidgetClosing(views::Widget* widget) OVERRIDE; | |
| 45 | |
| 46 // Notification bubble for 3G promo. | |
| 47 MessageBubble* mobile_data_bubble_; | |
| 48 | |
| 49 // True if check for promo needs to be done, | 44 // True if check for promo needs to be done, |
| 50 // otherwise just ignore it for current session. | 45 // otherwise just ignore it for current session. |
| 51 bool check_for_promo_; | 46 bool check_for_promo_; |
| 52 | 47 |
| 53 // Current carrier deal info URL. | 48 // Current carrier deal info URL. |
| 54 std::string deal_info_url_; | 49 std::string deal_info_url_; |
| 55 | 50 |
| 56 // Current carrier deal top-up URL. | 51 // Current carrier deal top-up URL. |
| 57 std::string deal_topup_url_; | 52 std::string deal_topup_url_; |
| 58 | 53 |
| 59 // Factory for delaying showing promo notification. | 54 // Factory for delaying showing promo notification. |
| 60 base::WeakPtrFactory<DataPromoNotification> weak_ptr_factory_; | 55 base::WeakPtrFactory<DataPromoNotification> weak_ptr_factory_; |
| 61 | 56 |
| 62 DISALLOW_COPY_AND_ASSIGN(DataPromoNotification); | 57 DISALLOW_COPY_AND_ASSIGN(DataPromoNotification); |
| 63 }; | 58 }; |
| 64 | 59 |
| 65 } // namespace chromeos | 60 } // namespace chromeos |
| 66 | 61 |
| 67 #endif // CHROME_BROWSER_CHROMEOS_STATUS_DATA_PROMO_NOTIFICATION_H_ | 62 #endif // CHROME_BROWSER_CHROMEOS_STATUS_DATA_PROMO_NOTIFICATION_H_ |
| OLD | NEW |