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

Unified Diff: sync/syncable/syncable.cc

Issue 9836100: Add full text regex searching to chrome://sync (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Clean up rough edges 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: sync/syncable/syncable.cc
diff --git a/sync/syncable/syncable.cc b/sync/syncable/syncable.cc
index e34aa7796ea40eb17316577293fd5d0e616aa41d..7be59ec19b860bc42eedec79dcf75dfbb3773e58 100644
--- a/sync/syncable/syncable.cc
+++ b/sync/syncable/syncable.cc
@@ -19,6 +19,7 @@
#include "base/debug/trace_event.h"
#include "base/file_util.h"
#include "base/hash_tables.h"
+#include "base/json/json_writer.h"
akalin 2012/04/03 00:36:08 didn't you mean to remove this?
rlarocque 2012/04/03 19:01:42 Yes. Done.
#include "base/location.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
@@ -302,36 +303,6 @@ syncable::ModelType EntryKernel::GetServerModelType() const {
return UNSPECIFIED;
}
-bool EntryKernel::ContainsString(const std::string& lowercase_query) const {
- // TODO(lipalani) - figure out what to do if the node is encrypted.
- const sync_pb::EntitySpecifics& specifics = ref(SPECIFICS);
- std::string temp;
- // The protobuf serialized string contains the original strings. So
- // we will just serialize it and search it.
- specifics.SerializeToString(&temp);
-
- // Now convert to lower case.
- StringToLowerASCII(&temp);
-
- if (temp.find(lowercase_query) != std::string::npos)
- return true;
-
- // Now go through all the string fields to see if the value is there.
- for (int i = STRING_FIELDS_BEGIN; i < STRING_FIELDS_END; ++i) {
- if (StringToLowerASCII(ref(static_cast<StringField>(i))).find(
- lowercase_query) != std::string::npos)
- return true;
- }
-
- for (int i = ID_FIELDS_BEGIN; i < ID_FIELDS_END; ++i) {
- const Id& id = ref(static_cast<IdField>(i));
- if (id.ContainsStringCaseInsensitive(lowercase_query)) {
- return true;
- }
- }
- return false;
-}
-
namespace {
// Utility function to loop through a set of enum values and add the

Powered by Google App Engine
This is Rietveld 408576698