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

Unified Diff: chrome/browser/google_apis/gdata_wapi_service.cc

Issue 14146006: Refactoring: replace SearchInDirectory by SearchByTitle. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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/google_apis/gdata_wapi_service.cc
diff --git a/chrome/browser/google_apis/gdata_wapi_service.cc b/chrome/browser/google_apis/gdata_wapi_service.cc
index 9f3c6d33bed80683c8cecc64431b83da242d954e..876344bdd969d6eb9cdb9a8bf056e2e67ef9e44d 100644
--- a/chrome/browser/google_apis/gdata_wapi_service.cc
+++ b/chrome/browser/google_apis/gdata_wapi_service.cc
@@ -9,9 +9,11 @@
#include "base/bind.h"
#include "base/message_loop_proxy.h"
+#include "base/stringprintf.h"
#include "base/values.h"
#include "chrome/browser/google_apis/auth_service.h"
#include "chrome/browser/google_apis/drive_api_parser.h"
+#include "chrome/browser/google_apis/drive_api_util.h"
#include "chrome/browser/google_apis/gdata_wapi_operations.h"
#include "chrome/browser/google_apis/gdata_wapi_parser.h"
#include "chrome/browser/google_apis/gdata_wapi_url_generator.h"
@@ -221,13 +223,12 @@ void GDataWapiService::Search(const std::string& search_query,
callback));
}
-void GDataWapiService::SearchInDirectory(
- const std::string& search_query,
+void GDataWapiService::SearchByTitle(
+ const std::string& title,
const std::string& directory_resource_id,
const GetResourceListCallback& callback) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- DCHECK(!search_query.empty());
- DCHECK(!directory_resource_id.empty());
+ DCHECK(!title.empty());
DCHECK(!callback.is_null());
runner_->StartOperationWithRetry(
@@ -237,7 +238,9 @@ void GDataWapiService::SearchInDirectory(
url_generator_,
GURL(), // No override url
0, // start changestamp
- search_query,
+ base::StringPrintf(
+ "title:'%s'",
+ drive::util::EscapeQueryStringValue(title).c_str()),
directory_resource_id,
callback));
}

Powered by Google App Engine
This is Rietveld 408576698