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

Unified Diff: chrome/browser/chromeos/gdata/gdata_operations.cc

Issue 10274002: Add gdata content search (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix renaming 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
Index: chrome/browser/chromeos/gdata/gdata_operations.cc
diff --git a/chrome/browser/chromeos/gdata/gdata_operations.cc b/chrome/browser/chromeos/gdata/gdata_operations.cc
index 81158a7480cd42a52069087374dacd9836f22334..cccf1d7a117be06b7496498a23608d1f1e2d03c3 100644
--- a/chrome/browser/chromeos/gdata/gdata_operations.cc
+++ b/chrome/browser/chromeos/gdata/gdata_operations.cc
@@ -98,8 +98,10 @@ GURL AddStandardUrlParams(const GURL& url) {
// Adds additional parameters for API version, output content type and to show
// folders in the feed are added to document feed URLs.
-GURL AddFeedUrlParams(const GURL& url, int num_items_to_fetch,
- int changestamp) {
+GURL AddFeedUrlParams(const GURL& url,
+ int num_items_to_fetch,
+ int changestamp,
+ const std::string& search_string) {
GURL result = AddStandardUrlParams(url);
result = chrome_browser_net::AppendOrReplaceQueryParameter(
result,
@@ -116,6 +118,11 @@ GURL AddFeedUrlParams(const GURL& url, int num_items_to_fetch,
"start-index",
base::StringPrintf("%d", changestamp));
}
+
+ if (!search_string.empty()) {
+ result = chrome_browser_net::AppendOrReplaceQueryParameter(
+ result, "q", search_string);
+ }
return result;
}
@@ -447,9 +454,11 @@ base::Value* GetDataOperation::ParseResponse(const std::string& data) {
GetDocumentsOperation::GetDocumentsOperation(GDataOperationRegistry* registry,
Profile* profile,
int start_changestamp,
+ const std::string& search_string,
const GetDataCallback& callback)
: GetDataOperation(registry, profile, callback),
- start_changestamp_(start_changestamp) {
+ start_changestamp_(start_changestamp),
+ search_string_(search_string) {
}
GetDocumentsOperation::~GetDocumentsOperation() {}
@@ -460,17 +469,22 @@ void GetDocumentsOperation::SetUrl(const GURL& url) {
GURL GetDocumentsOperation::GetURL() const {
if (!override_url_.is_empty())
- return AddFeedUrlParams(override_url_, kMaxDocumentsPerFeed, 0);
+ return AddFeedUrlParams(override_url_,
+ kMaxDocumentsPerFeed,
+ 0,
+ std::string());
if (start_changestamp_ == 0) {
return AddFeedUrlParams(GURL(kGetDocumentListURL),
kMaxDocumentsPerFeed,
- 0);
+ 0,
+ search_string_);
}
return AddFeedUrlParams(GURL(kGetChangesListURL),
kMaxDocumentsPerFeed,
- start_changestamp_);
+ start_changestamp_,
+ std::string());
}
//========================= GetAccountMetadataOperation ========================

Powered by Google App Engine
This is Rietveld 408576698