Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(117)

Side by Side Diff: chrome/browser/chromeos/extensions/file_browser_private_api.cc

Issue 12537016: Add callback to DiskMountManager::UnmountPath (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 <sys/stat.h> 7 #include <sys/stat.h>
8 #include <sys/statvfs.h> 8 #include <sys/statvfs.h>
9 #include <sys/types.h> 9 #include <sys/types.h>
10 #include <utime.h> 10 #include <utime.h>
(...skipping 1639 matching lines...) Expand 10 before | Expand all | Expand 10 after
1650 } 1650 }
1651 1651
1652 void RemoveMountFunction::GetSelectedFileInfoResponse( 1652 void RemoveMountFunction::GetSelectedFileInfoResponse(
1653 const SelectedFileInfoList& files) { 1653 const SelectedFileInfoList& files) {
1654 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 1654 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
1655 1655
1656 if (files.size() != 1) { 1656 if (files.size() != 1) {
1657 SendResponse(false); 1657 SendResponse(false);
1658 return; 1658 return;
1659 } 1659 }
1660 DiskMountManager::GetInstance()->UnmountPath(files[0].local_path.value(), 1660
1661 chromeos::UNMOUNT_OPTIONS_NONE); 1661 // TODO(tbarzic): Send response when callback is received, it would make more
1662 // sense than remembering issued unmount requests in file manager and showing
1663 // errors for them when MountCompleted event is received.
1664 DiskMountManager::GetInstance()->UnmountPath(
1665 files[0].local_path.value(),
1666 chromeos::UNMOUNT_OPTIONS_NONE,
1667 DiskMountManager::UnmountPathCallback());
1662 SendResponse(true); 1668 SendResponse(true);
1663 } 1669 }
1664 1670
1665 GetMountPointsFunction::GetMountPointsFunction() { 1671 GetMountPointsFunction::GetMountPointsFunction() {
1666 } 1672 }
1667 1673
1668 GetMountPointsFunction::~GetMountPointsFunction() { 1674 GetMountPointsFunction::~GetMountPointsFunction() {
1669 } 1675 }
1670 1676
1671 bool GetMountPointsFunction::RunImpl() { 1677 bool GetMountPointsFunction::RunImpl() {
(...skipping 1668 matching lines...) Expand 10 before | Expand all | Expand 10 after
3340 OpenNewWindowFunction::OpenNewWindowFunction() {} 3346 OpenNewWindowFunction::OpenNewWindowFunction() {}
3341 3347
3342 OpenNewWindowFunction::~OpenNewWindowFunction() {} 3348 OpenNewWindowFunction::~OpenNewWindowFunction() {}
3343 3349
3344 bool OpenNewWindowFunction::RunImpl() { 3350 bool OpenNewWindowFunction::RunImpl() {
3345 std::string url; 3351 std::string url;
3346 EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &url)); 3352 EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &url));
3347 file_manager_util::OpenNewWindow(profile_, GURL(url)); 3353 file_manager_util::OpenNewWindow(profile_, GURL(url));
3348 return true; 3354 return true;
3349 } 3355 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698