Chromium Code Reviews| 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 "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 65 switch (type) { | 65 switch (type) { |
| 66 case Value::TYPE_BOOLEAN: { | 66 case Value::TYPE_BOOLEAN: { |
| 67 if (L"true" == resource_string) | 67 if (L"true" == resource_string) |
| 68 return Value::CreateBooleanValue(true); | 68 return Value::CreateBooleanValue(true); |
| 69 if (L"false" == resource_string) | 69 if (L"false" == resource_string) |
| 70 return Value::CreateBooleanValue(false); | 70 return Value::CreateBooleanValue(false); |
| 71 break; | 71 break; |
| 72 } | 72 } |
| 73 | 73 |
| 74 case Value::TYPE_INTEGER: { | 74 case Value::TYPE_INTEGER: { |
| 75 return Value::CreateIntegerValue(StringToInt(resource_string)); | 75 return Value::CreateIntegerValue(StringToInt(WideToUTF16Hack( |
| 76 resource_string))); | |
|
brettw
2009/02/27 23:45:15
I'd wrap this and the next change to 4 spaces from
| |
| 76 break; | 77 break; |
| 77 } | 78 } |
| 78 | 79 |
| 79 case Value::TYPE_REAL: { | 80 case Value::TYPE_REAL: { |
| 80 return Value::CreateRealValue(StringToDouble(resource_string)); | 81 return Value::CreateRealValue(StringToDouble(WideToUTF16Hack( |
| 82 resource_string))); | |
| 81 break; | 83 break; |
| 82 } | 84 } |
| 83 | 85 |
| 84 case Value::TYPE_STRING: { | 86 case Value::TYPE_STRING: { |
| 85 return Value::CreateStringValue(resource_string); | 87 return Value::CreateStringValue(resource_string); |
| 86 break; | 88 break; |
| 87 } | 89 } |
| 88 | 90 |
| 89 default: { | 91 default: { |
| 90 DCHECK(false) << | 92 DCHECK(false) << |
| (...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 676 } | 678 } |
| 677 | 679 |
| 678 // Pref not found, just return the app default. | 680 // Pref not found, just return the app default. |
| 679 return default_value_.get(); | 681 return default_value_.get(); |
| 680 } | 682 } |
| 681 | 683 |
| 682 bool PrefService::Preference::IsDefaultValue() const { | 684 bool PrefService::Preference::IsDefaultValue() const { |
| 683 DCHECK(default_value_.get()); | 685 DCHECK(default_value_.get()); |
| 684 return default_value_->Equals(GetValue()); | 686 return default_value_->Equals(GetValue()); |
| 685 } | 687 } |
| 686 | |
| OLD | NEW |