- add sources.
[platform/framework/web/crosswalk.git] / src / chrome / browser / history / android / sql_handler.cc
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/history/android/sql_handler.h"
6
7 namespace history {
8
9 TableIDRow::TableIDRow()
10     : url_id(0),
11       bookmarked(false) {
12 }
13
14 TableIDRow::~TableIDRow() {
15 }
16
17 SQLHandler::SQLHandler(const HistoryAndBookmarkRow::ColumnID columns[],
18                        int column_count)
19     : columns_(columns, columns + column_count) {
20 }
21
22 SQLHandler::~SQLHandler() {
23 }
24
25 bool SQLHandler::HasColumnIn(const HistoryAndBookmarkRow& row) {
26   for (std::set<HistoryAndBookmarkRow::ColumnID>::const_iterator i =
27            columns_.begin(); i != columns_.end(); ++i) {
28     if (row.is_value_set_explicitly(*i))
29       return true;
30   }
31   return false;
32 }
33
34 bool SQLHandler::HasColumn(HistoryAndBookmarkRow::ColumnID id) {
35   return columns_.find(id) != columns_.end();
36 }
37
38 }  // namespace history.