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/chromeos/extensions/file_browser_event_router.h" | 5 #include "chrome/browser/chromeos/extensions/file_browser_event_router.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/json/json_writer.h" | 8 #include "base/json/json_writer.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 std::string args_json; | 336 std::string args_json; |
337 base::JSONWriter::Write(&args, false /* pretty_print */, &args_json); | 337 base::JSONWriter::Write(&args, false /* pretty_print */, &args_json); |
338 profile_->GetExtensionEventRouter()->DispatchEventToRenderers( | 338 profile_->GetExtensionEventRouter()->DispatchEventToRenderers( |
339 extension_event_names::kOnFileBrowserMountCompleted, args_json, NULL, | 339 extension_event_names::kOnFileBrowserMountCompleted, args_json, NULL, |
340 GURL()); | 340 GURL()); |
341 | 341 |
342 if (relative_mount_path_set && | 342 if (relative_mount_path_set && |
343 mount_info.mount_type == chromeos::MOUNT_TYPE_DEVICE && | 343 mount_info.mount_type == chromeos::MOUNT_TYPE_DEVICE && |
344 !mount_info.mount_condition && | 344 !mount_info.mount_condition && |
345 event == chromeos::MountLibrary::MOUNTING) { | 345 event == chromeos::MountLibrary::MOUNTING) { |
346 FileManagerUtil::ShowFullTabUrl(profile_, FilePath(mount_info.mount_path)); | 346 FileManagerUtil::ViewFolder(FilePath(mount_info.mount_path)); |
347 } | 347 } |
348 } | 348 } |
349 | 349 |
350 void ExtensionFileBrowserEventRouter::OnDiskAdded( | 350 void ExtensionFileBrowserEventRouter::OnDiskAdded( |
351 const chromeos::MountLibrary::Disk* disk) { | 351 const chromeos::MountLibrary::Disk* disk) { |
352 VLOG(1) << "Disk added: " << disk->device_path(); | 352 VLOG(1) << "Disk added: " << disk->device_path(); |
353 if (disk->device_path().empty()) { | 353 if (disk->device_path().empty()) { |
354 VLOG(1) << "Empty system path for " << disk->device_path(); | 354 VLOG(1) << "Empty system path for " << disk->device_path(); |
355 return; | 355 return; |
356 } | 356 } |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
459 base::Bind(&FileWatcherDelegate::HandleFileWatchOnUIThread, | 459 base::Bind(&FileWatcherDelegate::HandleFileWatchOnUIThread, |
460 this, local_path, true)); | 460 this, local_path, true)); |
461 } | 461 } |
462 | 462 |
463 void | 463 void |
464 ExtensionFileBrowserEventRouter::FileWatcherDelegate::HandleFileWatchOnUIThread( | 464 ExtensionFileBrowserEventRouter::FileWatcherDelegate::HandleFileWatchOnUIThread( |
465 const FilePath& local_path, bool got_error) { | 465 const FilePath& local_path, bool got_error) { |
466 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 466 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
467 router_->HandleFileWatchNotification(local_path, got_error); | 467 router_->HandleFileWatchNotification(local_path, got_error); |
468 } | 468 } |
OLD | NEW |