| 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_manager/file_manager_event_rou
ter.h" | 5 #include "chrome/browser/chromeos/extensions/file_manager/file_manager_event_rou
ter.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/prefs/pref_change_registrar.h" | 10 #include "base/prefs/pref_change_registrar.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 } | 92 } |
| 93 NOTREACHED(); | 93 NOTREACHED(); |
| 94 return ""; | 94 return ""; |
| 95 } | 95 } |
| 96 | 96 |
| 97 void DirectoryExistsOnBlockingPool(const base::FilePath& directory_path, | 97 void DirectoryExistsOnBlockingPool(const base::FilePath& directory_path, |
| 98 const base::Closure& success_callback, | 98 const base::Closure& success_callback, |
| 99 const base::Closure& failure_callback) { | 99 const base::Closure& failure_callback) { |
| 100 DCHECK(BrowserThread::GetBlockingPool()->RunsTasksOnCurrentThread()); | 100 DCHECK(BrowserThread::GetBlockingPool()->RunsTasksOnCurrentThread()); |
| 101 | 101 |
| 102 if (file_util::DirectoryExists(directory_path)) | 102 if (base::DirectoryExists(directory_path)) |
| 103 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, success_callback); | 103 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, success_callback); |
| 104 else | 104 else |
| 105 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, failure_callback); | 105 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, failure_callback); |
| 106 }; | 106 }; |
| 107 | 107 |
| 108 void DirectoryExistsOnUIThread(const base::FilePath& directory_path, | 108 void DirectoryExistsOnUIThread(const base::FilePath& directory_path, |
| 109 const base::Closure& success_callback, | 109 const base::Closure& success_callback, |
| 110 const base::Closure& failure_callback) { | 110 const base::Closure& failure_callback) { |
| 111 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 111 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 112 | 112 |
| (...skipping 721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 834 DiskMountManager::GetInstance()->MountPath(device_path, std::string(), | 834 DiskMountManager::GetInstance()->MountPath(device_path, std::string(), |
| 835 std::string(), | 835 std::string(), |
| 836 chromeos::MOUNT_TYPE_DEVICE); | 836 chromeos::MOUNT_TYPE_DEVICE); |
| 837 } else { | 837 } else { |
| 838 notifications_->HideNotification(FileManagerNotifications::FORMAT_START, | 838 notifications_->HideNotification(FileManagerNotifications::FORMAT_START, |
| 839 device_path); | 839 device_path); |
| 840 notifications_->ShowNotification(FileManagerNotifications::FORMAT_FAIL, | 840 notifications_->ShowNotification(FileManagerNotifications::FORMAT_FAIL, |
| 841 device_path); | 841 device_path); |
| 842 } | 842 } |
| 843 } | 843 } |
| OLD | NEW |