| 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 "apps/app_window.h" | 7 #include "apps/app_window.h" |
| 8 #include "apps/app_window_registry.h" | 8 #include "apps/app_window_registry.h" |
| 9 #include "ash/frame/frame_util.h" | 9 #include "ash/frame/frame_util.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 std::set<Profile*> original_profiles; | 68 std::set<Profile*> original_profiles; |
| 69 std::vector<linked_ptr<api::file_browser_private::ProfileInfo> > | 69 std::vector<linked_ptr<api::file_browser_private::ProfileInfo> > |
| 70 result_profiles; | 70 result_profiles; |
| 71 | 71 |
| 72 for (size_t i = 0; i < profiles.size(); ++i) { | 72 for (size_t i = 0; i < profiles.size(); ++i) { |
| 73 // Filter the profile. | 73 // Filter the profile. |
| 74 Profile* const profile = profiles[i]->GetOriginalProfile(); | 74 Profile* const profile = profiles[i]->GetOriginalProfile(); |
| 75 if (original_profiles.count(profile)) | 75 if (original_profiles.count(profile)) |
| 76 continue; | 76 continue; |
| 77 original_profiles.insert(profile); | 77 original_profiles.insert(profile); |
| 78 const chromeos::User* const user = | 78 const user_manager::User* const user = |
| 79 chromeos::ProfileHelper::Get()->GetUserByProfile(profile); | 79 chromeos::ProfileHelper::Get()->GetUserByProfile(profile); |
| 80 if (!user || !user->is_logged_in()) | 80 if (!user || !user->is_logged_in()) |
| 81 continue; | 81 continue; |
| 82 | 82 |
| 83 // Make a ProfileInfo. | 83 // Make a ProfileInfo. |
| 84 linked_ptr<api::file_browser_private::ProfileInfo> profile_info( | 84 linked_ptr<api::file_browser_private::ProfileInfo> profile_info( |
| 85 new api::file_browser_private::ProfileInfo()); | 85 new api::file_browser_private::ProfileInfo()); |
| 86 profile_info->profile_id = multi_user_util::GetUserIDFromProfile(profile); | 86 profile_info->profile_id = multi_user_util::GetUserIDFromProfile(profile); |
| 87 profile_info->display_name = UTF16ToUTF8(user->GetDisplayName()); | 87 profile_info->display_name = UTF16ToUTF8(user->GetDisplayName()); |
| 88 // TODO(hirono): Remove the property from the profile_info. | 88 // TODO(hirono): Remove the property from the profile_info. |
| (...skipping 12 matching lines...) Expand all Loading... |
| 101 webui::GetBitmapDataUrl(skia.GetRepresentation(2.0f).sk_bitmap()); | 101 webui::GetBitmapDataUrl(skia.GetRepresentation(2.0f).sk_bitmap()); |
| 102 } | 102 } |
| 103 result_profiles.push_back(profile_info); | 103 result_profiles.push_back(profile_info); |
| 104 } | 104 } |
| 105 | 105 |
| 106 return result_profiles; | 106 return result_profiles; |
| 107 } | 107 } |
| 108 } // namespace | 108 } // namespace |
| 109 | 109 |
| 110 bool FileBrowserPrivateLogoutUserForReauthenticationFunction::RunSync() { | 110 bool FileBrowserPrivateLogoutUserForReauthenticationFunction::RunSync() { |
| 111 chromeos::User* user = | 111 user_manager::User* user = |
| 112 chromeos::ProfileHelper::Get()->GetUserByProfile(GetProfile()); | 112 chromeos::ProfileHelper::Get()->GetUserByProfile(GetProfile()); |
| 113 if (user) { | 113 if (user) { |
| 114 chromeos::UserManager::Get()->SaveUserOAuthStatus( | 114 chromeos::UserManager::Get()->SaveUserOAuthStatus( |
| 115 user->email(), | 115 user->email(), user_manager::User::OAUTH2_TOKEN_STATUS_INVALID); |
| 116 chromeos::User::OAUTH2_TOKEN_STATUS_INVALID); | |
| 117 } | 116 } |
| 118 | 117 |
| 119 chrome::AttemptUserExit(); | 118 chrome::AttemptUserExit(); |
| 120 return true; | 119 return true; |
| 121 } | 120 } |
| 122 | 121 |
| 123 bool FileBrowserPrivateGetPreferencesFunction::RunSync() { | 122 bool FileBrowserPrivateGetPreferencesFunction::RunSync() { |
| 124 api::file_browser_private::Preferences result; | 123 api::file_browser_private::Preferences result; |
| 125 const PrefService* const service = GetProfile()->GetPrefs(); | 124 const PrefService* const service = GetProfile()->GetPrefs(); |
| 126 | 125 |
| (...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 470 NOTREACHED(); | 469 NOTREACHED(); |
| 471 SetError( | 470 SetError( |
| 472 base::StringPrintf("Unexpected inspection type(%d) is specified.", | 471 base::StringPrintf("Unexpected inspection type(%d) is specified.", |
| 473 static_cast<int>(params->type))); | 472 static_cast<int>(params->type))); |
| 474 return false; | 473 return false; |
| 475 } | 474 } |
| 476 return true; | 475 return true; |
| 477 } | 476 } |
| 478 | 477 |
| 479 } // namespace extensions | 478 } // namespace extensions |
| OLD | NEW |