| 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 #include "chrome/browser/chromeos/extensions/file_manager_util.h" | 4 #include "chrome/browser/chromeos/extensions/file_manager_util.h" |
| 5 | 5 |
| 6 #include "base/bind.h" | 6 #include "base/bind.h" |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/json/json_reader.h" | 8 #include "base/json/json_reader.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 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 445 ExtensionService* service = profile->GetExtensionService(); | 445 ExtensionService* service = profile->GetExtensionService(); |
| 446 if (!service) | 446 if (!service) |
| 447 return; | 447 return; |
| 448 | 448 |
| 449 const extensions::Extension* extension = | 449 const extensions::Extension* extension = |
| 450 service->GetExtensionById(kFileBrowserDomain, false); | 450 service->GetExtensionById(kFileBrowserDomain, false); |
| 451 if (!extension) | 451 if (!extension) |
| 452 return; | 452 return; |
| 453 | 453 |
| 454 content::RecordAction(UserMetricsAction("ShowFileBrowserFullTab")); | 454 content::RecordAction(UserMetricsAction("ShowFileBrowserFullTab")); |
| 455 application_launch::OpenApplication(profile, extension, | 455 application_launch::LaunchParams params(profile, extension, |
| 456 extension_misc::LAUNCH_WINDOW, GURL(url), NEW_FOREGROUND_TAB, NULL); | 456 extension_misc::LAUNCH_WINDOW, |
| 457 NEW_FOREGROUND_TAB); |
| 458 params.override_url = GURL(url); |
| 459 application_launch::OpenApplication(params); |
| 457 } | 460 } |
| 458 | 461 |
| 459 void ViewRemovableDrive(const FilePath& path) { | 462 void ViewRemovableDrive(const FilePath& path) { |
| 460 OpenFileBrowser(path, REUSE_ANY_FILE_MANAGER, "mountTriggered"); | 463 OpenFileBrowser(path, REUSE_ANY_FILE_MANAGER, "mountTriggered"); |
| 461 } | 464 } |
| 462 | 465 |
| 463 void ShowFileInFolder(const FilePath& path) { | 466 void ShowFileInFolder(const FilePath& path) { |
| 464 // This action changes the selection so we do not reuse existing tabs. | 467 // This action changes the selection so we do not reuse existing tabs. |
| 465 OpenFileBrowser(path, REUSE_NEVER, "selectOnly"); | 468 OpenFileBrowser(path, REUSE_NEVER, "selectOnly"); |
| 466 } | 469 } |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 640 | 643 |
| 641 ExtensionService* service = profile->GetExtensionService(); | 644 ExtensionService* service = profile->GetExtensionService(); |
| 642 if (!service) | 645 if (!service) |
| 643 return false; | 646 return false; |
| 644 | 647 |
| 645 const extensions::Extension* extension = | 648 const extensions::Extension* extension = |
| 646 service->GetExtensionById(kFileBrowserDomain, false); | 649 service->GetExtensionById(kFileBrowserDomain, false); |
| 647 if (!extension) | 650 if (!extension) |
| 648 return false; | 651 return false; |
| 649 | 652 |
| 650 application_launch::OpenApplication( | 653 application_launch::LaunchParams params(profile, extension, |
| 651 profile, extension, extension_misc::LAUNCH_WINDOW, | 654 extension_misc::LAUNCH_WINDOW, |
| 652 GetVideoPlayerUrl(url), NEW_FOREGROUND_TAB, NULL); | 655 NEW_FOREGROUND_TAB); |
| 656 params.override_url = GetVideoPlayerUrl(url); |
| 657 application_launch::OpenApplication(params); |
| 653 return true; | 658 return true; |
| 654 } | 659 } |
| 655 | 660 |
| 656 if (IsCRXFile(file_extension.data())) { | 661 if (IsCRXFile(file_extension.data())) { |
| 657 InstallCRX(browser, path); | 662 InstallCRX(browser, path); |
| 658 return true; | 663 return true; |
| 659 } | 664 } |
| 660 | 665 |
| 661 // Unknown file type. Record UMA and show an error message. | 666 // Unknown file type. Record UMA and show an error message. |
| 662 size_t extension_index = UMAExtensionIndex(file_extension.data(), | 667 size_t extension_index = UMAExtensionIndex(file_extension.data(), |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 708 GDataOperationRegistry::ProgressStatus>::const_iterator iter = | 713 GDataOperationRegistry::ProgressStatus>::const_iterator iter = |
| 709 list.begin(); | 714 list.begin(); |
| 710 iter != list.end(); ++iter) { | 715 iter != list.end(); ++iter) { |
| 711 result_list->Append( | 716 result_list->Append( |
| 712 ProgessStatusToDictionaryValue(profile, origin_url, *iter)); | 717 ProgessStatusToDictionaryValue(profile, origin_url, *iter)); |
| 713 } | 718 } |
| 714 return result_list.release(); | 719 return result_list.release(); |
| 715 } | 720 } |
| 716 | 721 |
| 717 } // namespace file_manager_util | 722 } // namespace file_manager_util |
| OLD | NEW |