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

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

Issue 10829276: Get web application list using Drive V2 API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix nits. Created 8 years, 4 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_wapi_feed_loader.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/gdata/gdata_wapi_feed_loader.cc
diff --git a/chrome/browser/chromeos/gdata/gdata_wapi_feed_loader.cc b/chrome/browser/chromeos/gdata/gdata_wapi_feed_loader.cc
index 569c081de340a15781def5bd99eddd7ec5b971fb..2c81732fec3e1d7fb26a5c09254ab8c923d30e85 100644
--- a/chrome/browser/chromeos/gdata/gdata_wapi_feed_loader.cc
+++ b/chrome/browser/chromeos/gdata/gdata_wapi_feed_loader.cc
@@ -254,6 +254,12 @@ void GDataWapiFeedLoader::ReloadFromServerIfNeeded(
local_changestamp,
search_file_path,
callback));
+ // Drive v2 needs a separate application list fetch operation.
+ // TODO(kochi): Application list rarely changes and do not necessarily
+ // refresed as often as files.
+ documents_service_->GetApplicationList(
+ base::Bind(&GDataWapiFeedLoader::OnGetApplicationList,
+ weak_ptr_factory_.GetWeakPtr()));
return;
}
@@ -321,7 +327,7 @@ void GDataWapiFeedLoader::OnGetAccountMetadata(
return;
}
- webapps_registry_->UpdateFromFeed(account_metadata.get());
+ webapps_registry_->UpdateFromFeed(*account_metadata.get());
bool changes_detected = true;
if (local_changestamp >= account_metadata->largest_changestamp()) {
@@ -445,6 +451,24 @@ void GDataWapiFeedLoader::OnGetAboutResource(
weak_ptr_factory_.GetWeakPtr()));
}
+void GDataWapiFeedLoader::OnGetApplicationList(
+ GDataErrorCode status,
+ scoped_ptr<base::Value> json) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+
+ GDataFileError error = util::GDataToGDataFileError(status);
+ if (error != GDATA_FILE_OK)
+ return;
+
+ if (json.get()) {
+ scoped_ptr<AppList> applist(AppList::CreateFrom(*json));
+ if (applist.get()) {
+ VLOG(1) << "applist get success";
+ webapps_registry_->UpdateFromApplicationList(*applist.get());
+ }
+ }
+}
+
// TODO(kochi): Fix too many parameters. http://crbug.com/141359
void GDataWapiFeedLoader::LoadFromServer(
ContentOrigin initial_origin,
« no previous file with comments | « chrome/browser/chromeos/gdata/gdata_wapi_feed_loader.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698