OLD | NEW |
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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/extensions_ui.h" | 5 #include "chrome/browser/extensions/extensions_ui.h" |
6 | 6 |
7 #include "app/gfx/codec/png_codec.h" | 7 #include "app/gfx/codec/png_codec.h" |
8 #include "app/gfx/color_utils.h" | 8 #include "app/gfx/color_utils.h" |
9 #include "app/gfx/skbitmap_operations.h" | 9 #include "app/gfx/skbitmap_operations.h" |
10 #include "app/l10n_util.h" | 10 #include "app/l10n_util.h" |
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 const ListValue* list = static_cast<const ListValue*>(value); | 397 const ListValue* list = static_cast<const ListValue*>(value); |
398 CHECK(list->GetSize() == 1); | 398 CHECK(list->GetSize() == 1); |
399 std::string extension_id; | 399 std::string extension_id; |
400 CHECK(list->GetString(0, &extension_id)); | 400 CHECK(list->GetString(0, &extension_id)); |
401 | 401 |
402 Extension *extension = | 402 Extension *extension = |
403 extensions_service_->GetExtensionById(extension_id, true); | 403 extensions_service_->GetExtensionById(extension_id, true); |
404 if (!extension) | 404 if (!extension) |
405 return; | 405 return; |
406 | 406 |
407 FilePath icon_path = | |
408 extension->GetIconPath(Extension::EXTENSION_ICON_LARGE).GetFilePath(); | |
409 scoped_ptr<SkBitmap> uninstall_icon; | 407 scoped_ptr<SkBitmap> uninstall_icon; |
410 CrxInstaller::DecodeInstallIcon(icon_path, &uninstall_icon); | 408 Extension::DecodeIcon(extension, Extension::EXTENSION_ICON_LARGE, |
| 409 &uninstall_icon); |
411 | 410 |
412 extension_id_uninstalling_ = extension_id; | 411 extension_id_uninstalling_ = extension_id; |
413 ExtensionInstallUI client(dom_ui_->GetProfile()); | 412 ExtensionInstallUI client(dom_ui_->GetProfile()); |
414 client.ConfirmUninstall(this, extension, uninstall_icon.get()); | 413 client.ConfirmUninstall(this, extension, uninstall_icon.get()); |
415 } | 414 } |
416 | 415 |
417 void ExtensionsDOMHandler::InstallUIProceed() { | 416 void ExtensionsDOMHandler::InstallUIProceed() { |
418 extensions_service_->UninstallExtension(extension_id_uninstalling_, false); | 417 extensions_service_->UninstallExtension(extension_id_uninstalling_, false); |
419 extension_id_uninstalling_ = ""; | 418 extension_id_uninstalling_ = ""; |
420 } | 419 } |
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
749 // static | 748 // static |
750 RefCountedMemory* ExtensionsUI::GetFaviconResourceBytes() { | 749 RefCountedMemory* ExtensionsUI::GetFaviconResourceBytes() { |
751 return ResourceBundle::GetSharedInstance(). | 750 return ResourceBundle::GetSharedInstance(). |
752 LoadDataResourceBytes(IDR_PLUGIN); | 751 LoadDataResourceBytes(IDR_PLUGIN); |
753 } | 752 } |
754 | 753 |
755 // static | 754 // static |
756 void ExtensionsUI::RegisterUserPrefs(PrefService* prefs) { | 755 void ExtensionsUI::RegisterUserPrefs(PrefService* prefs) { |
757 prefs->RegisterBooleanPref(prefs::kExtensionsUIDeveloperMode, false); | 756 prefs->RegisterBooleanPref(prefs::kExtensionsUIDeveloperMode, false); |
758 } | 757 } |
OLD | NEW |