OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/extensions/extension_file_browser_private_api.h" | 5 #include "chrome/browser/extensions/extension_file_browser_private_api.h" |
6 | 6 |
7 #include "base/base64.h" | 7 #include "base/base64.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 return true; | 226 return true; |
227 } | 227 } |
228 | 228 |
229 // Update file handler usage stats. | 229 // Update file handler usage stats. |
230 void UpdateFileHandlerUsageStats(Profile* profile, const std::string& task_id) { | 230 void UpdateFileHandlerUsageStats(Profile* profile, const std::string& task_id) { |
231 if (!profile || !profile->GetPrefs()) | 231 if (!profile || !profile->GetPrefs()) |
232 return; | 232 return; |
233 DictionaryPrefUpdate prefs_usage_update(profile->GetPrefs(), | 233 DictionaryPrefUpdate prefs_usage_update(profile->GetPrefs(), |
234 prefs::kLastUsedFileBrowserHandlers); | 234 prefs::kLastUsedFileBrowserHandlers); |
235 prefs_usage_update->SetWithoutPathExpansion(task_id, | 235 prefs_usage_update->SetWithoutPathExpansion(task_id, |
236 new FundamentalValue( | 236 new base::FundamentalValue( |
237 static_cast<int>(base::Time::Now().ToInternalValue()/ | 237 static_cast<int>(base::Time::Now().ToInternalValue()/ |
238 base::Time::kMicrosecondsPerSecond))); | 238 base::Time::kMicrosecondsPerSecond))); |
239 } | 239 } |
240 | 240 |
241 #ifdef OS_CHROMEOS | 241 #ifdef OS_CHROMEOS |
242 base::DictionaryValue* MountPointToValue(Profile* profile, | 242 base::DictionaryValue* MountPointToValue(Profile* profile, |
243 const chromeos::MountLibrary::MountPointInfo& mount_point_info) { | 243 const chromeos::MountLibrary::MountPointInfo& mount_point_info) { |
244 | 244 |
245 base::DictionaryValue *mount_info = new base::DictionaryValue(); | 245 base::DictionaryValue *mount_info = new base::DictionaryValue(); |
246 | 246 |
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
791 file_urls.push_back(GURL(origin_file_url)); | 791 file_urls.push_back(GURL(origin_file_url)); |
792 } | 792 } |
793 // Get local file system instance on file thread. | 793 // Get local file system instance on file thread. |
794 BrowserThread::PostTask( | 794 BrowserThread::PostTask( |
795 BrowserThread::FILE, FROM_HERE, | 795 BrowserThread::FILE, FROM_HERE, |
796 NewRunnableMethod(this, | 796 NewRunnableMethod(this, |
797 &ExecuteTasksFileBrowserFunction::RequestFileEntryOnFileThread, | 797 &ExecuteTasksFileBrowserFunction::RequestFileEntryOnFileThread, |
798 source_url_, | 798 source_url_, |
799 task_id, | 799 task_id, |
800 file_urls)); | 800 file_urls)); |
801 result_.reset(new FundamentalValue(true)); | 801 result_.reset(new base::FundamentalValue(true)); |
802 return true; | 802 return true; |
803 } | 803 } |
804 | 804 |
805 void ExecuteTasksFileBrowserFunction::RequestFileEntryOnFileThread( | 805 void ExecuteTasksFileBrowserFunction::RequestFileEntryOnFileThread( |
806 const GURL& source_url, const std::string& task_id, | 806 const GURL& source_url, const std::string& task_id, |
807 const std::vector<GURL>& file_urls) { | 807 const std::vector<GURL>& file_urls) { |
808 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); | 808 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
809 fileapi::FileSystemOperation* operation = | 809 fileapi::FileSystemOperation* operation = |
810 new fileapi::FileSystemOperation( | 810 new fileapi::FileSystemOperation( |
811 new ExecuteTasksFileSystemCallbackDispatcher( | 811 new ExecuteTasksFileSystemCallbackDispatcher( |
(...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1471 #undef SET_STRING | 1471 #undef SET_STRING |
1472 | 1472 |
1473 // TODO(serya): Create a new string in .grd file for this one in M13. | 1473 // TODO(serya): Create a new string in .grd file for this one in M13. |
1474 dict->SetString("PREVIEW_IMAGE", | 1474 dict->SetString("PREVIEW_IMAGE", |
1475 l10n_util::GetStringUTF16(IDS_CERT_MANAGER_VIEW_CERT_BUTTON)); | 1475 l10n_util::GetStringUTF16(IDS_CERT_MANAGER_VIEW_CERT_BUTTON)); |
1476 dict->SetString("PLAY_MEDIA", | 1476 dict->SetString("PLAY_MEDIA", |
1477 l10n_util::GetStringUTF16(IDS_CONTENT_CONTEXT_PLAY)); | 1477 l10n_util::GetStringUTF16(IDS_CONTENT_CONTEXT_PLAY)); |
1478 | 1478 |
1479 return true; | 1479 return true; |
1480 } | 1480 } |
OLD | NEW |