OLD | NEW |
---|---|
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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_UI_DESKTOP_IOS_PROMOTION_DESKTOP_IOS_PROMOTION_CONTROLLER _H_ | 5 #ifndef CHROME_BROWSER_UI_DESKTOP_IOS_PROMOTION_DESKTOP_IOS_PROMOTION_CONTROLLER _H_ |
6 #define CHROME_BROWSER_UI_DESKTOP_IOS_PROMOTION_DESKTOP_IOS_PROMOTION_CONTROLLER _H_ | 6 #define CHROME_BROWSER_UI_DESKTOP_IOS_PROMOTION_DESKTOP_IOS_PROMOTION_CONTROLLER _H_ |
7 | 7 |
8 #include <memory> | |
9 #include <string> | |
10 | |
8 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "chrome/browser/ui/desktop_ios_promotion/sms_service.h" | |
9 | 13 |
10 namespace desktop_ios_promotion { | 14 namespace desktop_ios_promotion { |
11 enum class PromotionEntryPoint; | 15 enum class PromotionEntryPoint; |
12 } | 16 } |
13 | 17 |
18 class Profile; | |
19 class PrefService; | |
20 | |
14 // This class provides data to the Desktop to mobile promotion and control the | 21 // This class provides data to the Desktop to mobile promotion and control the |
15 // promotion actions. | 22 // promotion actions. |
16 class DesktopIOSPromotionController { | 23 class DesktopIOSPromotionController { |
17 public: | 24 public: |
18 // Should be instantiated on the UI thread. | 25 // Should be instantiated on the UI thread. |
sky
2017/02/16 00:13:36
Should->Must
mrefaat
2017/02/16 21:02:39
Done.
| |
19 DesktopIOSPromotionController(); | 26 DesktopIOSPromotionController( |
27 Profile* profile, | |
28 desktop_ios_promotion::PromotionEntryPoint entry_point); | |
20 ~DesktopIOSPromotionController(); | 29 ~DesktopIOSPromotionController(); |
21 | 30 |
22 // Called by the view code when "Send SMS" button is clicked by the user. | 31 // Called by the view code when "Send SMS" button is clicked by the user. |
23 void OnSendSMSClicked(); | 32 void OnSendSMSClicked(); |
24 | 33 |
34 // Called by the view code when the promotion is ready to show. | |
35 void OnPromotionShown(); | |
36 | |
25 // Called by the view code when "No Thanks" button is clicked by the user. | 37 // Called by the view code when "No Thanks" button is clicked by the user. |
26 void OnNoThanksClicked(); | 38 void OnNoThanksClicked(); |
27 | 39 |
28 // (TODO): If needed verify that functions that affect the UI are done | 40 private: |
29 // on the same thread. | 41 PrefService* profile_prefs_; |
42 desktop_ios_promotion::PromotionEntryPoint entry_point_; | |
sky
2017/02/16 00:13:36
const
| |
43 SMSService* sms_service_; | |
44 std::string recovery_number_; | |
sky
2017/02/16 00:13:36
Add descriptions of non-obvious members.
mrefaat
2017/02/16 21:02:39
Done.
| |
45 base::WeakPtrFactory<DesktopIOSPromotionController> weak_ptr_factory_; | |
46 void OnQueryPhoneNumber(SMSService::Request* request, | |
sky
2017/02/16 00:13:36
Functions before members.
sky
2017/02/16 00:13:36
Add descriptions for functions.
mrefaat
2017/02/16 21:02:39
Done.
mrefaat
2017/02/16 21:02:39
Done.
mrefaat
2017/02/16 21:02:39
Done.
| |
47 bool success, | |
48 const std::string& number); | |
49 void OnSendSMS(SMSService::Request* request, | |
50 bool success, | |
51 const std::string& number); | |
30 | 52 |
31 DISALLOW_COPY_AND_ASSIGN(DesktopIOSPromotionController); | 53 DISALLOW_COPY_AND_ASSIGN(DesktopIOSPromotionController); |
32 }; | 54 }; |
33 | 55 |
34 #endif // CHROME_BROWSER_UI_DESKTOP_IOS_PROMOTION_DESKTOP_IOS_PROMOTION_CONTROL LER_H_ | 56 #endif // CHROME_BROWSER_UI_DESKTOP_IOS_PROMOTION_DESKTOP_IOS_PROMOTION_CONTROL LER_H_ |
OLD | NEW |