Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(101)

Side by Side Diff: chrome/browser/extensions/api/runtime/chrome_runtime_api_delegate.cc

Issue 342003005: Show alert failure for reloading unpacked extensions with bad manifest (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved path handling back to C++ Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "base/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/time/time.h" 9 #include "base/time/time.h"
10 #include "chrome/browser/chrome_notification_types.h" 10 #include "chrome/browser/chrome_notification_types.h"
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 browser_context_, 130 browser_context_,
131 warnings)); 131 warnings));
132 } else { 132 } else {
133 // We can't call ReloadExtension directly, since when this method finishes 133 // We can't call ReloadExtension directly, since when this method finishes
134 // it tries to decrease the reference count for the extension, which fails 134 // it tries to decrease the reference count for the extension, which fails
135 // if the extension has already been reloaded; so instead we post a task. 135 // if the extension has already been reloaded; so instead we post a task.
136 base::MessageLoop::current()->PostTask( 136 base::MessageLoop::current()->PostTask(
137 FROM_HERE, 137 FROM_HERE,
138 base::Bind(&ExtensionService::ReloadExtension, 138 base::Bind(&ExtensionService::ReloadExtension,
139 service->AsWeakPtr(), 139 service->AsWeakPtr(),
140 extension_id)); 140 extension_id,
141 true));
141 } 142 }
142 } 143 }
143 144
144 bool ChromeRuntimeAPIDelegate::CheckForUpdates( 145 bool ChromeRuntimeAPIDelegate::CheckForUpdates(
145 const std::string& extension_id, 146 const std::string& extension_id,
146 const UpdateCheckCallback& callback) { 147 const UpdateCheckCallback& callback) {
147 ExtensionSystem* system = ExtensionSystem::Get(browser_context_); 148 ExtensionSystem* system = ExtensionSystem::Get(browser_context_);
148 ExtensionService* service = system->extension_service(); 149 ExtensionService* service = system->extension_service();
149 ExtensionUpdater* updater = service->updater(); 150 ExtensionUpdater* updater = service->updater();
150 if (!updater) { 151 if (!updater) {
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 const UpdateCheckResult& result) { 276 const UpdateCheckResult& result) {
276 UpdateCallbackList callbacks = pending_update_checks_[extension_id]; 277 UpdateCallbackList callbacks = pending_update_checks_[extension_id];
277 pending_update_checks_.erase(extension_id); 278 pending_update_checks_.erase(extension_id);
278 for (UpdateCallbackList::const_iterator iter = callbacks.begin(); 279 for (UpdateCallbackList::const_iterator iter = callbacks.begin();
279 iter != callbacks.end(); 280 iter != callbacks.end();
280 ++iter) { 281 ++iter) {
281 const UpdateCheckCallback& callback = *iter; 282 const UpdateCheckCallback& callback = *iter;
282 callback.Run(result); 283 callback.Run(result);
283 } 284 }
284 } 285 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698