OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "chrome/browser/chromeos/net/network_portal_notification_controller.h" | 5 #include "chrome/browser/chromeos/net/network_portal_notification_controller.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "ash/system/system_notifier.h" | 10 #include "ash/system/system_notifier.h" |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 | 230 |
231 // static | 231 // static |
232 const char NetworkPortalNotificationController::kNotificationMetric[] = | 232 const char NetworkPortalNotificationController::kNotificationMetric[] = |
233 "CaptivePortal.Notification.Status"; | 233 "CaptivePortal.Notification.Status"; |
234 | 234 |
235 // static | 235 // static |
236 const char NetworkPortalNotificationController::kUserActionMetric[] = | 236 const char NetworkPortalNotificationController::kUserActionMetric[] = |
237 "CaptivePortal.Notification.UserAction"; | 237 "CaptivePortal.Notification.UserAction"; |
238 | 238 |
239 NetworkPortalNotificationController::NetworkPortalNotificationController( | 239 NetworkPortalNotificationController::NetworkPortalNotificationController( |
240 NetworkPortalDetector* network_portal_detector) | 240 NetworkPortalDetectorInterface* network_portal_detector) |
241 : network_portal_detector_(network_portal_detector), weak_factory_(this) { | 241 : network_portal_detector_(network_portal_detector), weak_factory_(this) { |
242 if (NetworkHandler::IsInitialized()) { // NULL for unit tests. | 242 if (NetworkHandler::IsInitialized()) { // NULL for unit tests. |
243 NetworkHandler::Get()->network_state_handler()->AddObserver(this, | 243 NetworkHandler::Get()->network_state_handler()->AddObserver(this, |
244 FROM_HERE); | 244 FROM_HERE); |
245 } | 245 } |
246 if (network_portal_detector_) | 246 if (network_portal_detector_) |
247 network_portal_detector_->AddObserver(this); | 247 network_portal_detector_->AddObserver(this); |
248 } | 248 } |
249 | 249 |
250 NetworkPortalNotificationController::~NetworkPortalNotificationController() { | 250 NetworkPortalNotificationController::~NetworkPortalNotificationController() { |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
440 if (dialog_) | 440 if (dialog_) |
441 dialog_->Close(); | 441 dialog_->Close(); |
442 } | 442 } |
443 | 443 |
444 const NetworkPortalWebDialog* | 444 const NetworkPortalWebDialog* |
445 NetworkPortalNotificationController::GetDialogForTesting() const { | 445 NetworkPortalNotificationController::GetDialogForTesting() const { |
446 return dialog_; | 446 return dialog_; |
447 } | 447 } |
448 | 448 |
449 } // namespace chromeos | 449 } // namespace chromeos |
OLD | NEW |