| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/drive/drive_app_registry.h" | 5 #include "chrome/browser/drive/drive_app_registry.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 drive_service_->UninstallApp(app_id, | 188 drive_service_->UninstallApp(app_id, |
| 189 base::Bind(&DriveAppRegistry::OnAppUninstalled, | 189 base::Bind(&DriveAppRegistry::OnAppUninstalled, |
| 190 weak_ptr_factory_.GetWeakPtr(), | 190 weak_ptr_factory_.GetWeakPtr(), |
| 191 app_id, | 191 app_id, |
| 192 callback)); | 192 callback)); |
| 193 } | 193 } |
| 194 | 194 |
| 195 void DriveAppRegistry::OnAppUninstalled(const std::string& app_id, | 195 void DriveAppRegistry::OnAppUninstalled(const std::string& app_id, |
| 196 const UninstallCallback& callback, | 196 const UninstallCallback& callback, |
| 197 google_apis::GDataErrorCode error) { | 197 google_apis::GDataErrorCode error) { |
| 198 if (error == google_apis::HTTP_SUCCESS) { | 198 if (error == google_apis::HTTP_NO_CONTENT) { |
| 199 all_apps_.erase(app_id); | 199 all_apps_.erase(app_id); |
| 200 RemoveAppFromSelector(app_id, &mimetype_map_); | 200 RemoveAppFromSelector(app_id, &mimetype_map_); |
| 201 RemoveAppFromSelector(app_id, &extension_map_); | 201 RemoveAppFromSelector(app_id, &extension_map_); |
| 202 } | 202 } |
| 203 callback.Run(error); | 203 callback.Run(error); |
| 204 } | 204 } |
| 205 | 205 |
| 206 // static | 206 // static |
| 207 bool DriveAppRegistry::IsAppUninstallSupported() { | 207 bool DriveAppRegistry::IsAppUninstallSupported() { |
| 208 #ifdef USE_OFFICIAL_GOOGLE_API_KEYS | 208 #ifdef USE_OFFICIAL_GOOGLE_API_KEYS |
| (...skipping 15 matching lines...) Expand all Loading... |
| 224 | 224 |
| 225 // Go forward while the size is larger or equal to preferred_size. | 225 // Go forward while the size is larger or equal to preferred_size. |
| 226 size_t i = 1; | 226 size_t i = 1; |
| 227 while (i < sorted_icons.size() && sorted_icons[i].first >= preferred_size) | 227 while (i < sorted_icons.size() && sorted_icons[i].first >= preferred_size) |
| 228 ++i; | 228 ++i; |
| 229 return sorted_icons[i - 1].second; | 229 return sorted_icons[i - 1].second; |
| 230 } | 230 } |
| 231 | 231 |
| 232 } // namespace util | 232 } // namespace util |
| 233 } // namespace drive | 233 } // namespace drive |
| OLD | NEW |