Chromium Code Reviews| Index: chrome_frame/registry_list_preferences_holder.cc |
| diff --git a/chrome_frame/registry_list_preferences_holder.cc b/chrome_frame/registry_list_preferences_holder.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..25995435cc77b13da831d69826470fcecbb2bb28 |
| --- /dev/null |
| +++ b/chrome_frame/registry_list_preferences_holder.cc |
| @@ -0,0 +1,45 @@ |
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| +// |
|
slightlyoff1
2012/03/20 15:31:56
clobber empty comment line
grt (UTC plus 2)
2012/03/20 17:27:45
remove
robertshield
2012/03/26 02:43:33
Done.
robertshield
2012/03/26 02:43:33
Done.
|
| + |
| +#include "chrome_frame/registry_list_preferences_holder.h" |
| + |
| +#include "base/string_util.h" |
| +#include "base/win/registry.h" |
| + |
| +using base::win::RegKey; |
|
grt (UTC plus 2)
2012/03/20 17:27:45
remove this
robertshield
2012/03/26 02:43:33
Done.
|
| + |
| +RegistryListPreferencesHolder::RegistryListPreferencesHolder() : valid_(false) { |
| + |
| +} |
| + |
| +void RegistryListPreferencesHolder::Init(HKEY hive, |
| + const wchar_t* registry_path, |
| + const wchar_t* list_name) { |
| + RegKey config_key; |
|
grt (UTC plus 2)
2012/03/20 17:27:45
i think you don't need config_key here:
base::win:
robertshield
2012/03/26 02:43:33
Done.
robertshield
2012/03/27 04:33:22
And slightly modified to avoid a regression caused
|
| + if (config_key.Open(hive, registry_path, |
| + KEY_QUERY_VALUE) == ERROR_SUCCESS) { |
| + base::win::RegistryValueIterator string_list(config_key.Handle(), |
| + list_name); |
| + while (string_list.Valid()) { |
| + values_.push_back(string_list.Name()); |
| + ++string_list; |
| + } |
| + } |
| + |
| + valid_ = true; |
| +} |
| + |
| + |
|
grt (UTC plus 2)
2012/03/20 17:27:45
remove extra newline
robertshield
2012/03/26 02:43:33
Done.
|
| +bool RegistryListPreferencesHolder::ListMatches(const string16& string) { |
| + std::vector<string16>::const_iterator iter(values_.begin()); |
| + for (; iter != values_.end(); ++iter) { |
| + if (MatchPattern(string, *iter)) { |
|
grt (UTC plus 2)
2012/03/20 17:27:45
remove braces
robertshield
2012/03/26 02:43:33
Done.
|
| + return true; |
| + } |
| + } |
| + |
| + return false; |
| +} |
| + |