Chromium Code Reviews| 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_CHROMEOS_NET_TETHER_NOTIFICATION_PRESENTER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_NET_TETHER_NOTIFICATION_PRESENTER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_NET_TETHER_NOTIFICATION_PRESENTER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_NET_TETHER_NOTIFICATION_PRESENTER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
| 14 #include "base/strings/string16.h" | 14 #include "base/strings/string16.h" |
| 15 #include "chromeos/components/tether/notification_presenter.h" | 15 #include "chromeos/components/tether/notification_presenter.h" |
| 16 #include "chromeos/network/network_connect.h" | |
| 16 #include "components/cryptauth/remote_device.h" | 17 #include "components/cryptauth/remote_device.h" |
| 17 #include "ui/message_center/message_center_observer.h" | 18 #include "ui/message_center/message_center_observer.h" |
| 18 #include "ui/message_center/notification.h" | 19 #include "ui/message_center/notification.h" |
| 19 | 20 |
| 20 namespace message_center { | 21 namespace message_center { |
| 21 class MessageCenter; | 22 class MessageCenter; |
| 22 class Notification; | 23 class Notification; |
| 23 } // namespace message_center | 24 } // namespace message_center |
| 24 | 25 |
| 25 namespace chromeos { | 26 namespace chromeos { |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 42 void RemovePotentialHotspotNotification() override; | 43 void RemovePotentialHotspotNotification() override; |
| 43 void NotifyConnectionToHostFailed() override; | 44 void NotifyConnectionToHostFailed() override; |
| 44 void RemoveConnectionToHostFailedNotification() override; | 45 void RemoveConnectionToHostFailedNotification() override; |
| 45 | 46 |
| 46 // message_center::MessageCenterObserver: | 47 // message_center::MessageCenterObserver: |
| 47 void OnNotificationClicked(const std::string& notification_id) override; | 48 void OnNotificationClicked(const std::string& notification_id) override; |
| 48 void OnNotificationButtonClicked(const std::string& notification_id, | 49 void OnNotificationButtonClicked(const std::string& notification_id, |
| 49 int button_index) override; | 50 int button_index) override; |
| 50 | 51 |
| 51 protected: | 52 protected: |
| 52 explicit TetherNotificationPresenter( | 53 TetherNotificationPresenter(message_center::MessageCenter* message_center, |
| 53 message_center::MessageCenter* message_center); | 54 NetworkConnect* network_connect); |
|
stevenjb
2017/04/10 19:55:51
Can you add a comment that |message_center| and |n
Ryan Hansberry
2017/04/10 22:28:55
Done.
| |
| 54 | 55 |
| 55 private: | 56 private: |
| 56 friend class TetherNotificationPresenterTest; | 57 friend class TetherNotificationPresenterTest; |
| 57 | 58 |
| 58 static const char kTetherNotifierId[]; | 59 static const char kTetherNotifierId[]; |
| 59 static const char kPotentialHotspotNotificationId[]; | 60 static const char kPotentialHotspotNotificationId[]; |
| 60 static const char kActiveHostNotificationId[]; | 61 static const char kActiveHostNotificationId[]; |
| 61 | 62 |
| 62 static std::unique_ptr<message_center::Notification> CreateNotification( | 63 static std::unique_ptr<message_center::Notification> CreateNotification( |
| 63 const std::string& id, | 64 const std::string& id, |
| 64 const base::string16& title, | 65 const base::string16& title, |
| 65 const base::string16& message); | 66 const base::string16& message); |
| 66 static std::unique_ptr<message_center::Notification> CreateNotification( | 67 static std::unique_ptr<message_center::Notification> CreateNotification( |
| 67 const std::string& id, | 68 const std::string& id, |
| 68 const base::string16& title, | 69 const base::string16& title, |
| 69 const base::string16& message, | 70 const base::string16& message, |
| 70 const message_center::RichNotificationData rich_notification_data); | 71 const message_center::RichNotificationData rich_notification_data); |
| 71 | 72 |
| 72 void ShowNotification( | 73 void ShowNotification( |
| 73 std::unique_ptr<message_center::Notification> notification); | 74 std::unique_ptr<message_center::Notification> notification); |
| 74 | 75 |
| 75 message_center::MessageCenter* message_center_; | 76 message_center::MessageCenter* message_center_; |
| 77 NetworkConnect* network_connect_; | |
| 76 | 78 |
| 77 cryptauth::RemoteDevice hotspot_nearby_device_; | 79 cryptauth::RemoteDevice hotspot_nearby_device_; |
| 78 base::WeakPtrFactory<TetherNotificationPresenter> weak_ptr_factory_; | 80 base::WeakPtrFactory<TetherNotificationPresenter> weak_ptr_factory_; |
| 79 | 81 |
| 80 DISALLOW_COPY_AND_ASSIGN(TetherNotificationPresenter); | 82 DISALLOW_COPY_AND_ASSIGN(TetherNotificationPresenter); |
| 81 }; | 83 }; |
| 82 | 84 |
| 83 } // namespace tether | 85 } // namespace tether |
| 84 | 86 |
| 85 } // namespace chromeos | 87 } // namespace chromeos |
| 86 | 88 |
| 87 #endif // CHROME_BROWSER_CHROMEOS_NET_TETHER_NOTIFICATION_PRESENTER_H_ | 89 #endif // CHROME_BROWSER_CHROMEOS_NET_TETHER_NOTIFICATION_PRESENTER_H_ |
| OLD | NEW |