| 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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 } else { | 178 } else { |
| 179 error_ = kPageLoadError; | 179 error_ = kPageLoadError; |
| 180 SendResponse(false); | 180 SendResponse(false); |
| 181 } | 181 } |
| 182 } | 182 } |
| 183 | 183 |
| 184 bool RuntimeReloadFunction::RunImpl() { | 184 bool RuntimeReloadFunction::RunImpl() { |
| 185 // We can't call ReloadExtension directly, since when this method finishes | 185 // We can't call ReloadExtension directly, since when this method finishes |
| 186 // it tries to decrease the reference count for the extension, which fails | 186 // it tries to decrease the reference count for the extension, which fails |
| 187 // if the extension has already been reloaded; so instead we post a task. | 187 // if the extension has already been reloaded; so instead we post a task. |
| 188 MessageLoop::current()->PostTask(FROM_HERE, | 188 base::MessageLoop::current()->PostTask( |
| 189 FROM_HERE, |
| 189 base::Bind(&ExtensionService::ReloadExtension, | 190 base::Bind(&ExtensionService::ReloadExtension, |
| 190 profile()->GetExtensionService()->AsWeakPtr(), | 191 profile()->GetExtensionService()->AsWeakPtr(), |
| 191 extension_id())); | 192 extension_id())); |
| 192 return true; | 193 return true; |
| 193 } | 194 } |
| 194 | 195 |
| 195 RuntimeRequestUpdateCheckFunction::RuntimeRequestUpdateCheckFunction() { | 196 RuntimeRequestUpdateCheckFunction::RuntimeRequestUpdateCheckFunction() { |
| 196 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UPDATE_FOUND, | 197 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UPDATE_FOUND, |
| 197 content::NotificationService::AllSources()); | 198 content::NotificationService::AllSources()); |
| 198 } | 199 } |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 did_reply_ = true; | 259 did_reply_ = true; |
| 259 results_.reset(new base::ListValue); | 260 results_.reset(new base::ListValue); |
| 260 results_->AppendString(kUpdateFound); | 261 results_->AppendString(kUpdateFound); |
| 261 base::DictionaryValue* details = new base::DictionaryValue; | 262 base::DictionaryValue* details = new base::DictionaryValue; |
| 262 results_->Append(details); | 263 results_->Append(details); |
| 263 details->SetString("version", version); | 264 details->SetString("version", version); |
| 264 SendResponse(true); | 265 SendResponse(true); |
| 265 } | 266 } |
| 266 | 267 |
| 267 } // namespace extensions | 268 } // namespace extensions |
| OLD | NEW |