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

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: style nits Created 8 years, 7 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 | « chrome/browser/chromeos/gdata/gdata_operations.h ('k') | chrome/browser/chromeos/gdata/gdata_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2ea5887db0f2d3ce88d278bf4901d22ddc4da2a5..72ac4f95a2d48aebafa469f62a11cb09821d4ee1 100644
--- a/chrome/browser/chromeos/gdata/gdata_operations.cc
+++ b/chrome/browser/chromeos/gdata/gdata_operations.cc
@@ -107,8 +107,10 @@ GURL AddMetadataUrlParams(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,
@@ -125,6 +127,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;
}
@@ -456,9 +463,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() {}
@@ -469,17 +478,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 ========================
« no previous file with comments | « chrome/browser/chromeos/gdata/gdata_operations.h ('k') | chrome/browser/chromeos/gdata/gdata_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698