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 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 net::URLRequestContextGetter* url_request_context_getter = | 329 net::URLRequestContextGetter* url_request_context_getter = |
330 g_browser_process->system_request_context(); | 330 g_browser_process->system_request_context(); |
331 | 331 |
332 if (!oauth_service) { | 332 if (!oauth_service) { |
333 drive::EventLogger* logger = file_manager::util::GetLogger(GetProfile()); | 333 drive::EventLogger* logger = file_manager::util::GetLogger(GetProfile()); |
334 if (logger) { | 334 if (logger) { |
335 logger->Log(logging::LOG_ERROR, | 335 logger->Log(logging::LOG_ERROR, |
336 "CWS OAuth token fetch failed. OAuth2TokenService can't " | 336 "CWS OAuth token fetch failed. OAuth2TokenService can't " |
337 "be retrieved."); | 337 "be retrieved."); |
338 } | 338 } |
339 SetResult(base::Value::CreateNullValue()); | 339 SetResult(base::MakeUnique<base::Value>()); |
340 return false; | 340 return false; |
341 } | 341 } |
342 | 342 |
343 SigninManagerBase* signin_manager = | 343 SigninManagerBase* signin_manager = |
344 SigninManagerFactory::GetForProfile(GetProfile()); | 344 SigninManagerFactory::GetForProfile(GetProfile()); |
345 auth_service_.reset(new google_apis::AuthService( | 345 auth_service_.reset(new google_apis::AuthService( |
346 oauth_service, | 346 oauth_service, |
347 signin_manager->GetAuthenticatedAccountId(), | 347 signin_manager->GetAuthenticatedAccountId(), |
348 url_request_context_getter, | 348 url_request_context_getter, |
349 scopes)); | 349 scopes)); |
(...skipping 16 matching lines...) Expand all Loading... |
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::Value>(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::MakeUnique<base::Value>()); |
377 SendResponse(false); | 377 SendResponse(false); |
378 } | 378 } |
379 } | 379 } |
380 | 380 |
381 ExtensionFunction::ResponseAction FileManagerPrivateGetProfilesFunction::Run() { | 381 ExtensionFunction::ResponseAction FileManagerPrivateGetProfilesFunction::Run() { |
382 const std::vector<ProfileInfo>& profiles = GetLoggedInProfileInfoList(); | 382 const std::vector<ProfileInfo>& profiles = GetLoggedInProfileInfoList(); |
383 | 383 |
384 // Obtains the display profile ID. | 384 // Obtains the display profile ID. |
385 AppWindow* const app_window = GetCurrentAppWindow(this); | 385 AppWindow* const app_window = GetCurrentAppWindow(this); |
386 chrome::MultiUserWindowManager* const window_manager = | 386 chrome::MultiUserWindowManager* const window_manager = |
(...skipping 305 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 |