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

Side by Side Diff: chrome/browser/extensions/crx_installer.cc

Issue 9150016: Move creation and ownership of ResourceDispatcherHost and PluginService to content. This gives a ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix chromeos ui_tests Created 8 years, 11 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 | Annotate | Revision Log
OLDNEW
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/crx_installer.h" 5 #include "chrome/browser/extensions/crx_installer.h"
6 6
7 #include <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 15 matching lines...) Expand all
26 #include "chrome/browser/extensions/default_apps_trial.h" 26 #include "chrome/browser/extensions/default_apps_trial.h"
27 #include "chrome/browser/extensions/extension_error_reporter.h" 27 #include "chrome/browser/extensions/extension_error_reporter.h"
28 #include "chrome/browser/extensions/extension_service.h" 28 #include "chrome/browser/extensions/extension_service.h"
29 #include "chrome/browser/extensions/permissions_updater.h" 29 #include "chrome/browser/extensions/permissions_updater.h"
30 #include "chrome/browser/shell_integration.h" 30 #include "chrome/browser/shell_integration.h"
31 #include "chrome/browser/web_applications/web_app.h" 31 #include "chrome/browser/web_applications/web_app.h"
32 #include "chrome/common/chrome_notification_types.h" 32 #include "chrome/common/chrome_notification_types.h"
33 #include "chrome/common/chrome_paths.h" 33 #include "chrome/common/chrome_paths.h"
34 #include "chrome/common/extensions/extension_constants.h" 34 #include "chrome/common/extensions/extension_constants.h"
35 #include "chrome/common/extensions/extension_file_util.h" 35 #include "chrome/common/extensions/extension_file_util.h"
36 #include "content/browser/renderer_host/resource_dispatcher_host.h"
36 #include "content/public/browser/browser_thread.h" 37 #include "content/public/browser/browser_thread.h"
37 #include "content/public/browser/notification_service.h" 38 #include "content/public/browser/notification_service.h"
38 #include "content/public/browser/user_metrics.h" 39 #include "content/public/browser/user_metrics.h"
39 #include "grit/chromium_strings.h" 40 #include "grit/chromium_strings.h"
40 #include "grit/generated_resources.h" 41 #include "grit/generated_resources.h"
41 #include "grit/theme_resources.h" 42 #include "grit/theme_resources.h"
42 #include "third_party/skia/include/core/SkBitmap.h" 43 #include "third_party/skia/include/core/SkBitmap.h"
43 #include "ui/base/l10n/l10n_util.h" 44 #include "ui/base/l10n/l10n_util.h"
44 #include "ui/base/resource/resource_bundle.h" 45 #include "ui/base/resource/resource_bundle.h"
45 46
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 BrowserThread::DeleteSoon(BrowserThread::UI, FROM_HERE, client_); 163 BrowserThread::DeleteSoon(BrowserThread::UI, FROM_HERE, client_);
163 client_ = NULL; 164 client_ = NULL;
164 } 165 }
165 166
166 void CrxInstaller::InstallCrx(const FilePath& source_file) { 167 void CrxInstaller::InstallCrx(const FilePath& source_file) {
167 source_file_ = source_file; 168 source_file_ = source_file;
168 169
169 scoped_refptr<SandboxedExtensionUnpacker> unpacker( 170 scoped_refptr<SandboxedExtensionUnpacker> unpacker(
170 new SandboxedExtensionUnpacker( 171 new SandboxedExtensionUnpacker(
171 source_file, 172 source_file,
172 g_browser_process->resource_dispatcher_host(), 173 ResourceDispatcherHost::Get(),
173 install_source_, 174 install_source_,
174 creation_flags_, 175 creation_flags_,
175 this)); 176 this));
176 177
177 if (!BrowserThread::PostTask( 178 if (!BrowserThread::PostTask(
178 BrowserThread::FILE, FROM_HERE, 179 BrowserThread::FILE, FROM_HERE,
179 base::Bind( 180 base::Bind(
180 &SandboxedExtensionUnpacker::Start, unpacker.get()))) 181 &SandboxedExtensionUnpacker::Start, unpacker.get())))
181 NOTREACHED(); 182 NOTREACHED();
182 } 183 }
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
606 // Some users (such as the download shelf) need to know when a 607 // Some users (such as the download shelf) need to know when a
607 // CRXInstaller is done. Listening for the EXTENSION_* events 608 // CRXInstaller is done. Listening for the EXTENSION_* events
608 // is problematic because they don't know anything about the 609 // is problematic because they don't know anything about the
609 // extension before it is unpacked, so they cannot filter based 610 // extension before it is unpacked, so they cannot filter based
610 // on the extension. 611 // on the extension.
611 content::NotificationService::current()->Notify( 612 content::NotificationService::current()->Notify(
612 chrome::NOTIFICATION_CRX_INSTALLER_DONE, 613 chrome::NOTIFICATION_CRX_INSTALLER_DONE,
613 content::Source<CrxInstaller>(this), 614 content::Source<CrxInstaller>(this),
614 content::Details<const Extension>(extension)); 615 content::Details<const Extension>(extension));
615 } 616 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698