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

Unified Diff: chrome/browser/history/android/android_urls_sql_handler.cc

Issue 813503003: Move files from chrome/browser/history to components/history (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@favicon-owners
Patch Set: Add missing #include of base/macros.h Created 5 years, 11 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/browser/history/android/android_urls_sql_handler.cc
diff --git a/chrome/browser/history/android/android_urls_sql_handler.cc b/chrome/browser/history/android/android_urls_sql_handler.cc
deleted file mode 100644
index e7ea2dbe93e9406ffa7a44260d54446c1fc6ff94..0000000000000000000000000000000000000000
--- a/chrome/browser/history/android/android_urls_sql_handler.cc
+++ /dev/null
@@ -1,63 +0,0 @@
-// 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.
-
-#include "chrome/browser/history/android/android_urls_sql_handler.h"
-
-#include "base/logging.h"
-#include "components/history/core/android/android_urls_database.h"
-
-namespace history {
-
-namespace {
-
-// The interesting columns of this handler.
-const HistoryAndBookmarkRow::ColumnID kInterestingColumns[] = {
- HistoryAndBookmarkRow::RAW_URL, HistoryAndBookmarkRow::URL_ID };
-
-} // namespace
-
-AndroidURLsSQLHandler::AndroidURLsSQLHandler(
- AndroidURLsDatabase* android_urls_db)
- : SQLHandler(kInterestingColumns, arraysize(kInterestingColumns)),
- android_urls_db_(android_urls_db) {
-}
-
-AndroidURLsSQLHandler::~AndroidURLsSQLHandler() {
-}
-
-bool AndroidURLsSQLHandler::Update(const HistoryAndBookmarkRow& row,
- const TableIDRows& ids_set) {
- DCHECK(row.is_value_set_explicitly(HistoryAndBookmarkRow::URL_ID));
- DCHECK(row.is_value_set_explicitly(HistoryAndBookmarkRow::RAW_URL));
- if (ids_set.size() != 1)
- return false;
-
- AndroidURLRow android_url_row;
- if (!android_urls_db_->GetAndroidURLRow(ids_set[0].url_id, &android_url_row))
- return false;
-
- return android_urls_db_->UpdateAndroidURLRow(android_url_row.id,
- row.raw_url(), row.url_id());
-}
-
-bool AndroidURLsSQLHandler::Insert(HistoryAndBookmarkRow* row) {
- AndroidURLID new_id =
- android_urls_db_->AddAndroidURLRow(row->raw_url(), row->url_id());
- row->set_id(new_id);
- return new_id;
-}
-
-bool AndroidURLsSQLHandler::Delete(const TableIDRows& ids_set) {
- std::vector<URLID> ids;
- for (TableIDRows::const_iterator id = ids_set.begin();
- id != ids_set.end(); ++id)
- ids.push_back(id->url_id);
-
- if (!ids.size())
- return true;
-
- return android_urls_db_->DeleteAndroidURLRows(ids);
-}
-
-} // namespace history.
« no previous file with comments | « chrome/browser/history/android/android_urls_sql_handler.h ('k') | chrome/browser/history/android/urls_sql_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698