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

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

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

Powered by Google App Engine
This is Rietveld 408576698