| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/runtime_api.h" | 5 #include "chrome/browser/extensions/api/runtime/runtime_api.h" |
| 6 | 6 |
| 7 #include "chrome/browser/browser_process.h" | 7 #include "chrome/browser/browser_process.h" |
| 8 #include "chrome/browser/extensions/event_router.h" | 8 #include "chrome/browser/extensions/event_router.h" |
| 9 #include "chrome/browser/extensions/extension_host.h" | 9 #include "chrome/browser/extensions/extension_host.h" |
| 10 #include "chrome/browser/extensions/extension_process_manager.h" | 10 #include "chrome/browser/extensions/extension_process_manager.h" |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 } else { | 182 } else { |
| 183 error_ = kPageLoadError; | 183 error_ = kPageLoadError; |
| 184 SendResponse(false); | 184 SendResponse(false); |
| 185 } | 185 } |
| 186 } | 186 } |
| 187 | 187 |
| 188 bool RuntimeReloadFunction::RunImpl() { | 188 bool RuntimeReloadFunction::RunImpl() { |
| 189 // We can't call ReloadExtension directly, since when this method finishes | 189 // We can't call ReloadExtension directly, since when this method finishes |
| 190 // it tries to decrease the reference count for the extension, which fails | 190 // it tries to decrease the reference count for the extension, which fails |
| 191 // if the extension has already been reloaded; so instead we post a task. | 191 // if the extension has already been reloaded; so instead we post a task. |
| 192 MessageLoop::current()->PostTask(FROM_HERE, | 192 base::MessageLoop::current()->PostTask(FROM_HERE, |
| 193 base::Bind(&ExtensionService::ReloadExtension, | 193 base::Bind(&ExtensionService::ReloadExtension, |
| 194 profile()->GetExtensionService()->AsWeakPtr(), | 194 profile()->GetExtensionService()->AsWeakPtr(), |
| 195 extension_id())); | 195 extension_id())); |
| 196 return true; | 196 return true; |
| 197 } | 197 } |
| 198 | 198 |
| 199 RuntimeRequestUpdateCheckFunction::RuntimeRequestUpdateCheckFunction() { | 199 RuntimeRequestUpdateCheckFunction::RuntimeRequestUpdateCheckFunction() { |
| 200 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UPDATE_FOUND, | 200 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UPDATE_FOUND, |
| 201 content::NotificationService::AllSources()); | 201 content::NotificationService::AllSources()); |
| 202 } | 202 } |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 } else { | 311 } else { |
| 312 NOTREACHED(); | 312 NOTREACHED(); |
| 313 return false; | 313 return false; |
| 314 } | 314 } |
| 315 | 315 |
| 316 results_ = GetPlatformInfo::Results::Create(info); | 316 results_ = GetPlatformInfo::Results::Create(info); |
| 317 return true; | 317 return true; |
| 318 } | 318 } |
| 319 | 319 |
| 320 } // namespace extensions | 320 } // namespace extensions |
| OLD | NEW |