| OLD | NEW |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 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_HATS_HATS_NOTIFICATION_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_HATS_HATS_NOTIFICATION_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_HATS_HATS_NOTIFICATION_CONTROLLER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_HATS_HATS_NOTIFICATION_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 InternetConnected_ShowNotification); | 57 InternetConnected_ShowNotification); |
| 58 FRIEND_TEST_ALL_PREFIXES(HatsNotificationControllerTest, | 58 FRIEND_TEST_ALL_PREFIXES(HatsNotificationControllerTest, |
| 59 DismissNotification_ShouldUpdatePref); | 59 DismissNotification_ShouldUpdatePref); |
| 60 | 60 |
| 61 ~HatsNotificationController() override; | 61 ~HatsNotificationController() override; |
| 62 | 62 |
| 63 // NotificationDelegate overrides: | 63 // NotificationDelegate overrides: |
| 64 void Initialize(bool is_new_device); | 64 void Initialize(bool is_new_device); |
| 65 void ButtonClick(int button_index) override; | 65 void ButtonClick(int button_index) override; |
| 66 void Close(bool by_user) override; | 66 void Close(bool by_user) override; |
| 67 void Click() override; |
| 67 std::string id() const override; | 68 std::string id() const override; |
| 68 | 69 |
| 69 void OnImageFetched(const std::string& id, const gfx::Image& image); | 70 void OnImageFetched(const std::string& id, const gfx::Image& image); |
| 70 | 71 |
| 71 // NetworkPortalDetector::Observer override: | 72 // NetworkPortalDetector::Observer override: |
| 72 void OnPortalDetectionCompleted( | 73 void OnPortalDetectionCompleted( |
| 73 const NetworkState* network, | 74 const NetworkState* network, |
| 74 const NetworkPortalDetector::CaptivePortalState& state) override; | 75 const NetworkPortalDetector::CaptivePortalState& state) override; |
| 75 | 76 |
| 76 Notification* CreateNotification(); | 77 Notification* CreateNotification(); |
| 77 void UpdateLastInteractionTime(); | 78 void UpdateLastInteractionTime(); |
| 78 | 79 |
| 79 Profile* profile_; | 80 Profile* profile_; |
| 80 // A count of requests that have been completed so far. This includes requests | 81 // A count of requests that have been completed so far. This includes requests |
| 81 // that may have failed as well. | 82 // that may have failed as well. |
| 82 int completed_requests_; | 83 int completed_requests_; |
| 83 std::unique_ptr<image_fetcher::ImageFetcher> image_fetcher_; | 84 std::unique_ptr<image_fetcher::ImageFetcher> image_fetcher_; |
| 84 gfx::ImageSkia icon_; | 85 gfx::ImageSkia icon_; |
| 85 base::WeakPtrFactory<HatsNotificationController> weak_pointer_factory_; | 86 base::WeakPtrFactory<HatsNotificationController> weak_pointer_factory_; |
| 86 | 87 |
| 87 DISALLOW_COPY_AND_ASSIGN(HatsNotificationController); | 88 DISALLOW_COPY_AND_ASSIGN(HatsNotificationController); |
| 88 }; | 89 }; |
| 89 | 90 |
| 90 } // namespace chromeos | 91 } // namespace chromeos |
| 91 | 92 |
| 92 #endif // CHROME_BROWSER_CHROMEOS_HATS_HATS_NOTIFICATION_CONTROLLER_H_ | 93 #endif // CHROME_BROWSER_CHROMEOS_HATS_HATS_NOTIFICATION_CONTROLLER_H_ |
| OLD | NEW |