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/extensions/api/runtime/chrome_runtime_api_delegate.h" | 5 #include "chrome/browser/extensions/api/runtime/chrome_runtime_api_delegate.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 if (!browser) | 244 if (!browser) |
245 return false; | 245 return false; |
246 return extensions::ExtensionTabUtil::OpenOptionsPage(extension, browser); | 246 return extensions::ExtensionTabUtil::OpenOptionsPage(extension, browser); |
247 } | 247 } |
248 | 248 |
249 void ChromeRuntimeAPIDelegate::Observe( | 249 void ChromeRuntimeAPIDelegate::Observe( |
250 int type, | 250 int type, |
251 const content::NotificationSource& source, | 251 const content::NotificationSource& source, |
252 const content::NotificationDetails& details) { | 252 const content::NotificationDetails& details) { |
253 DCHECK(type == extensions::NOTIFICATION_EXTENSION_UPDATE_FOUND); | 253 DCHECK(type == extensions::NOTIFICATION_EXTENSION_UPDATE_FOUND); |
254 typedef const std::pair<std::string, Version> UpdateDetails; | 254 typedef const std::pair<std::string, base::Version> UpdateDetails; |
255 const std::string& id = content::Details<UpdateDetails>(details)->first; | 255 const std::string& id = content::Details<UpdateDetails>(details)->first; |
256 const Version& version = content::Details<UpdateDetails>(details)->second; | 256 const base::Version& version = |
| 257 content::Details<UpdateDetails>(details)->second; |
257 if (version.IsValid()) { | 258 if (version.IsValid()) { |
258 CallUpdateCallbacks( | 259 CallUpdateCallbacks( |
259 id, UpdateCheckResult(true, kUpdateFound, version.GetString())); | 260 id, UpdateCheckResult(true, kUpdateFound, version.GetString())); |
260 } | 261 } |
261 } | 262 } |
262 | 263 |
263 void ChromeRuntimeAPIDelegate::UpdateCheckComplete( | 264 void ChromeRuntimeAPIDelegate::UpdateCheckComplete( |
264 const std::string& extension_id) { | 265 const std::string& extension_id) { |
265 ExtensionSystem* system = ExtensionSystem::Get(browser_context_); | 266 ExtensionSystem* system = ExtensionSystem::Get(browser_context_); |
266 ExtensionService* service = system->extension_service(); | 267 ExtensionService* service = system->extension_service(); |
(...skipping 13 matching lines...) Expand all Loading... |
280 const UpdateCheckResult& result) { | 281 const UpdateCheckResult& result) { |
281 UpdateCallbackList callbacks = pending_update_checks_[extension_id]; | 282 UpdateCallbackList callbacks = pending_update_checks_[extension_id]; |
282 pending_update_checks_.erase(extension_id); | 283 pending_update_checks_.erase(extension_id); |
283 for (UpdateCallbackList::const_iterator iter = callbacks.begin(); | 284 for (UpdateCallbackList::const_iterator iter = callbacks.begin(); |
284 iter != callbacks.end(); | 285 iter != callbacks.end(); |
285 ++iter) { | 286 ++iter) { |
286 const UpdateCheckCallback& callback = *iter; | 287 const UpdateCheckCallback& callback = *iter; |
287 callback.Run(result); | 288 callback.Run(result); |
288 } | 289 } |
289 } | 290 } |
OLD | NEW |