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

Unified Diff: chrome/browser/extensions/extension_disabled_infobar_delegate.cc

Issue 1075006: Eliminate all UI thread decoding of extension images.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/extension_disabled_infobar_delegate.cc
===================================================================
--- chrome/browser/extensions/extension_disabled_infobar_delegate.cc (revision 42429)
+++ chrome/browser/extensions/extension_disabled_infobar_delegate.cc (working copy)
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -24,16 +24,11 @@
ExtensionDisabledDialogDelegate(Profile* profile,
ExtensionsService* service,
Extension* extension)
- : profile_(profile), service_(service), extension_(extension) {
+ : service_(service), extension_(extension) {
AddRef(); // Balanced in Proceed or Abort.
- // Do this now because we can't touch extension on the file loop.
- install_icon_resource_ =
- extension_->GetIconPath(Extension::EXTENSION_ICON_LARGE);
-
- ChromeThread::PostTask(
- ChromeThread::FILE, FROM_HERE,
- NewRunnableMethod(this, &ExtensionDisabledDialogDelegate::Start));
+ install_ui_.reset(new ExtensionInstallUI(profile));
+ install_ui_->ConfirmInstall(this, extension_);
}
// ExtensionInstallUI::Delegate
@@ -53,29 +48,11 @@
virtual ~ExtensionDisabledDialogDelegate() {}
- void Start() {
- // We start on the file thread so we can decode the install icon.
- FilePath install_icon_path = install_icon_resource_.GetFilePath();
- Extension::DecodeIconFromPath(
- install_icon_path, Extension::EXTENSION_ICON_LARGE, &install_icon_);
- // Then we display the UI on the UI thread.
- ChromeThread::PostTask(
- ChromeThread::UI, FROM_HERE,
- NewRunnableMethod(
- this, &ExtensionDisabledDialogDelegate::ConfirmInstall));
- }
+ // The UI for showing the install dialog when enabling.
+ scoped_ptr<ExtensionInstallUI> install_ui_;
- void ConfirmInstall() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
- ExtensionInstallUI ui(profile_);
- ui.ConfirmInstall(this, extension_, install_icon_.get());
- }
-
- Profile* profile_;
ExtensionsService* service_;
Extension* extension_;
- ExtensionResource install_icon_resource_;
- scoped_ptr<SkBitmap> install_icon_;
};
class ExtensionDisabledInfobarDelegate
« no previous file with comments | « chrome/browser/extensions/extension_context_menu_model.cc ('k') | chrome/browser/extensions/extension_dom_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698