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
3// found in the LICENSE file.
4
5#ifndef CHROME_BROWSER_CHROMEOS_NET_NETWORK_PORTAL_NOTIFICATION_CONTROLLER_H_
6#define CHROME_BROWSER_CHROMEOS_NET_NETWORK_PORTAL_NOTIFICATION_CONTROLLER_H_
7
8#include <string>
9
10#include "base/macros.h"
11#include "chromeos/network/portal_detector/network_portal_detector.h"
12
13namespace chromeos {
14
15class NetworkState;
16
17class NetworkPortalNotificationController {
18 public:
19  enum NotificationMetric {
20    NOTIFICATION_METRIC_DISPLAYED = 0,
21    NOTIFICATION_METRIC_ERROR,
22    NOTIFICATION_METRIC_COUNT
23  };
24
25  enum UserActionMetric {
26    USER_ACTION_METRIC_CLICKED,
27    USER_ACTION_METRIC_CLOSED,
28    USER_ACTION_METRIC_IGNORED,
29    USER_ACTION_METRIC_COUNT
30  };
31
32  static const char kNotificationId[];
33
34  static const char kNotificationMetric[];
35  static const char kUserActionMetric[];
36
37  NetworkPortalNotificationController();
38  virtual ~NetworkPortalNotificationController();
39
40  void OnPortalDetectionCompleted(
41      const NetworkState* network,
42      const NetworkPortalDetector::CaptivePortalState& state);
43
44 private:
45  // Last network path for which notification was displayed.
46  std::string last_network_path_;
47
48  DISALLOW_COPY_AND_ASSIGN(NetworkPortalNotificationController);
49};
50
51}  // namespace chromeos
52
53#endif  // CHROME_BROWSER_CHROMEOS_NET_NETWORK_PORTAL_NOTIFICATION_CONTROLLER_H_
54