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

Side by Side Diff: chrome/browser/ui/webui/options/extension_settings_handler.cc

Issue 9705083: Unknown options in extension manifest file are silently ignored (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Removed an accedentally-included file Created 8 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 unified diff | Download patch
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/ui/webui/options/extension_settings_handler.h" 5 #include "chrome/browser/ui/webui/options/extension_settings_handler.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/base64.h" 8 #include "base/base64.h"
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 l10n_util::GetStringUTF16(IDS_GET_MORE_EXTENSIONS)); 537 l10n_util::GetStringUTF16(IDS_GET_MORE_EXTENSIONS));
538 localized_strings->SetString("extensionSettingsGetMoreExtensionsUrl", 538 localized_strings->SetString("extensionSettingsGetMoreExtensionsUrl",
539 ASCIIToUTF16(google_util::AppendGoogleLocaleParam( 539 ASCIIToUTF16(google_util::AppendGoogleLocaleParam(
540 GURL(extension_urls::GetWebstoreLaunchURL())).spec())); 540 GURL(extension_urls::GetWebstoreLaunchURL())).spec()));
541 localized_strings->SetString("extensionSettingsExtensionId", 541 localized_strings->SetString("extensionSettingsExtensionId",
542 l10n_util::GetStringUTF16(IDS_EXTENSIONS_ID)); 542 l10n_util::GetStringUTF16(IDS_EXTENSIONS_ID));
543 localized_strings->SetString("extensionSettingsExtensionPath", 543 localized_strings->SetString("extensionSettingsExtensionPath",
544 l10n_util::GetStringUTF16(IDS_EXTENSIONS_PATH)); 544 l10n_util::GetStringUTF16(IDS_EXTENSIONS_PATH));
545 localized_strings->SetString("extensionSettingsInspectViews", 545 localized_strings->SetString("extensionSettingsInspectViews",
546 l10n_util::GetStringUTF16(IDS_EXTENSIONS_INSPECT_VIEWS)); 546 l10n_util::GetStringUTF16(IDS_EXTENSIONS_INSPECT_VIEWS));
547 localized_strings->SetString("extensionSettingsExtensionUnrecognizedKeys",
548 l10n_util::GetStringUTF16(IDS_EXTENSIONS_UNRECOGNIZED_KEYS));
547 localized_strings->SetString("viewIncognito", 549 localized_strings->SetString("viewIncognito",
548 l10n_util::GetStringUTF16(IDS_EXTENSIONS_VIEW_INCOGNITO)); 550 l10n_util::GetStringUTF16(IDS_EXTENSIONS_VIEW_INCOGNITO));
549 localized_strings->SetString("extensionSettingsEnable", 551 localized_strings->SetString("extensionSettingsEnable",
550 l10n_util::GetStringUTF16(IDS_EXTENSIONS_ENABLE)); 552 l10n_util::GetStringUTF16(IDS_EXTENSIONS_ENABLE));
551 localized_strings->SetString("extensionSettingsEnabled", 553 localized_strings->SetString("extensionSettingsEnabled",
552 l10n_util::GetStringUTF16(IDS_EXTENSIONS_ENABLED)); 554 l10n_util::GetStringUTF16(IDS_EXTENSIONS_ENABLED));
553 localized_strings->SetString("extensionSettingsRemove", 555 localized_strings->SetString("extensionSettingsRemove",
554 l10n_util::GetStringUTF16(IDS_EXTENSIONS_REMOVE)); 556 l10n_util::GetStringUTF16(IDS_EXTENSIONS_REMOVE));
555 localized_strings->SetString("extensionSettingsEnableIncognito", 557 localized_strings->SetString("extensionSettingsEnableIncognito",
556 l10n_util::GetStringUTF16(IDS_EXTENSIONS_ENABLE_INCOGNITO)); 558 l10n_util::GetStringUTF16(IDS_EXTENSIONS_ENABLE_INCOGNITO));
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
684 extension_data->SetBoolean("wantsFileAccess", extension->wants_file_access()); 686 extension_data->SetBoolean("wantsFileAccess", extension->wants_file_access());
685 extension_data->SetBoolean("allowFileAccess", 687 extension_data->SetBoolean("allowFileAccess",
686 service ? service->AllowFileAccess(extension) : false); 688 service ? service->AllowFileAccess(extension) : false);
687 extension_data->SetBoolean("allow_activity", 689 extension_data->SetBoolean("allow_activity",
688 enabled && CommandLine::ForCurrentProcess()->HasSwitch( 690 enabled && CommandLine::ForCurrentProcess()->HasSwitch(
689 switches::kEnableExtensionActivityUI)); 691 switches::kEnableExtensionActivityUI));
690 extension_data->SetBoolean("allow_reload", 692 extension_data->SetBoolean("allow_reload",
691 extension->location() == Extension::LOAD); 693 extension->location() == Extension::LOAD);
692 extension_data->SetBoolean("is_hosted_app", extension->is_hosted_app()); 694 extension_data->SetBoolean("is_hosted_app", extension->is_hosted_app());
693 695
696 // Add unrecognized manifest keys
James Hawkins 2012/04/08 20:33:23 nit: Add period.
mitchellwrosen 2012/04/28 19:02:39 Done.
697 const std::vector<const std::string*>* unrecognized_keys_vec;
not at google - send to devlin 2012/04/10 02:02:32 just call it "unrecognized_keys" or even "keys".
not at google - send to devlin 2012/04/10 02:02:32 also, a bit of a nit, but since this is a really l
mitchellwrosen 2012/04/28 19:02:39 Done.
698 if (extension->HasUnrecognizedManifestKeys(&unrecognized_keys_vec)) {
699 ListValue* unrecognized_keys = new ListValue;
not at google - send to devlin 2012/04/10 02:02:32 nit: ListValue not ListValue()
mitchellwrosen 2012/04/28 19:02:39 Done.
700 for (std::vector<const std::string*>::const_iterator iter =
701 unrecognized_keys_vec->begin();
702 iter != unrecognized_keys_vec->end();
703 ++iter) {
not at google - send to devlin 2012/04/09 13:01:54 nit: call iterators "it" or "i", it's more concise
mitchellwrosen 2012/04/28 19:02:39 Done.
704 unrecognized_keys->Append(Value::CreateStringValue(**iter));
705 }
706 extension_data->Set("unrecognizedKeys", unrecognized_keys);
707 }
708
694 // Determine the sort order: Extensions loaded through --load-extensions show 709 // Determine the sort order: Extensions loaded through --load-extensions show
695 // up at the top. Disabled extensions show up at the bottom. 710 // up at the top. Disabled extensions show up at the bottom.
696 if (extension->location() == Extension::LOAD) 711 if (extension->location() == Extension::LOAD)
697 extension_data->SetInteger("order", 1); 712 extension_data->SetInteger("order", 1);
698 else 713 else
699 extension_data->SetInteger("order", 2); 714 extension_data->SetInteger("order", 2);
700 715
701 if (!extension->options_url().is_empty() && enabled) 716 if (!extension->options_url().is_empty() && enabled)
702 extension_data->SetString("options_url", extension->options_url().spec()); 717 extension_data->SetString("options_url", extension->options_url().spec());
703 718
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
782 chrome::VIEW_TYPE_EXTENSION_DIALOG == host_type) 797 chrome::VIEW_TYPE_EXTENSION_DIALOG == host_type)
783 continue; 798 continue;
784 799
785 GURL url = host->GetDelegate()->GetURL(); 800 GURL url = host->GetDelegate()->GetURL();
786 content::RenderProcessHost* process = host->GetProcess(); 801 content::RenderProcessHost* process = host->GetProcess();
787 result->push_back( 802 result->push_back(
788 ExtensionPage(url, process->GetID(), host->GetRoutingID(), 803 ExtensionPage(url, process->GetID(), host->GetRoutingID(),
789 process->GetBrowserContext()->IsOffTheRecord())); 804 process->GetBrowserContext()->IsOffTheRecord()));
790 } 805 }
791 } 806 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698