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

Side by Side Diff: chrome/browser/history/android/android_provider_backend.cc

Issue 11085008: [Android] Upstream content detection and ChromeBrowserProvider tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase after landing resources separately. Created 8 years, 2 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
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/api/bookmarks/bookmark_service.h" 8 #include "chrome/browser/api/bookmarks/bookmark_service.h"
9 #include "chrome/browser/history/android/android_time.h" 9 #include "chrome/browser/history/android/android_time.h"
10 #include "chrome/browser/history/android/android_urls_sql_handler.h" 10 #include "chrome/browser/history/android/android_urls_sql_handler.h"
(...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after
617 if (!id) 617 if (!id)
618 // Note the passed in Time() will be changed in UpdateSearchTermTable(). 618 // Note the passed in Time() will be changed in UpdateSearchTermTable().
619 id = history_db_->AddSearchTerm(values.search_term(), Time()); 619 id = history_db_->AddSearchTerm(values.search_term(), Time());
620 return id; 620 return id;
621 } 621 }
622 622
623 bool AndroidProviderBackend::DeleteSearchTerms( 623 bool AndroidProviderBackend::DeleteSearchTerms(
624 const std::string& selection, 624 const std::string& selection,
625 const std::vector<string16>& selection_args, 625 const std::vector<string16>& selection_args,
626 int * deleted_count) { 626 int * deleted_count) {
627 if (!EnsureInitializedAndUpdated())
628 return false;
629
627 SearchTerms rows; 630 SearchTerms rows;
628 if (!GetSelectedSearchTerms(selection, selection_args, &rows)) 631 if (!GetSelectedSearchTerms(selection, selection_args, &rows))
629 return false; 632 return false;
630 633
631 *deleted_count = rows.size(); 634 *deleted_count = rows.size();
632 if (rows.empty()) 635 if (rows.empty())
633 return true; 636 return true;
634 637
635 for (SearchTerms::const_iterator i = rows.begin(); i != rows.end(); ++i) 638 for (SearchTerms::const_iterator i = rows.begin(); i != rows.end(); ++i)
636 if (!history_db_->DeleteKeywordSearchTerm(*i)) 639 if (!history_db_->DeleteKeywordSearchTerm(*i))
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after
1166 return false; 1169 return false;
1167 1170
1168 if (!history_db_->SetKeywordSearchTermsForURL(bookmark_row.url_id(), 1171 if (!history_db_->SetKeywordSearchTermsForURL(bookmark_row.url_id(),
1169 values.template_url_id(), values.search_term())) 1172 values.template_url_id(), values.search_term()))
1170 return false; 1173 return false;
1171 } 1174 }
1172 return true; 1175 return true;
1173 } 1176 }
1174 1177
1175 } // namespace history 1178 } // namespace history
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698