Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/base64.h" | 9 #include "base/base64.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 632 HandleRequestExtensionsData(NULL); | 632 HandleRequestExtensionsData(NULL); |
| 633 } | 633 } |
| 634 deleting_rvh_ = NULL; | 634 deleting_rvh_ = NULL; |
| 635 } | 635 } |
| 636 | 636 |
| 637 // Static | 637 // Static |
| 638 DictionaryValue* ExtensionsDOMHandler::CreateExtensionDetailValue( | 638 DictionaryValue* ExtensionsDOMHandler::CreateExtensionDetailValue( |
| 639 ExtensionService* service, const Extension* extension, | 639 ExtensionService* service, const Extension* extension, |
| 640 const std::vector<ExtensionPage>& pages, bool enabled, bool terminated) { | 640 const std::vector<ExtensionPage>& pages, bool enabled, bool terminated) { |
| 641 DictionaryValue* extension_data = new DictionaryValue(); | 641 DictionaryValue* extension_data = new DictionaryValue(); |
| 642 bool icon_exists = true; | |
| 642 GURL icon = | 643 GURL icon = |
| 643 ExtensionIconSource::GetIconURL(extension, | 644 ExtensionIconSource::GetIconURL(extension, |
| 644 Extension::EXTENSION_ICON_MEDIUM, | 645 Extension::EXTENSION_ICON_MEDIUM, |
| 645 ExtensionIconSet::MATCH_BIGGER, | 646 ExtensionIconSet::MATCH_BIGGER, |
| 646 !enabled); | 647 !enabled, &icon_exists); |
| 647 extension_data->SetString("id", extension->id()); | 648 extension_data->SetString("id", extension->id()); |
| 648 extension_data->SetString("name", extension->name()); | 649 extension_data->SetString("name", extension->name()); |
| 649 extension_data->SetString("description", extension->description()); | 650 extension_data->SetString("description", extension->description()); |
| 650 if (extension->location() == Extension::LOAD) | 651 if (extension->location() == Extension::LOAD) |
| 651 extension_data->SetString("path", extension->path().value()); | 652 extension_data->SetString("path", extension->path().value()); |
| 652 extension_data->SetString("version", extension->version()->GetString()); | 653 extension_data->SetString("version", extension->version()->GetString()); |
| 653 extension_data->SetString("icon", icon.spec()); | 654 extension_data->SetString("icon", icon.spec()); |
| 655 extension_data->SetBoolean("icon_exists", icon_exists); | |
|
Evan Stade
2011/07/27 16:31:45
this is unused, right? Why set it?
Greg Billock
2011/07/27 19:52:24
I changed line 647 to the new signature. I thought
Evan Stade
2011/07/27 23:04:31
I would just pass NULL for now instead of adding c
Greg Billock
2011/07/28 16:59:59
Nah, showing the default 'huh?' icon is probably f
| |
| 654 extension_data->SetBoolean("isUnpacked", | 656 extension_data->SetBoolean("isUnpacked", |
| 655 extension->location() == Extension::LOAD); | 657 extension->location() == Extension::LOAD); |
| 656 extension_data->SetBoolean("mayDisable", | 658 extension_data->SetBoolean("mayDisable", |
| 657 Extension::UserMayDisable(extension->location())); | 659 Extension::UserMayDisable(extension->location())); |
| 658 extension_data->SetBoolean("enabled", enabled); | 660 extension_data->SetBoolean("enabled", enabled); |
| 659 extension_data->SetBoolean("terminated", terminated); | 661 extension_data->SetBoolean("terminated", terminated); |
| 660 extension_data->SetBoolean("enabledIncognito", | 662 extension_data->SetBoolean("enabledIncognito", |
| 661 service ? service->IsIncognitoEnabled(extension->id()) : false); | 663 service ? service->IsIncognitoEnabled(extension->id()) : false); |
| 662 extension_data->SetBoolean("wantsFileAccess", extension->wants_file_access()); | 664 extension_data->SetBoolean("wantsFileAccess", extension->wants_file_access()); |
| 663 extension_data->SetBoolean("allowFileAccess", | 665 extension_data->SetBoolean("allowFileAccess", |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 794 return ResourceBundle::GetSharedInstance(). | 796 return ResourceBundle::GetSharedInstance(). |
| 795 LoadDataResourceBytes(IDR_PLUGIN); | 797 LoadDataResourceBytes(IDR_PLUGIN); |
| 796 } | 798 } |
| 797 | 799 |
| 798 // static | 800 // static |
| 799 void ExtensionsUI::RegisterUserPrefs(PrefService* prefs) { | 801 void ExtensionsUI::RegisterUserPrefs(PrefService* prefs) { |
| 800 prefs->RegisterBooleanPref(prefs::kExtensionsUIDeveloperMode, | 802 prefs->RegisterBooleanPref(prefs::kExtensionsUIDeveloperMode, |
| 801 false, | 803 false, |
| 802 PrefService::SYNCABLE_PREF); | 804 PrefService::SYNCABLE_PREF); |
| 803 } | 805 } |
| OLD | NEW |