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

Side by Side Diff: chrome/browser/chromeos/gdata/drive_task_executor.cc

Issue 10877006: Rename GDataErrorCode to DriveErrorCode, GDataFileError to DriveFileError (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase. 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chromeos/gdata/drive_task_executor.h" 5 #include "chrome/browser/chromeos/gdata/drive_task_executor.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/json/json_writer.h" 10 #include "base/json/json_writer.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 for (std::vector<FilePath>::const_iterator iter = raw_paths.begin(); 72 for (std::vector<FilePath>::const_iterator iter = raw_paths.begin();
73 iter != raw_paths.end(); ++iter) { 73 iter != raw_paths.end(); ++iter) {
74 file_system->GetEntryInfoByPath( 74 file_system->GetEntryInfoByPath(
75 *iter, 75 *iter,
76 base::Bind(&DriveTaskExecutor::OnFileEntryFetched, this)); 76 base::Bind(&DriveTaskExecutor::OnFileEntryFetched, this));
77 } 77 }
78 return true; 78 return true;
79 } 79 }
80 80
81 void DriveTaskExecutor::OnFileEntryFetched( 81 void DriveTaskExecutor::OnFileEntryFetched(
82 GDataFileError error, 82 DriveFileError error,
83 scoped_ptr<DriveEntryProto> entry_proto) { 83 scoped_ptr<DriveEntryProto> entry_proto) {
84 // If we aborted, then this will be zero. 84 // If we aborted, then this will be zero.
85 if (!current_index_) 85 if (!current_index_)
86 return; 86 return;
87 87
88 GDataSystemService* system_service = 88 GDataSystemService* system_service =
89 GDataSystemServiceFactory::GetForProfile(profile()); 89 GDataSystemServiceFactory::GetForProfile(profile());
90 90
91 // Here, we are only insterested in files. 91 // Here, we are only insterested in files.
92 if (entry_proto.get() && !entry_proto->has_file_specific_info()) 92 if (entry_proto.get() && !entry_proto->has_file_specific_info())
93 error = GDATA_FILE_ERROR_NOT_FOUND; 93 error = DRIVE_FILE_ERROR_NOT_FOUND;
94 94
95 if (!system_service || error != GDATA_FILE_OK) { 95 if (!system_service || error != DRIVE_FILE_OK) {
96 Done(false); 96 Done(false);
97 return; 97 return;
98 } 98 }
99 99
100 DriveServiceInterface* drive_service = 100 DriveServiceInterface* drive_service =
101 system_service->drive_service(); 101 system_service->drive_service();
102 102
103 // Send off a request for the drive service to authorize the apps for the 103 // Send off a request for the drive service to authorize the apps for the
104 // current document entry for this document so we can get the 104 // current document entry for this document so we can get the
105 // open-with-<app_id> urls from the document entry. 105 // open-with-<app_id> urls from the document entry.
106 drive_service->AuthorizeApp( 106 drive_service->AuthorizeApp(
107 GURL(entry_proto->edit_url()), 107 GURL(entry_proto->edit_url()),
108 app_id_, 108 app_id_,
109 base::Bind(&DriveTaskExecutor::OnAppAuthorized, 109 base::Bind(&DriveTaskExecutor::OnAppAuthorized,
110 this, 110 this,
111 entry_proto->resource_id())); 111 entry_proto->resource_id()));
112 } 112 }
113 113
114 void DriveTaskExecutor::OnAppAuthorized( 114 void DriveTaskExecutor::OnAppAuthorized(
115 const std::string& resource_id, 115 const std::string& resource_id,
116 GDataErrorCode error, 116 DriveErrorCode error,
117 scoped_ptr<base::Value> feed_data) { 117 scoped_ptr<base::Value> feed_data) {
118 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); 118 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
119 119
120 // If we aborted, then this will be zero. 120 // If we aborted, then this will be zero.
121 if (!current_index_) 121 if (!current_index_)
122 return; 122 return;
123 123
124 GDataSystemService* system_service = 124 GDataSystemService* system_service =
125 GDataSystemServiceFactory::GetForProfile(profile()); 125 GDataSystemServiceFactory::GetForProfile(profile());
126 126
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 167
168 void DriveTaskExecutor::Done(bool success) { 168 void DriveTaskExecutor::Done(bool success) {
169 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); 169 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
170 current_index_ = 0; 170 current_index_ = 0;
171 if (!done_.is_null()) 171 if (!done_.is_null())
172 done_.Run(success); 172 done_.Run(success);
173 done_.Reset(); 173 done_.Reset();
174 } 174 }
175 175
176 } // namespace gdata 176 } // namespace gdata
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698