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

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

Issue 10834383: Chrome OS "open with" picker allowing Web Intents (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: tiny 80 chars fix Created 8 years, 3 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
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 18 matching lines...) Expand all
29 using file_handler_util::FileTaskExecutor; 29 using file_handler_util::FileTaskExecutor;
30 30
31 DriveTaskExecutor::DriveTaskExecutor(Profile* profile, 31 DriveTaskExecutor::DriveTaskExecutor(Profile* profile,
32 const std::string& app_id, 32 const std::string& app_id,
33 const std::string& action_id) 33 const std::string& action_id)
34 : file_handler_util::FileTaskExecutor(profile), 34 : file_handler_util::FileTaskExecutor(profile),
35 app_id_(app_id), 35 app_id_(app_id),
36 action_id_(action_id), 36 action_id_(action_id),
37 current_index_(0) { 37 current_index_(0) {
38 DCHECK("open-with" == action_id_); 38 DCHECK("open-with" == action_id_);
39 DCHECK(app_id.size() > FileTaskExecutor::kDriveTaskExtensionPrefixLength);
40 DCHECK(StartsWithASCII(app_id,
41 FileTaskExecutor::kDriveTaskExtensionPrefix,
42 false));
43 // Strip off the prefix from the extension ID so we convert it to an app id.
44 app_id_ = app_id_.substr(FileTaskExecutor::kDriveTaskExtensionPrefixLength);
45 } 39 }
46 40
47 DriveTaskExecutor::~DriveTaskExecutor() { 41 DriveTaskExecutor::~DriveTaskExecutor() {
48 } 42 }
49 43
50 bool DriveTaskExecutor::ExecuteAndNotify( 44 bool DriveTaskExecutor::ExecuteAndNotify(
51 const std::vector<GURL>& file_urls, 45 const std::vector<GURL>& file_urls,
52 const file_handler_util::FileTaskFinishedCallback& done) { 46 const file_handler_util::FileTaskFinishedCallback& done) {
53 std::vector<FilePath> raw_paths; 47 std::vector<FilePath> raw_paths;
54 for (std::vector<GURL>::const_iterator iter = file_urls.begin(); 48 for (std::vector<GURL>::const_iterator iter = file_urls.begin();
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 161
168 void DriveTaskExecutor::Done(bool success) { 162 void DriveTaskExecutor::Done(bool success) {
169 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); 163 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
170 current_index_ = 0; 164 current_index_ = 0;
171 if (!done_.is_null()) 165 if (!done_.is_null())
172 done_.Run(success); 166 done_.Run(success);
173 done_.Reset(); 167 done_.Reset();
174 } 168 }
175 169
176 } // namespace gdata 170 } // namespace gdata
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698