| 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_drive.h" | 5 #include "chrome/browser/chromeos/extensions/file_manager/private_api_drive.h" |
| 6 | 6 |
| 7 #include "base/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
| 8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
| 9 #include "chrome/browser/chromeos/drive/drive_app_registry.h" | 9 #include "chrome/browser/chromeos/drive/drive_app_registry.h" |
| 10 #include "chrome/browser/chromeos/drive/drive_integration_service.h" | 10 #include "chrome/browser/chromeos/drive/drive_integration_service.h" |
| (...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 533 return false; | 533 return false; |
| 534 | 534 |
| 535 std::string types; | 535 std::string types; |
| 536 if (!search_params->GetString("types", &types)) | 536 if (!search_params->GetString("types", &types)) |
| 537 return false; | 537 return false; |
| 538 | 538 |
| 539 int max_results = 0; | 539 int max_results = 0; |
| 540 if (!search_params->GetInteger("maxResults", &max_results)) | 540 if (!search_params->GetInteger("maxResults", &max_results)) |
| 541 return false; | 541 return false; |
| 542 | 542 |
| 543 drive::util::Log("%s[%d] called. (types: '%s', maxResults: '%d')", | 543 drive::util::Log(logging::LOG_INFO, |
| 544 "%s[%d] called. (types: '%s', maxResults: '%d')", |
| 544 name().c_str(), | 545 name().c_str(), |
| 545 request_id(), | 546 request_id(), |
| 546 types.c_str(), | 547 types.c_str(), |
| 547 max_results); | 548 max_results); |
| 548 set_log_on_completion(true); | 549 set_log_on_completion(true); |
| 549 | 550 |
| 550 drive::DriveIntegrationService* integration_service = | 551 drive::DriveIntegrationService* integration_service = |
| 551 drive::DriveIntegrationServiceFactory::GetForProfile(profile_); | 552 drive::DriveIntegrationServiceFactory::GetForProfile(profile_); |
| 552 // |integration_service| is NULL if Drive is disabled. | 553 // |integration_service| is NULL if Drive is disabled. |
| 553 if (!integration_service || !integration_service->file_system()) | 554 if (!integration_service || !integration_service->file_system()) |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 670 profile_->GetPrefs()->GetBoolean(prefs::kDisableDriveOverCellular)) { | 671 profile_->GetPrefs()->GetBoolean(prefs::kDisableDriveOverCellular)) { |
| 671 type_string = kDriveConnectionTypeMetered; | 672 type_string = kDriveConnectionTypeMetered; |
| 672 } else { | 673 } else { |
| 673 type_string = kDriveConnectionTypeOnline; | 674 type_string = kDriveConnectionTypeOnline; |
| 674 } | 675 } |
| 675 | 676 |
| 676 value->SetString("type", type_string); | 677 value->SetString("type", type_string); |
| 677 value->Set("reasons", reasons.release()); | 678 value->Set("reasons", reasons.release()); |
| 678 SetResult(value.release()); | 679 SetResult(value.release()); |
| 679 | 680 |
| 680 drive::util::Log("%s succeeded.", name().c_str()); | 681 drive::util::Log(logging::LOG_INFO, "%s succeeded.", name().c_str()); |
| 681 return true; | 682 return true; |
| 682 } | 683 } |
| 683 | 684 |
| 684 RequestAccessTokenFunction::RequestAccessTokenFunction() { | 685 RequestAccessTokenFunction::RequestAccessTokenFunction() { |
| 685 } | 686 } |
| 686 | 687 |
| 687 RequestAccessTokenFunction::~RequestAccessTokenFunction() { | 688 RequestAccessTokenFunction::~RequestAccessTokenFunction() { |
| 688 } | 689 } |
| 689 | 690 |
| 690 bool RequestAccessTokenFunction::RunImpl() { | 691 bool RequestAccessTokenFunction::RunImpl() { |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 753 error_ = "Share Url for this item is not available."; | 754 error_ = "Share Url for this item is not available."; |
| 754 SendResponse(false); | 755 SendResponse(false); |
| 755 return; | 756 return; |
| 756 } | 757 } |
| 757 | 758 |
| 758 SetResult(new base::StringValue(share_url.spec())); | 759 SetResult(new base::StringValue(share_url.spec())); |
| 759 SendResponse(true); | 760 SendResponse(true); |
| 760 } | 761 } |
| 761 | 762 |
| 762 } // namespace file_manager | 763 } // namespace file_manager |
| OLD | NEW |