default_profile.cc revision 6402e501258c9f64373dcd05271c6c7dd75e20bc
1// Copyright (c) 2011 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/default_profile.h"
6
7#include <base/file_path.h>
8#include <base/stringprintf.h>
9#include <chromeos/dbus/service_constants.h>
10
11#include "shill/adaptor_interfaces.h"
12#include "shill/control_interface.h"
13#include "shill/manager.h"
14
15namespace shill {
16const char DefaultProfile::kDefaultId[] = "default";
17
18DefaultProfile::DefaultProfile(ControlInterface *control,
19                               GLib *glib,
20                               Manager *manager,
21                               const FilePath &storage_path,
22                               const Manager::Properties &manager_props)
23    : Profile(control, glib, manager, Identifier(kDefaultId), "", true),
24      storage_path_(storage_path) {
25  store_.RegisterConstString(flimflam::kCheckPortalListProperty,
26                             &manager_props.check_portal_list);
27  store_.RegisterConstString(flimflam::kCountryProperty,
28                             &manager_props.country);
29  store_.RegisterConstBool(flimflam::kOfflineModeProperty,
30                           &manager_props.offline_mode);
31  store_.RegisterConstString(flimflam::kPortalURLProperty,
32                             &manager_props.portal_url);
33}
34
35DefaultProfile::~DefaultProfile() {}
36
37bool DefaultProfile::GetStoragePath(FilePath *path) {
38  *path = storage_path_.Append(base::StringPrintf("%s.profile", kDefaultId));
39  return true;
40}
41
42}  // namespace shill
43