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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 #include <vector> | 10 #include <vector> |
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 void FileManagerPrivateRequestWebStoreAccessTokenFunction::OnAccessTokenFetched( | 358 void FileManagerPrivateRequestWebStoreAccessTokenFunction::OnAccessTokenFetched( |
359 google_apis::DriveApiErrorCode code, | 359 google_apis::DriveApiErrorCode code, |
360 const std::string& access_token) { | 360 const std::string& access_token) { |
361 drive::EventLogger* logger = file_manager::util::GetLogger(GetProfile()); | 361 drive::EventLogger* logger = file_manager::util::GetLogger(GetProfile()); |
362 | 362 |
363 if (code == google_apis::HTTP_SUCCESS) { | 363 if (code == google_apis::HTTP_SUCCESS) { |
364 DCHECK(auth_service_->HasAccessToken()); | 364 DCHECK(auth_service_->HasAccessToken()); |
365 DCHECK(access_token == auth_service_->access_token()); | 365 DCHECK(access_token == auth_service_->access_token()); |
366 if (logger) | 366 if (logger) |
367 logger->Log(logging::LOG_INFO, "CWS OAuth token fetch succeeded."); | 367 logger->Log(logging::LOG_INFO, "CWS OAuth token fetch succeeded."); |
368 SetResult(base::MakeUnique<base::StringValue>(access_token)); | 368 SetResult(base::MakeUnique<base::Value>(access_token)); |
369 SendResponse(true); | 369 SendResponse(true); |
370 } else { | 370 } else { |
371 if (logger) { | 371 if (logger) { |
372 logger->Log(logging::LOG_ERROR, | 372 logger->Log(logging::LOG_ERROR, |
373 "CWS OAuth token fetch failed. (DriveApiErrorCode: %s)", | 373 "CWS OAuth token fetch failed. (DriveApiErrorCode: %s)", |
374 google_apis::DriveApiErrorCodeToString(code).c_str()); | 374 google_apis::DriveApiErrorCodeToString(code).c_str()); |
375 } | 375 } |
376 SetResult(base::Value::CreateNullValue()); | 376 SetResult(base::Value::CreateNullValue()); |
377 SendResponse(false); | 377 SendResponse(false); |
378 } | 378 } |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
459 app_file_handler_util::GetMimeTypeForLocalPath( | 459 app_file_handler_util::GetMimeTypeForLocalPath( |
460 GetProfile(), file_system_url.path(), | 460 GetProfile(), file_system_url.path(), |
461 base::Bind(&FileManagerPrivateInternalGetMimeTypeFunction::OnGetMimeType, | 461 base::Bind(&FileManagerPrivateInternalGetMimeTypeFunction::OnGetMimeType, |
462 this)); | 462 this)); |
463 | 463 |
464 return true; | 464 return true; |
465 } | 465 } |
466 | 466 |
467 void FileManagerPrivateInternalGetMimeTypeFunction::OnGetMimeType( | 467 void FileManagerPrivateInternalGetMimeTypeFunction::OnGetMimeType( |
468 const std::string& mimeType) { | 468 const std::string& mimeType) { |
469 SetResult(base::MakeUnique<base::StringValue>(mimeType)); | 469 SetResult(base::MakeUnique<base::Value>(mimeType)); |
470 SendResponse(true); | 470 SendResponse(true); |
471 } | 471 } |
472 | 472 |
473 ExtensionFunction::ResponseAction | 473 ExtensionFunction::ResponseAction |
474 FileManagerPrivateIsPiexLoaderEnabledFunction::Run() { | 474 FileManagerPrivateIsPiexLoaderEnabledFunction::Run() { |
475 #if defined(OFFICIAL_BUILD) | 475 #if defined(OFFICIAL_BUILD) |
476 return RespondNow(OneArgument(base::MakeUnique<base::Value>(true))); | 476 return RespondNow(OneArgument(base::MakeUnique<base::Value>(true))); |
477 #else | 477 #else |
478 return RespondNow(OneArgument(base::MakeUnique<base::Value>(false))); | 478 return RespondNow(OneArgument(base::MakeUnique<base::Value>(false))); |
479 #endif | 479 #endif |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
692 base::File::Error result) { | 692 base::File::Error result) { |
693 if (result != base::File::FILE_OK) { | 693 if (result != base::File::FILE_OK) { |
694 Respond(Error("Failed to execute the action.")); | 694 Respond(Error("Failed to execute the action.")); |
695 return; | 695 return; |
696 } | 696 } |
697 | 697 |
698 Respond(NoArguments()); | 698 Respond(NoArguments()); |
699 } | 699 } |
700 | 700 |
701 } // namespace extensions | 701 } // namespace extensions |
OLD | NEW |