Chromium Code Reviews| Index: chrome/browser/chromeos/net/tether_notification_presenter.cc |
| diff --git a/chrome/browser/chromeos/net/tether_notification_presenter.cc b/chrome/browser/chromeos/net/tether_notification_presenter.cc |
| index 13d669541c8176fa648626336c6ffe44e85fb22c..4366573f9381949cdab7da3b99e78c86af47d4b9 100644 |
| --- a/chrome/browser/chromeos/net/tether_notification_presenter.cc |
| +++ b/chrome/browser/chromeos/net/tether_notification_presenter.cc |
| @@ -62,11 +62,15 @@ TetherNotificationPresenter::CreateNotification( |
| } |
| TetherNotificationPresenter::TetherNotificationPresenter() |
| - : TetherNotificationPresenter(message_center::MessageCenter::Get()) {} |
| + : TetherNotificationPresenter(message_center::MessageCenter::Get(), |
| + NetworkConnect::Get()) {} |
|
stevenjb
2017/04/10 19:55:51
We shouldn't provide this extra constructor. We sh
Ryan Hansberry
2017/04/10 22:28:55
Done.
|
| TetherNotificationPresenter::TetherNotificationPresenter( |
| - message_center::MessageCenter* message_center) |
| - : message_center_(message_center), weak_ptr_factory_(this) { |
| + message_center::MessageCenter* message_center, |
| + NetworkConnect* network_connect) |
| + : message_center_(message_center), |
| + network_connect_(network_connect), |
| + weak_ptr_factory_(this) { |
| message_center_->AddObserver(this); |
| } |
| @@ -152,12 +156,11 @@ void TetherNotificationPresenter::OnNotificationButtonClicked( |
| << " of notification with ID " << notification_id |
| << " was clicked."; |
| - // Only the "potential hotspot nearby" notification has a button, and it only |
| - // has one button (index 0). |
| - DCHECK(std::string(kPotentialHotspotNotificationId) == notification_id); |
| - DCHECK(0 == button_index); |
| - |
| - // TODO(khorimoto): Start a connection. |
| + if (notification_id == kPotentialHotspotNotificationId && button_index == 0) { |
| + // TODO (hansberry): Only directly start a connection if this is not the |
| + // first time the user has connected to a host. |
| + network_connect_->ConnectToNetworkId(hotspot_nearby_device_.GetDeviceId()); |
| + } |
| } |
| void TetherNotificationPresenter::ShowNotification( |