| 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 <memory> | 7 #include <memory> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 if (!browser) | 330 if (!browser) |
| 331 return false; | 331 return false; |
| 332 return extensions::ExtensionTabUtil::OpenOptionsPage(extension, browser); | 332 return extensions::ExtensionTabUtil::OpenOptionsPage(extension, browser); |
| 333 } | 333 } |
| 334 | 334 |
| 335 void ChromeRuntimeAPIDelegate::Observe( | 335 void ChromeRuntimeAPIDelegate::Observe( |
| 336 int type, | 336 int type, |
| 337 const content::NotificationSource& source, | 337 const content::NotificationSource& source, |
| 338 const content::NotificationDetails& details) { | 338 const content::NotificationDetails& details) { |
| 339 DCHECK_EQ(extensions::NOTIFICATION_EXTENSION_UPDATE_FOUND, type); | 339 DCHECK_EQ(extensions::NOTIFICATION_EXTENSION_UPDATE_FOUND, type); |
| 340 using UpdateDetails = const std::pair<std::string, Version>; | 340 using UpdateDetails = const std::pair<std::string, base::Version>; |
| 341 const std::string& id = content::Details<UpdateDetails>(details)->first; | 341 const std::string& id = content::Details<UpdateDetails>(details)->first; |
| 342 const Version& version = content::Details<UpdateDetails>(details)->second; | 342 const base::Version& version = |
| 343 content::Details<UpdateDetails>(details)->second; |
| 343 if (version.IsValid()) { | 344 if (version.IsValid()) { |
| 344 CallUpdateCallbacks( | 345 CallUpdateCallbacks( |
| 345 id, UpdateCheckResult(true, kUpdateFound, version.GetString())); | 346 id, UpdateCheckResult(true, kUpdateFound, version.GetString())); |
| 346 } | 347 } |
| 347 } | 348 } |
| 348 | 349 |
| 349 void ChromeRuntimeAPIDelegate::OnExtensionInstalled( | 350 void ChromeRuntimeAPIDelegate::OnExtensionInstalled( |
| 350 content::BrowserContext* browser_context, | 351 content::BrowserContext* browser_context, |
| 351 const Extension* extension, | 352 const Extension* extension, |
| 352 bool is_update) { | 353 bool is_update) { |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 const UpdateCheckResult& result) { | 387 const UpdateCheckResult& result) { |
| 387 auto it = update_check_info_.find(extension_id); | 388 auto it = update_check_info_.find(extension_id); |
| 388 if (it == update_check_info_.end()) | 389 if (it == update_check_info_.end()) |
| 389 return; | 390 return; |
| 390 std::vector<UpdateCheckCallback> callbacks; | 391 std::vector<UpdateCheckCallback> callbacks; |
| 391 it->second.callbacks.swap(callbacks); | 392 it->second.callbacks.swap(callbacks); |
| 392 for (const auto& callback : callbacks) { | 393 for (const auto& callback : callbacks) { |
| 393 callback.Run(result); | 394 callback.Run(result); |
| 394 } | 395 } |
| 395 } | 396 } |
| OLD | NEW |