OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/common/pref_service.h" | 5 #include "chrome/common/pref_service.h" |
6 | 6 |
| 7 #include "app/l10n_util.h" |
7 #include "base/logging.h" | 8 #include "base/logging.h" |
8 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
9 #include "base/stl_util-inl.h" | 10 #include "base/stl_util-inl.h" |
10 #include "base/string_util.h" | 11 #include "base/string_util.h" |
11 #include "base/thread.h" | 12 #include "base/thread.h" |
12 #include "chrome/common/json_value_serializer.h" | 13 #include "chrome/common/json_value_serializer.h" |
13 #include "chrome/common/l10n_util.h" | |
14 #include "chrome/common/notification_service.h" | 14 #include "chrome/common/notification_service.h" |
15 #include "grit/generated_resources.h" | 15 #include "grit/generated_resources.h" |
16 | 16 |
17 namespace { | 17 namespace { |
18 | 18 |
19 // A helper function for RegisterLocalized*Pref that creates a Value* based on | 19 // A helper function for RegisterLocalized*Pref that creates a Value* based on |
20 // the string value in the locale dll. Because we control the values in a | 20 // the string value in the locale dll. Because we control the values in a |
21 // locale dll, this should always return a Value of the appropriate type. | 21 // locale dll, this should always return a Value of the appropriate type. |
22 Value* CreateLocaleDefaultValue(Value::ValueType type, int message_id) { | 22 Value* CreateLocaleDefaultValue(Value::ValueType type, int message_id) { |
23 std::wstring resource_string = l10n_util::GetString(message_id); | 23 std::wstring resource_string = l10n_util::GetString(message_id); |
(...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
687 } | 687 } |
688 | 688 |
689 // Pref not found, just return the app default. | 689 // Pref not found, just return the app default. |
690 return default_value_.get(); | 690 return default_value_.get(); |
691 } | 691 } |
692 | 692 |
693 bool PrefService::Preference::IsDefaultValue() const { | 693 bool PrefService::Preference::IsDefaultValue() const { |
694 DCHECK(default_value_.get()); | 694 DCHECK(default_value_.get()); |
695 return default_value_->Equals(GetValue()); | 695 return default_value_->Equals(GetValue()); |
696 } | 696 } |
OLD | NEW |