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 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
625 return false; | 625 return false; |
626 | 626 |
627 result_.reset(new base::FundamentalValue(true)); | 627 result_.reset(new base::FundamentalValue(true)); |
628 return true; | 628 return true; |
629 } | 629 } |
630 | 630 |
631 void ExecuteTasksFileBrowserFunction::OnTaskExecuted(bool success) { | 631 void ExecuteTasksFileBrowserFunction::OnTaskExecuted(bool success) { |
632 SendResponse(success); | 632 SendResponse(success); |
633 } | 633 } |
634 | 634 |
| 635 SetDefaultTaskFileBrowserFunction::SetDefaultTaskFileBrowserFunction() {} |
| 636 |
| 637 SetDefaultTaskFileBrowserFunction::~SetDefaultTaskFileBrowserFunction() {} |
| 638 |
| 639 bool SetDefaultTaskFileBrowserFunction::RunImpl() { |
| 640 // First param is task id that was to the extension with setDefaultTask call. |
| 641 std::string task_id; |
| 642 if (!args_->GetString(0, &task_id) || !task_id.size()) |
| 643 return false; |
| 644 |
| 645 BrowserThread::PostTask( |
| 646 BrowserThread::UI, FROM_HERE, |
| 647 base::Bind( |
| 648 &file_handler_util::UpdateFileHandlerUsageStats, |
| 649 profile_, task_id)); |
| 650 |
| 651 result_.reset(new base::FundamentalValue(true)); |
| 652 return true; |
| 653 } |
| 654 |
635 FileBrowserFunction::FileBrowserFunction() { | 655 FileBrowserFunction::FileBrowserFunction() { |
636 } | 656 } |
637 | 657 |
638 FileBrowserFunction::~FileBrowserFunction() { | 658 FileBrowserFunction::~FileBrowserFunction() { |
639 } | 659 } |
640 | 660 |
641 int32 FileBrowserFunction::GetTabId() const { | 661 int32 FileBrowserFunction::GetTabId() const { |
642 if (!dispatcher()) { | 662 if (!dispatcher()) { |
643 LOG(WARNING) << "No dispatcher"; | 663 LOG(WARNING) << "No dispatcher"; |
644 return 0; | 664 return 0; |
(...skipping 1497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2142 gdata::GDataSystemService* system_service = | 2162 gdata::GDataSystemService* system_service = |
2143 gdata::GDataSystemServiceFactory::GetForProfile(profile_); | 2163 gdata::GDataSystemServiceFactory::GetForProfile(profile_); |
2144 if (!system_service || !system_service->file_system()) | 2164 if (!system_service || !system_service->file_system()) |
2145 return false; | 2165 return false; |
2146 | 2166 |
2147 FilePath directory_path = GetVirtualPathFromURL(GURL(file_url_as_string)); | 2167 FilePath directory_path = GetVirtualPathFromURL(GURL(file_url_as_string)); |
2148 system_service->file_system()->RequestDirectoryRefresh(directory_path); | 2168 system_service->file_system()->RequestDirectoryRefresh(directory_path); |
2149 | 2169 |
2150 return true; | 2170 return true; |
2151 } | 2171 } |
OLD | NEW |