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

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

Issue 10162019: Added 'folder' column in virtual table. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Init Created 8 years, 8 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
« no previous file with comments | « no previous file | chrome/browser/history/android/android_provider_backend_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/history/android/android_provider_backend.cc
diff --git a/chrome/browser/history/android/android_provider_backend.cc b/chrome/browser/history/android/android_provider_backend.cc
index 0261d36b7f6ad1745ee4a3087c7a797f3d9d1ffc..a1925b2f70afe957aecf0519a7e2b0db42b3cf9d 100644
--- a/chrome/browser/history/android/android_provider_backend.cc
+++ b/chrome/browser/history/android/android_provider_backend.cc
@@ -34,10 +34,17 @@ const char* kVirtualHistoryAndBookmarkTable =
"android_cache_db.bookmark_cache.last_visit_time AS date, "
"android_cache_db.bookmark_cache.bookmark AS bookmark, "
"android_cache_db.bookmark_cache.favicon_id AS favicon, "
- "urls.id AS url_id, urls.url AS urls_url "
+ "urls.id AS url_id, urls.url AS urls_url, "
+ // TODO (michaelbai) : Remove folder column once we remove it from Android
+ // framework.
+ // Android framework assumes 'folder' column exist in the table, the row is
+ // the bookmark once folder is 0, though it is not part of public API, it
+ // has to be added and set as 0 when the row is bookmark.
+ "(CASE WHEN android_cache_db.bookmark_cache.bookmark IS 0 "
+ "THEN 1 ELSE 0 END) as folder "
"FROM (android_urls JOIN urls on (android_urls.url_id = urls.id) "
- "LEFT JOIN android_cache_db.bookmark_cache AS bookmark_cache "
- "on (android_urls.url_id = bookmark_cache.url_id))";
+ "LEFT JOIN android_cache_db.bookmark_cache "
+ "on (android_urls.url_id = android_cache_db.bookmark_cache.url_id))";
const char * kURLUpdateClause =
"SELECT urls.id, urls.last_visit_time, created_time, urls.url "
« no previous file with comments | « no previous file | chrome/browser/history/android/android_provider_backend_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698