summaryrefslogtreecommitdiffstats
path: root/components
diff options
context:
space:
mode:
authorsdefresne@chromium.org <sdefresne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-16 17:00:31 +0000
committersdefresne@chromium.org <sdefresne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-16 17:00:31 +0000
commit707dc161f91a4fa1bd6b534c99951987b2085a7d (patch)
tree9d77b72410fe21a2ca4d3f17fd994330cab0ff45 /components
parent6279f29991c3aa4ece461b8f9c1635f9b0751b07 (diff)
downloadchromium_src-707dc161f91a4fa1bd6b534c99951987b2085a7d.zip
chromium_src-707dc161f91a4fa1bd6b534c99951987b2085a7d.tar.gz
chromium_src-707dc161f91a4fa1bd6b534c99951987b2085a7d.tar.bz2
Move bookmark_title_match.{cc,h} to components/bookmarks
The files chrome/browser/bookmarks/bookmark_title_match.{cc,h} does not have any dependencies on other files, so move them to the bookmarks component. BUG=361119 TBR=sky,gab Review URL: https://codereview.chromium.org/238113004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@264222 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'components')
-rw-r--r--components/bookmarks.gypi2
-rw-r--r--components/bookmarks/core/browser/bookmark_title_match.cc9
-rw-r--r--components/bookmarks/core/browser/bookmark_title_match.h31
3 files changed, 42 insertions, 0 deletions
diff --git a/components/bookmarks.gypi b/components/bookmarks.gypi
index 076c97f..4fe4818 100644
--- a/components/bookmarks.gypi
+++ b/components/bookmarks.gypi
@@ -19,6 +19,8 @@
'sources': [
'bookmarks/core/browser/bookmark_node.cc',
'bookmarks/core/browser/bookmark_node.h',
+ 'bookmarks/core/browser/bookmark_title_match.cc',
+ 'bookmarks/core/browser/bookmark_title_match.h',
],
},
{
diff --git a/components/bookmarks/core/browser/bookmark_title_match.cc b/components/bookmarks/core/browser/bookmark_title_match.cc
new file mode 100644
index 0000000..257291b
--- /dev/null
+++ b/components/bookmarks/core/browser/bookmark_title_match.cc
@@ -0,0 +1,9 @@
+// Copyright 2014 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.
+
+#include "components/bookmarks/core/browser/bookmark_title_match.h"
+
+BookmarkTitleMatch::BookmarkTitleMatch() : node(NULL) {}
+
+BookmarkTitleMatch::~BookmarkTitleMatch() {}
diff --git a/components/bookmarks/core/browser/bookmark_title_match.h b/components/bookmarks/core/browser/bookmark_title_match.h
new file mode 100644
index 0000000..be45f4f
--- /dev/null
+++ b/components/bookmarks/core/browser/bookmark_title_match.h
@@ -0,0 +1,31 @@
+// Copyright 2014 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.
+
+#ifndef COMPONENTS_BOOKMARKS_CORE_BROWSER_BOOKMARK_TITLE_MATCH_H_
+#define COMPONENTS_BOOKMARKS_CORE_BROWSER_BOOKMARK_TITLE_MATCH_H_
+
+#include <stddef.h>
+
+#include <utility>
+#include <vector>
+
+class BookmarkNode;
+
+struct BookmarkTitleMatch {
+ // Each MatchPosition is the [begin, end) positions of a match within a
+ // string.
+ typedef std::pair<size_t, size_t> MatchPosition;
+ typedef std::vector<MatchPosition> MatchPositions;
+
+ BookmarkTitleMatch();
+ ~BookmarkTitleMatch();
+
+ // The matching node of a query.
+ const BookmarkNode* node;
+
+ // Location of the matching words in the title of the node.
+ MatchPositions match_positions;
+};
+
+#endif // COMPONENTS_BOOKMARKS_CORE_BROWSER_BOOKMARK_TITLE_MATCH_H_