ephemeral_profile.cc revision 86a22598bac564b2030aed6f862f684a96471836
1// Copyright (c) 2012 The Chromium OS 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#include "shill/ephemeral_profile.h"
6
7#include <chromeos/dbus/service_constants.h>
8
9#include "shill/adaptor_interfaces.h"
10#include "shill/control_interface.h"
11#include "shill/logging.h"
12#include "shill/manager.h"
13
14namespace shill {
15
16using std::string;
17
18// static
19const char EphemeralProfile::kFriendlyName[] = "(ephemeral)";
20
21EphemeralProfile::EphemeralProfile(ControlInterface *control_interface,
22                                   Metrics *metrics,
23                                   Manager *manager)
24    : Profile(control_interface, metrics, manager, Identifier(), "", false) {
25}
26
27EphemeralProfile::~EphemeralProfile() {}
28
29string EphemeralProfile::GetFriendlyName() {
30  return kFriendlyName;
31}
32
33bool EphemeralProfile::AdoptService(const ServiceRefPtr &service) {
34  SLOG(Profile, 2) << "Adding service " << service->unique_name()
35                   << " to ephemeral profile.";
36  service->SetProfile(this);
37  return true;
38}
39
40bool EphemeralProfile::AbandonService(const ServiceRefPtr &service) {
41  if (service->profile() == this)
42    service->SetProfile(NULL);
43  SLOG(Profile, 2) << "Removing service " << service->unique_name()
44                   << " from ephemeral profile.";
45  return true;
46}
47
48bool EphemeralProfile::Save() {
49  NOTREACHED();
50  return false;
51}
52
53}  // namespace shill
54