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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/history/android/android_provider_backend_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/history/android/android_provider_backend.h" 5 #include "chrome/browser/history/android/android_provider_backend.h"
6 6
7 #include "base/i18n/case_conversion.h" 7 #include "base/i18n/case_conversion.h"
8 #include "chrome/browser/bookmarks/bookmark_service.h" 8 #include "chrome/browser/bookmarks/bookmark_service.h"
9 #include "chrome/common/chrome_notification_types.h" 9 #include "chrome/common/chrome_notification_types.h"
10 #include "chrome/browser/history/android/android_time.h" 10 #include "chrome/browser/history/android/android_time.h"
(...skipping 16 matching lines...) Expand all
27 namespace { 27 namespace {
28 28
29 const char* kVirtualHistoryAndBookmarkTable = 29 const char* kVirtualHistoryAndBookmarkTable =
30 "SELECT android_urls.id AS _id, " 30 "SELECT android_urls.id AS _id, "
31 "android_cache_db.bookmark_cache.created_time AS created, " 31 "android_cache_db.bookmark_cache.created_time AS created, "
32 "urls.title AS title, android_urls.raw_url AS url, " 32 "urls.title AS title, android_urls.raw_url AS url, "
33 "urls.visit_count AS visits, " 33 "urls.visit_count AS visits, "
34 "android_cache_db.bookmark_cache.last_visit_time AS date, " 34 "android_cache_db.bookmark_cache.last_visit_time AS date, "
35 "android_cache_db.bookmark_cache.bookmark AS bookmark, " 35 "android_cache_db.bookmark_cache.bookmark AS bookmark, "
36 "android_cache_db.bookmark_cache.favicon_id AS favicon, " 36 "android_cache_db.bookmark_cache.favicon_id AS favicon, "
37 "urls.id AS url_id, urls.url AS urls_url " 37 "urls.id AS url_id, urls.url AS urls_url, "
38 // TODO (michaelbai) : Remove folder column once we remove it from Android
39 // framework.
40 // Android framework assumes 'folder' column exist in the table, the row is
41 // the bookmark once folder is 0, though it is not part of public API, it
42 // has to be added and set as 0 when the row is bookmark.
43 "(CASE WHEN android_cache_db.bookmark_cache.bookmark IS 0 "
44 "THEN 1 ELSE 0 END) as folder "
38 "FROM (android_urls JOIN urls on (android_urls.url_id = urls.id) " 45 "FROM (android_urls JOIN urls on (android_urls.url_id = urls.id) "
39 "LEFT JOIN android_cache_db.bookmark_cache AS bookmark_cache " 46 "LEFT JOIN android_cache_db.bookmark_cache "
40 "on (android_urls.url_id = bookmark_cache.url_id))"; 47 "on (android_urls.url_id = android_cache_db.bookmark_cache.url_id))";
41 48
42 const char * kURLUpdateClause = 49 const char * kURLUpdateClause =
43 "SELECT urls.id, urls.last_visit_time, created_time, urls.url " 50 "SELECT urls.id, urls.last_visit_time, created_time, urls.url "
44 "FROM urls LEFT JOIN " 51 "FROM urls LEFT JOIN "
45 "(SELECT url as visit_url, min(visit_time) as created_time" 52 "(SELECT url as visit_url, min(visit_time) as created_time"
46 " FROM visits GROUP BY url) ON (visit_url = urls.id) "; 53 " FROM visits GROUP BY url) ON (visit_url = urls.id) ";
47 54
48 const char* kSearchTermUpdateClause = 55 const char* kSearchTermUpdateClause =
49 "SELECT keyword_search_terms.term, max(urls.last_visit_time) " 56 "SELECT keyword_search_terms.term, max(urls.last_visit_time) "
50 "FROM keyword_search_terms JOIN urls ON " 57 "FROM keyword_search_terms JOIN urls ON "
(...skipping 1079 matching lines...) Expand 10 before | Expand all | Expand 10 after
1130 return false; 1137 return false;
1131 1138
1132 if (!history_db_->SetKeywordSearchTermsForURL(bookmark_row.url_id(), 1139 if (!history_db_->SetKeywordSearchTermsForURL(bookmark_row.url_id(),
1133 values.template_url_id(), values.search_term())) 1140 values.template_url_id(), values.search_term()))
1134 return false; 1141 return false;
1135 } 1142 }
1136 return true; 1143 return true;
1137 } 1144 }
1138 1145
1139 } // namespace history 1146 } // namespace history
OLDNEW
« 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