Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(98)

Side by Side Diff: chrome/browser/chromeos/extensions/file_manager/private_api_misc.cc

Issue 514293003: Run athena on chrome (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 83
84 // Make a ProfileInfo. 84 // Make a ProfileInfo.
85 linked_ptr<api::file_browser_private::ProfileInfo> profile_info( 85 linked_ptr<api::file_browser_private::ProfileInfo> profile_info(
86 new api::file_browser_private::ProfileInfo()); 86 new api::file_browser_private::ProfileInfo());
87 profile_info->profile_id = multi_user_util::GetUserIDFromProfile(profile); 87 profile_info->profile_id = multi_user_util::GetUserIDFromProfile(profile);
88 profile_info->display_name = UTF16ToUTF8(user->GetDisplayName()); 88 profile_info->display_name = UTF16ToUTF8(user->GetDisplayName());
89 // TODO(hirono): Remove the property from the profile_info. 89 // TODO(hirono): Remove the property from the profile_info.
90 profile_info->is_current_profile = true; 90 profile_info->is_current_profile = true;
91 91
92 // Make an icon URL of the profile. 92 // Make an icon URL of the profile.
93 #if !defined(USE_ATHENA)
94 // TODO(oshima): Move GetAvatarImageForContext out from ash.
95 // crbug.com/408748.
93 if (contents) { 96 if (contents) {
94 const gfx::Image& image = 97 const gfx::Image& image =
95 ash::GetAvatarImageForContext(contents->GetBrowserContext()); 98 ash::GetAvatarImageForContext(contents->GetBrowserContext());
96 const gfx::ImageSkia& skia = image.AsImageSkia(); 99 const gfx::ImageSkia& skia = image.AsImageSkia();
97 profile_info->profile_image.reset( 100 profile_info->profile_image.reset(
98 new api::file_browser_private::ImageSet); 101 new api::file_browser_private::ImageSet);
99 profile_info->profile_image->scale1x_url = 102 profile_info->profile_image->scale1x_url =
100 webui::GetBitmapDataUrl(skia.GetRepresentation(1.0f).sk_bitmap()); 103 webui::GetBitmapDataUrl(skia.GetRepresentation(1.0f).sk_bitmap());
101 profile_info->profile_image->scale2x_url = 104 profile_info->profile_image->scale2x_url =
102 webui::GetBitmapDataUrl(skia.GetRepresentation(2.0f).sk_bitmap()); 105 webui::GetBitmapDataUrl(skia.GetRepresentation(2.0f).sk_bitmap());
103 } 106 }
107 #endif
104 result_profiles.push_back(profile_info); 108 result_profiles.push_back(profile_info);
105 } 109 }
106 110
107 return result_profiles; 111 return result_profiles;
108 } 112 }
109 } // namespace 113 } // namespace
110 114
111 bool FileBrowserPrivateLogoutUserForReauthenticationFunction::RunSync() { 115 bool FileBrowserPrivateLogoutUserForReauthenticationFunction::RunSync() {
112 user_manager::User* user = 116 user_manager::User* user =
113 chromeos::ProfileHelper::Get()->GetUserByProfile(GetProfile()); 117 chromeos::ProfileHelper::Get()->GetUserByProfile(GetProfile());
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 logger->Log(logging::LOG_ERROR, 376 logger->Log(logging::LOG_ERROR,
373 "CWS OAuth token fetch failed. (GDataErrorCode: %s)", 377 "CWS OAuth token fetch failed. (GDataErrorCode: %s)",
374 google_apis::GDataErrorCodeToString(code).c_str()); 378 google_apis::GDataErrorCodeToString(code).c_str());
375 } 379 }
376 SetResult(base::Value::CreateNullValue()); 380 SetResult(base::Value::CreateNullValue());
377 SendResponse(false); 381 SendResponse(false);
378 } 382 }
379 } 383 }
380 384
381 bool FileBrowserPrivateGetProfilesFunction::RunSync() { 385 bool FileBrowserPrivateGetProfilesFunction::RunSync() {
386 #if defined(USE_ATHENA)
387 // TODO(oshima): Figure out what to do.
388 return false;
389 #endif
390
382 const std::vector<linked_ptr<api::file_browser_private::ProfileInfo> >& 391 const std::vector<linked_ptr<api::file_browser_private::ProfileInfo> >&
383 profiles = GetLoggedInProfileInfoList(GetAssociatedWebContents()); 392 profiles = GetLoggedInProfileInfoList(GetAssociatedWebContents());
384 393
385 // Obtains the display profile ID. 394 // Obtains the display profile ID.
386 AppWindow* const app_window = GetCurrentAppWindow(this); 395 AppWindow* const app_window = GetCurrentAppWindow(this);
387 chrome::MultiUserWindowManager* const window_manager = 396 chrome::MultiUserWindowManager* const window_manager =
388 chrome::MultiUserWindowManager::GetInstance(); 397 chrome::MultiUserWindowManager::GetInstance();
389 const std::string current_profile_id = 398 const std::string current_profile_id =
390 multi_user_util::GetUserIDFromProfile(GetProfile()); 399 multi_user_util::GetUserIDFromProfile(GetProfile());
391 const std::string display_profile_id = 400 const std::string display_profile_id =
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 NOTREACHED(); 490 NOTREACHED();
482 SetError( 491 SetError(
483 base::StringPrintf("Unexpected inspection type(%d) is specified.", 492 base::StringPrintf("Unexpected inspection type(%d) is specified.",
484 static_cast<int>(params->type))); 493 static_cast<int>(params->type)));
485 return false; 494 return false;
486 } 495 }
487 return true; 496 return true;
488 } 497 }
489 498
490 } // namespace extensions 499 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698