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

Side by Side Diff: chrome/browser/chromeos/extensions/file_manager/private_api_tasks.cc

Issue 101323002: Stop setting invalid value to the |tab_id| field of fileBrowserHandler API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/extensions/file_manager/private_api_util.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/extensions/file_manager/private_api_tasks.h" 5 #include "chrome/browser/chromeos/extensions/file_manager/private_api_tasks.h"
6 6
7 #include "chrome/browser/chromeos/drive/file_system_util.h" 7 #include "chrome/browser/chromeos/drive/file_system_util.h"
8 #include "chrome/browser/chromeos/extensions/file_manager/private_api_util.h" 8 #include "chrome/browser/chromeos/extensions/file_manager/private_api_util.h"
9 #include "chrome/browser/chromeos/file_manager/file_tasks.h" 9 #include "chrome/browser/chromeos/file_manager/file_tasks.h"
10 #include "chrome/browser/chromeos/file_manager/fileapi_util.h" 10 #include "chrome/browser/chromeos/file_manager/fileapi_util.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 for (size_t i = 0; i < params->file_urls.size(); i++) { 82 for (size_t i = 0; i < params->file_urls.size(); i++) {
83 const FileSystemURL url = 83 const FileSystemURL url =
84 file_system_context->CrackURL(GURL(params->file_urls[i])); 84 file_system_context->CrackURL(GURL(params->file_urls[i]));
85 if (!chromeos::FileSystemBackend::CanHandleURL(url)) { 85 if (!chromeos::FileSystemBackend::CanHandleURL(url)) {
86 error_ = kInvalidFileUrl; 86 error_ = kInvalidFileUrl;
87 return false; 87 return false;
88 } 88 }
89 file_urls.push_back(url); 89 file_urls.push_back(url);
90 } 90 }
91 91
92 const int32 tab_id = file_manager::util::GetTabId(dispatcher());
93 return file_manager::file_tasks::ExecuteFileTask( 92 return file_manager::file_tasks::ExecuteFileTask(
94 GetProfile(), 93 GetProfile(),
95 source_url(), 94 source_url(),
96 extension_->id(), 95 extension_->id(),
97 tab_id,
98 task, 96 task,
99 file_urls, 97 file_urls,
100 base::Bind(&FileBrowserPrivateExecuteTaskFunction::OnTaskExecuted, this)); 98 base::Bind(&FileBrowserPrivateExecuteTaskFunction::OnTaskExecuted, this));
101 } 99 }
102 100
103 void FileBrowserPrivateExecuteTaskFunction::OnTaskExecuted(bool success) { 101 void FileBrowserPrivateExecuteTaskFunction::OnTaskExecuted(bool success) {
104 SetResult(new base::FundamentalValue(success)); 102 SetResult(new base::FundamentalValue(success));
105 SendResponse(true); 103 SendResponse(true);
106 } 104 }
107 105
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 SetResult(new base::FundamentalValue(true)); 203 SetResult(new base::FundamentalValue(true));
206 return true; 204 return true;
207 } 205 }
208 206
209 file_manager::file_tasks::UpdateDefaultTask( 207 file_manager::file_tasks::UpdateDefaultTask(
210 GetProfile()->GetPrefs(), params->task_id, suffixes, mime_types); 208 GetProfile()->GetPrefs(), params->task_id, suffixes, mime_types);
211 return true; 209 return true;
212 } 210 }
213 211
214 } // namespace extensions 212 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/extensions/file_manager/private_api_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698