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

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

Issue 1165323004: We should use UserID object to identify users instead of username. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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 <set> 7 #include <set>
8 #include <vector> 8 #include <vector>
9 9
10 #include "ash/frame/frame_util.h" 10 #include "ash/frame/frame_util.h"
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 98
99 return result_profiles; 99 return result_profiles;
100 } 100 }
101 } // namespace 101 } // namespace
102 102
103 bool FileManagerPrivateLogoutUserForReauthenticationFunction::RunSync() { 103 bool FileManagerPrivateLogoutUserForReauthenticationFunction::RunSync() {
104 const user_manager::User* user = 104 const user_manager::User* user =
105 chromeos::ProfileHelper::Get()->GetUserByProfile(GetProfile()); 105 chromeos::ProfileHelper::Get()->GetUserByProfile(GetProfile());
106 if (user) { 106 if (user) {
107 user_manager::UserManager::Get()->SaveUserOAuthStatus( 107 user_manager::UserManager::Get()->SaveUserOAuthStatus(
108 user->email(), user_manager::User::OAUTH2_TOKEN_STATUS_INVALID); 108 user->GetUserID(), user_manager::User::OAUTH2_TOKEN_STATUS_INVALID);
109 } 109 }
110 110
111 chrome::AttemptUserExit(); 111 chrome::AttemptUserExit();
112 return true; 112 return true;
113 } 113 }
114 114
115 bool FileManagerPrivateGetPreferencesFunction::RunSync() { 115 bool FileManagerPrivateGetPreferencesFunction::RunSync() {
116 api::file_manager_private::Preferences result; 116 api::file_manager_private::Preferences result;
117 const PrefService* const service = GetProfile()->GetPrefs(); 117 const PrefService* const service = GetProfile()->GetPrefs();
118 118
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 } 325 }
326 326
327 bool FileManagerPrivateGetProfilesFunction::RunSync() { 327 bool FileManagerPrivateGetProfilesFunction::RunSync() {
328 const std::vector<linked_ptr<api::file_manager_private::ProfileInfo> >& 328 const std::vector<linked_ptr<api::file_manager_private::ProfileInfo> >&
329 profiles = GetLoggedInProfileInfoList(); 329 profiles = GetLoggedInProfileInfoList();
330 330
331 // Obtains the display profile ID. 331 // Obtains the display profile ID.
332 AppWindow* const app_window = GetCurrentAppWindow(this); 332 AppWindow* const app_window = GetCurrentAppWindow(this);
333 chrome::MultiUserWindowManager* const window_manager = 333 chrome::MultiUserWindowManager* const window_manager =
334 chrome::MultiUserWindowManager::GetInstance(); 334 chrome::MultiUserWindowManager::GetInstance();
335 const std::string current_profile_id = 335 const user_manager::UserID current_profile_id =
336 multi_user_util::GetUserIDFromProfile(GetProfile()); 336 multi_user_util::GetUserIDFromProfile(GetProfile());
337 const std::string display_profile_id = 337 const user_manager::UserID display_profile_id =
338 window_manager && app_window ? window_manager->GetUserPresentingWindow( 338 window_manager && app_window ? window_manager->GetUserPresentingWindow(
339 app_window->GetNativeWindow()) 339 app_window->GetNativeWindow())
340 : ""; 340 : user_manager::UserID(std::string(), std::st ring());
Denis Kuznetsov (DE-MUC) 2015/06/10 16:50:45 EmptyUserID()?
341 341
342 results_ = api::file_manager_private::GetProfiles::Results::Create( 342 results_ = api::file_manager_private::GetProfiles::Results::Create(
343 profiles, 343 profiles,
344 current_profile_id, 344 current_profile_id.GetUserEmail(),
345 display_profile_id.empty() ? current_profile_id : display_profile_id); 345 display_profile_id.empty() ? current_profile_id.GetUserEmail() : display_p rofile_id.GetUserEmail());
346 return true; 346 return true;
347 } 347 }
348 348
349 bool FileManagerPrivateOpenInspectorFunction::RunSync() { 349 bool FileManagerPrivateOpenInspectorFunction::RunSync() {
350 using extensions::api::file_manager_private::OpenInspector::Params; 350 using extensions::api::file_manager_private::OpenInspector::Params;
351 const scoped_ptr<Params> params(Params::Create(*args_)); 351 const scoped_ptr<Params> params(Params::Create(*args_));
352 EXTENSION_FUNCTION_VALIDATE(params); 352 EXTENSION_FUNCTION_VALIDATE(params);
353 353
354 switch (params->type) { 354 switch (params->type) {
355 case extensions::api::file_manager_private::INSPECTION_TYPE_NORMAL: 355 case extensions::api::file_manager_private::INSPECTION_TYPE_NORMAL:
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
540 base::File::Error result) { 540 base::File::Error result) {
541 if (result != base::File::FILE_OK) { 541 if (result != base::File::FILE_OK) {
542 Respond(Error("Failed to complete configuration.")); 542 Respond(Error("Failed to complete configuration."));
543 return; 543 return;
544 } 544 }
545 545
546 Respond(NoArguments()); 546 Respond(NoArguments());
547 } 547 }
548 548
549 } // namespace extensions 549 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698