[M47_2526] Chromium upversion to m47_2526 branch
[platform/framework/web/chromium-efl.git] / tizen_src / ewk / efl_integration / browser / autofill / autofill_pref_store_efl.cc
1 // Copyright (c) 2013 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 #include "autofill_pref_store_efl.h"
6
7 #include "base/memory/scoped_ptr.h"
8 #include "base/values.h"
9
10 AutofillPrefStore::AutofillPrefStore() {}
11
12 AutofillPrefStore::~AutofillPrefStore() {}
13
14 bool AutofillPrefStore::GetValue(const std::string& key,
15     const base::Value** value) const {
16   return prefs_.GetValue(key, value);
17 }
18
19 bool AutofillPrefStore::GetMutableValue(const std::string& key,
20     base::Value** value) {
21   return prefs_.GetValue(key, value);
22 }
23
24 void AutofillPrefStore::AddObserver(PrefStore::Observer* observer) {
25   observers_.AddObserver(observer);
26 }
27
28 void AutofillPrefStore::RemoveObserver(PrefStore::Observer* observer) {
29   observers_.RemoveObserver(observer);
30 }
31
32 bool AutofillPrefStore::HasObservers() const {
33   return observers_.might_have_observers();
34 }
35
36 bool AutofillPrefStore::IsInitializationComplete() const {
37   return true;
38 }
39
40 void AutofillPrefStore::SetValue(const std::string& key,
41                                  scoped_ptr<base::Value> value,
42                                  uint32 flags) {
43   DCHECK(value);
44   if (prefs_.SetValue(key, value.Pass()))
45     ReportValueChanged(key, flags);
46 }
47
48 void AutofillPrefStore::SetValueSilently(const std::string& key,
49                                          scoped_ptr<base::Value> value,
50                                          uint32 flags) {
51   prefs_.SetValue(key, value.Pass());
52 }
53
54 void AutofillPrefStore::RemoveValue(const std::string& key, uint32 flags) {
55   if (prefs_.RemoveValue(key))
56     ReportValueChanged(key, flags);
57 }
58
59 bool AutofillPrefStore::ReadOnly() const {
60   return false;
61 }
62
63 PersistentPrefStore::PrefReadError AutofillPrefStore::GetReadError() const {
64   return PersistentPrefStore::PREF_READ_ERROR_NONE;
65 }
66
67 PersistentPrefStore::PrefReadError AutofillPrefStore::ReadPrefs() {
68   return PersistentPrefStore::PREF_READ_ERROR_NONE;
69 }
70
71 void AutofillPrefStore::ReadPrefsAsync(ReadErrorDelegate* error_delegate_raw) {
72 }
73
74 void AutofillPrefStore::ReportValueChanged(const std::string& key, uint32 flags) {
75   FOR_EACH_OBSERVER(Observer, observers_, OnPrefValueChanged(key));
76 }