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

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

Issue 12880013: Move parsing code from gdata_wapi_service to gdata_wapi_operations. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments. Created 7 years, 9 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/google_apis/gdata_wapi_operations_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 7aa8b54e46a49635f184e614b6cd3ddb1449f860..ee604b6987484d58c2ddf8b839579e7f7f760f0d 100644
--- a/chrome/browser/google_apis/gdata_wapi_service.cc
+++ b/chrome/browser/google_apis/gdata_wapi_service.cc
@@ -105,32 +105,6 @@ void ParseResourceEntryAndRun(const GetResourceEntryCallback& callback,
callback.Run(error, entry.Pass());
}
-// Extracts the open link url from the JSON Feed. Used by AuthorizeApp().
-void ExtractOpenLinkAndRun(const std::string app_id,
- const AuthorizeAppCallback& callback,
- GDataErrorCode error,
- scoped_ptr<ResourceEntry> entry) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
-
- // Entry not found in the feed.
- if (!entry) {
- callback.Run(error, GURL());
- return;
- }
-
- const ScopedVector<google_apis::Link>& resource_links = entry->links();
- GURL open_link;
- for (size_t i = 0; i < resource_links.size(); ++i) {
- if (resource_links[i]->type() == google_apis::Link::LINK_OPEN_WITH &&
- resource_links[i]->app_id() == app_id) {
- open_link = resource_links[i]->href();
- break;
- }
- }
-
- callback.Run(error, open_link);
-}
-
void ParseAboutResourceAndRun(
const GetAboutResourceCallback& callback,
GDataErrorCode error,
@@ -541,8 +515,7 @@ void GDataWapiService::AuthorizeApp(const std::string& resource_id,
operation_registry(),
url_request_context_getter_,
url_generator_,
- base::Bind(&ParseResourceEntryAndRun,
- base::Bind(&ExtractOpenLinkAndRun, app_id, callback)),
+ callback,
resource_id,
app_id));
}
« no previous file with comments | « chrome/browser/google_apis/gdata_wapi_operations_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698