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::FILE, FROM_HERE, | |
dgozman
2012/05/22 14:55:27
FILE -> UI
Dmitry Zvorygin
2012/05/22 15:11:10
Done.
| |
647 base::Bind( | |
648 &file_handler_util::UpdateFileHandlerUsageStats, | |
649 profile_, task_id)); | |
650 | |
651 result_.reset(new base::FundamentalValue(true)); | |
652 SendResponse(true); | |
653 return true; | |
654 } | |
655 | |
635 FileBrowserFunction::FileBrowserFunction() { | 656 FileBrowserFunction::FileBrowserFunction() { |
636 } | 657 } |
637 | 658 |
638 FileBrowserFunction::~FileBrowserFunction() { | 659 FileBrowserFunction::~FileBrowserFunction() { |
639 } | 660 } |
640 | 661 |
641 int32 FileBrowserFunction::GetTabId() const { | 662 int32 FileBrowserFunction::GetTabId() const { |
642 if (!dispatcher()) { | 663 if (!dispatcher()) { |
643 LOG(WARNING) << "No dispatcher"; | 664 LOG(WARNING) << "No dispatcher"; |
644 return 0; | 665 return 0; |
(...skipping 1496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2141 gdata::GDataSystemService* system_service = | 2162 gdata::GDataSystemService* system_service = |
2142 gdata::GDataSystemServiceFactory::GetForProfile(profile_); | 2163 gdata::GDataSystemServiceFactory::GetForProfile(profile_); |
2143 if (!system_service || !system_service->file_system()) | 2164 if (!system_service || !system_service->file_system()) |
2144 return false; | 2165 return false; |
2145 | 2166 |
2146 FilePath directory_path = GetVirtualPathFromURL(GURL(file_url_as_string)); | 2167 FilePath directory_path = GetVirtualPathFromURL(GURL(file_url_as_string)); |
2147 system_service->file_system()->RequestDirectoryRefresh(directory_path); | 2168 system_service->file_system()->RequestDirectoryRefresh(directory_path); |
2148 | 2169 |
2149 return true; | 2170 return true; |
2150 } | 2171 } |
OLD | NEW |