Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/private_api_misc.h" | 5 #include "chrome/browser/chromeos/extensions/file_manager/private_api_misc.h" |
| 6 | 6 |
| 7 #include "ash/frame/frame_util.h" | 7 #include "ash/frame/frame_util.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| 11 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
| 12 #include "chrome/browser/browser_process.h" | 12 #include "chrome/browser/browser_process.h" |
| 13 #include "chrome/browser/chromeos/drive/file_system_util.h" | 13 #include "chrome/browser/chromeos/drive/file_system_util.h" |
| 14 #include "chrome/browser/chromeos/extensions/file_manager/private_api_util.h" | 14 #include "chrome/browser/chromeos/extensions/file_manager/private_api_util.h" |
| 15 #include "chrome/browser/chromeos/file_manager/app_installer.h" | 15 #include "chrome/browser/chromeos/file_manager/app_installer.h" |
| 16 #include "chrome/browser/chromeos/file_manager/fileapi_util.h" | 16 #include "chrome/browser/chromeos/file_manager/fileapi_util.h" |
| 17 #include "chrome/browser/chromeos/file_manager/zip_file_creator.h" | 17 #include "chrome/browser/chromeos/file_manager/zip_file_creator.h" |
| 18 #include "chrome/browser/chromeos/file_system_provider/service.h" | |
| 18 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 19 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 19 #include "chrome/browser/chromeos/settings/cros_settings.h" | 20 #include "chrome/browser/chromeos/settings/cros_settings.h" |
| 20 #include "chrome/browser/devtools/devtools_window.h" | 21 #include "chrome/browser/devtools/devtools_window.h" |
| 21 #include "chrome/browser/drive/event_logger.h" | 22 #include "chrome/browser/drive/event_logger.h" |
| 22 #include "chrome/browser/extensions/api/file_handlers/mime_util.h" | 23 #include "chrome/browser/extensions/api/file_handlers/mime_util.h" |
| 23 #include "chrome/browser/extensions/devtools_util.h" | 24 #include "chrome/browser/extensions/devtools_util.h" |
| 24 #include "chrome/browser/lifetime/application_lifetime.h" | 25 #include "chrome/browser/lifetime/application_lifetime.h" |
| 25 #include "chrome/browser/profiles/profile.h" | 26 #include "chrome/browser/profiles/profile.h" |
| 26 #include "chrome/browser/profiles/profile_manager.h" | 27 #include "chrome/browser/profiles/profile_manager.h" |
| 27 #include "chrome/browser/profiles/profiles_state.h" | 28 #include "chrome/browser/profiles/profiles_state.h" |
| (...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 456 | 457 |
| 457 void FileManagerPrivateGetMimeTypeFunction::OnGetMimeType( | 458 void FileManagerPrivateGetMimeTypeFunction::OnGetMimeType( |
| 458 const std::string& mimeType) { | 459 const std::string& mimeType) { |
| 459 SetResult(new base::StringValue(mimeType)); | 460 SetResult(new base::StringValue(mimeType)); |
| 460 SendResponse(true); | 461 SendResponse(true); |
| 461 } | 462 } |
| 462 | 463 |
| 463 ExtensionFunction::ResponseAction | 464 ExtensionFunction::ResponseAction |
| 464 FileManagerPrivateIsPiexLoaderEnabledFunction::Run() { | 465 FileManagerPrivateIsPiexLoaderEnabledFunction::Run() { |
| 465 #if defined(OFFICIAL_BUILD) | 466 #if defined(OFFICIAL_BUILD) |
| 466 return RespondNow(OneArgument( | 467 return RespondNow(OneArgument(new base::FundamentalValue(true))); |
|
hirono
2015/04/15 07:44:18
Thank you for fixing this!
| |
| 467 new base::FundamentalValue(true))); | |
| 468 #else | 468 #else |
| 469 return RespondNow(OneArgument( | 469 return RespondNow(OneArgument(new base::FundamentalValue(false))); |
| 470 new base::FundamentalValue(false))); | |
| 471 #endif | 470 #endif |
| 472 } | 471 } |
| 473 | 472 |
| 473 FileManagerPrivateGetProvidingExtensionsFunction:: | |
| 474 FileManagerPrivateGetProvidingExtensionsFunction() | |
| 475 : chrome_details_(this) { | |
| 476 } | |
| 477 | |
| 478 ExtensionFunction::ResponseAction | |
| 479 FileManagerPrivateGetProvidingExtensionsFunction::Run() { | |
| 480 using chromeos::file_system_provider::Service; | |
| 481 using chromeos::file_system_provider::ProvidingExtensionInfo; | |
| 482 const Service* const service = Service::Get(chrome_details_.GetProfile()); | |
| 483 const std::vector<ProvidingExtensionInfo> info_list = | |
| 484 service->GetProvidingExtensionInfoList(); | |
| 485 | |
| 486 using api::file_manager_private::ProvidingExtension; | |
| 487 std::vector<linked_ptr<ProvidingExtension>> providing_extensions; | |
| 488 for (const auto& info : info_list) { | |
| 489 const linked_ptr<ProvidingExtension> providing_extension( | |
| 490 new ProvidingExtension); | |
| 491 providing_extension->extension_id = info.extension_id; | |
| 492 providing_extension->name = info.name; | |
| 493 providing_extension->can_configure = info.can_configure; | |
| 494 providing_extension->can_add = info.can_add; | |
| 495 providing_extensions.push_back(providing_extension); | |
| 496 } | |
| 497 | |
| 498 return RespondNow(ArgumentList( | |
| 499 api::file_manager_private::GetProvidingExtensions::Results::Create( | |
| 500 providing_extensions).Pass())); | |
| 501 } | |
| 502 | |
| 474 } // namespace extensions | 503 } // namespace extensions |
| OLD | NEW |