summaryrefslogtreecommitdiffstats
path: root/content/common/geofencing_types.cc
blob: ab8babe6b80a35889850d58fe94dd165a4bd86c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "content/common/geofencing_types.h"

#include "base/logging.h"

namespace content {

const char* GeofencingStatusToString(GeofencingStatus status) {
  switch (status) {
    case GEOFENCING_STATUS_OK:
      return "Operation has succeeded";

    case GEOFENCING_STATUS_OPERATION_FAILED_NO_SERVICE_WORKER:
      return "Operation failed - no Service Worker";

    case GEOFENCING_STATUS_OPERATION_FAILED_SERVICE_NOT_AVAILABLE:
      return "Operation failed - geofencing not available";

    case GEOFENCING_STATUS_UNREGISTRATION_FAILED_NOT_REGISTERED:
      return "Unregistration failed - no region registered with given ID";

    case GEOFENCING_STATUS_ERROR:
      return "Operation has failed (unspecified reason)";
  }
  NOTREACHED();
  return "";
}

}  // namespace content