diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-02 14:41:40 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-02 14:41:40 +0000 |
commit | 912b5ea8cf1d5914c807df79ca32d2183f4634dd (patch) | |
tree | e9acf41c66c442c601763eebfee6f8221ec21e93 /chrome | |
parent | 81da9e05de1274fd664463db4e6a0811d2fcacaf (diff) | |
download | chromium_src-912b5ea8cf1d5914c807df79ca32d2183f4634dd.zip chromium_src-912b5ea8cf1d5914c807df79ca32d2183f4634dd.tar.gz chromium_src-912b5ea8cf1d5914c807df79ca32d2183f4634dd.tar.bz2 |
history: Make QueryNodePhrase more readable.
- Group all the overridden methods.
- Add OVERRIDE to them.
- Move the implementation out of the class declaration.
- Fix the order to match with our style.
- Add DISALLOW_COPY_AND_ASSIGN.
BUG=68682
TEST=None
R=sky@chromium.org
Review URL: http://codereview.chromium.org/6904161
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@83719 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/history/query_parser.cc | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/chrome/browser/history/query_parser.cc b/chrome/browser/history/query_parser.cc index ea36b38..d2957f3 100644 --- a/chrome/browser/history/query_parser.cc +++ b/chrome/browser/history/query_parser.cc @@ -240,21 +240,28 @@ int QueryNodeList::AppendChildrenToString(string16* query) const { // A QueryNodePhrase is a phrase query ("quoted"). class QueryNodePhrase : public QueryNodeList { public: - virtual int AppendToSQLiteQuery(string16* query) const { - query->push_back(L'"'); - int num_words = AppendChildrenToString(query); - query->push_back(L'"'); - return num_words; - } + QueryNodePhrase(); + virtual ~QueryNodePhrase(); - virtual bool Matches(const string16& word, bool exact) const; - virtual bool HasMatchIn(const std::vector<QueryWord>& words, - Snippet::MatchPositions* match_positions) const; + // QueryNodeList: + virtual int AppendToSQLiteQuery(string16* query) const OVERRIDE; + virtual bool HasMatchIn( + const std::vector<QueryWord>& words, + Snippet::MatchPositions* match_positions) const OVERRIDE; + + private: + DISALLOW_COPY_AND_ASSIGN(QueryNodePhrase); }; -bool QueryNodePhrase::Matches(const string16& word, bool exact) const { - NOTREACHED(); - return false; +QueryNodePhrase::QueryNodePhrase() {} + +QueryNodePhrase::~QueryNodePhrase() {} + +int QueryNodePhrase::AppendToSQLiteQuery(string16* query) const { + query->push_back(L'"'); + int num_words = AppendChildrenToString(query); + query->push_back(L'"'); + return num_words; } bool QueryNodePhrase::HasMatchIn( @@ -282,8 +289,7 @@ bool QueryNodePhrase::HasMatchIn( return false; } -QueryParser::QueryParser() { -} +QueryParser::QueryParser() {} // static bool QueryParser::IsWordLongEnoughForPrefixSearch(const string16& word) { |