| OLD | NEW |
| 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/extensions/file_browser_private_api.h" | 5 #include "chrome/browser/chromeos/extensions/file_browser_private_api.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/base64.h" | 9 #include "base/base64.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 1844 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1855 | 1855 |
| 1856 GetFileTransfersFunction::~GetFileTransfersFunction() {} | 1856 GetFileTransfersFunction::~GetFileTransfersFunction() {} |
| 1857 | 1857 |
| 1858 ListValue* GetFileTransfersFunction::GetFileTransfersList() { | 1858 ListValue* GetFileTransfersFunction::GetFileTransfersList() { |
| 1859 gdata::GDataSystemService* system_service = | 1859 gdata::GDataSystemService* system_service = |
| 1860 gdata::GDataSystemServiceFactory::GetForProfile(profile_); | 1860 gdata::GDataSystemServiceFactory::GetForProfile(profile_); |
| 1861 if (!system_service) | 1861 if (!system_service) |
| 1862 return NULL; | 1862 return NULL; |
| 1863 | 1863 |
| 1864 std::vector<gdata::GDataOperationRegistry::ProgressStatus> | 1864 std::vector<gdata::GDataOperationRegistry::ProgressStatus> |
| 1865 list = system_service->file_system()->GetOperationRegistry()-> | 1865 list = system_service->docs_service()->operation_registry()-> |
| 1866 GetProgressStatusList(); | 1866 GetProgressStatusList(); |
| 1867 return file_manager_util::ProgressStatusVectorToListValue( | 1867 return file_manager_util::ProgressStatusVectorToListValue( |
| 1868 profile_, source_url_.GetOrigin(), list); | 1868 profile_, source_url_.GetOrigin(), list); |
| 1869 } | 1869 } |
| 1870 | 1870 |
| 1871 bool GetFileTransfersFunction::RunImpl() { | 1871 bool GetFileTransfersFunction::RunImpl() { |
| 1872 scoped_ptr<ListValue> progress_status_list(GetFileTransfersList()); | 1872 scoped_ptr<ListValue> progress_status_list(GetFileTransfersList()); |
| 1873 if (!progress_status_list.get()) { | 1873 if (!progress_status_list.get()) { |
| 1874 SendResponse(false); | 1874 SendResponse(false); |
| 1875 return false; | 1875 return false; |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1912 const SelectedFileInfoList& files) { | 1912 const SelectedFileInfoList& files) { |
| 1913 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 1913 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 1914 gdata::GDataSystemService* system_service = | 1914 gdata::GDataSystemService* system_service = |
| 1915 gdata::GDataSystemServiceFactory::GetForProfile(profile_); | 1915 gdata::GDataSystemServiceFactory::GetForProfile(profile_); |
| 1916 if (!system_service) { | 1916 if (!system_service) { |
| 1917 SendResponse(false); | 1917 SendResponse(false); |
| 1918 return; | 1918 return; |
| 1919 } | 1919 } |
| 1920 | 1920 |
| 1921 gdata::GDataOperationRegistry* operation_registry = | 1921 gdata::GDataOperationRegistry* operation_registry = |
| 1922 system_service->file_system()->GetOperationRegistry(); | 1922 system_service->docs_service()->operation_registry(); |
| 1923 | 1923 |
| 1924 scoped_ptr<ListValue> responses(new ListValue()); | 1924 scoped_ptr<ListValue> responses(new ListValue()); |
| 1925 for (size_t i = 0; i < files.size(); ++i) { | 1925 for (size_t i = 0; i < files.size(); ++i) { |
| 1926 DCHECK(gdata::util::IsUnderGDataMountPoint(files[i].path)); | 1926 DCHECK(gdata::util::IsUnderGDataMountPoint(files[i].path)); |
| 1927 FilePath file_path = gdata::util::ExtractGDataPath(files[i].path); | 1927 FilePath file_path = gdata::util::ExtractGDataPath(files[i].path); |
| 1928 scoped_ptr<DictionaryValue> result(new DictionaryValue()); | 1928 scoped_ptr<DictionaryValue> result(new DictionaryValue()); |
| 1929 result->SetBoolean( | 1929 result->SetBoolean( |
| 1930 "canceled", | 1930 "canceled", |
| 1931 operation_registry->CancelForFilePath(file_path)); | 1931 operation_registry->CancelForFilePath(file_path)); |
| 1932 GURL file_url; | 1932 GURL file_url; |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2129 gdata::GDataSystemService* system_service = | 2129 gdata::GDataSystemService* system_service = |
| 2130 gdata::GDataSystemServiceFactory::GetForProfile(profile_); | 2130 gdata::GDataSystemServiceFactory::GetForProfile(profile_); |
| 2131 if (!system_service || !system_service->file_system()) | 2131 if (!system_service || !system_service->file_system()) |
| 2132 return false; | 2132 return false; |
| 2133 | 2133 |
| 2134 FilePath directory_path = GetVirtualPathFromURL(GURL(file_url_as_string)); | 2134 FilePath directory_path = GetVirtualPathFromURL(GURL(file_url_as_string)); |
| 2135 system_service->file_system()->RequestDirectoryRefresh(directory_path); | 2135 system_service->file_system()->RequestDirectoryRefresh(directory_path); |
| 2136 | 2136 |
| 2137 return true; | 2137 return true; |
| 2138 } | 2138 } |
| OLD | NEW |