Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5645)

Unified Diff: chrome_frame/registry_list_preferences_holder.cc

Issue 9720001: Add a setting to CF to remove 'chromeframe' from the UserAgent on a per-pattern basis. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Minor tweak to UA building. Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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;
+}
+

Powered by Google App Engine
This is Rietveld 408576698