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

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

Issue 265563004: Add a note to chrome://extensions to explain when an extension has been... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add enum Created 6 years, 7 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/ui/webui/extensions/extension_settings_handler.h" 5 #include "chrome/browser/ui/webui/extensions/extension_settings_handler.h"
6 6
7 #include "apps/app_load_service.h" 7 #include "apps/app_load_service.h"
8 #include "apps/app_restore_service.h" 8 #include "apps/app_restore_service.h"
9 #include "apps/app_window.h" 9 #include "apps/app_window.h"
10 #include "apps/app_window_registry.h" 10 #include "apps/app_window_registry.h"
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 206
207 ExtensionPrefs* prefs = ExtensionPrefs::Get(extension_service_->profile()); 207 ExtensionPrefs* prefs = ExtensionPrefs::Get(extension_service_->profile());
208 int disable_reasons = prefs->GetDisableReasons(extension->id()); 208 int disable_reasons = prefs->GetDisableReasons(extension->id());
209 209
210 bool suspicious_install = 210 bool suspicious_install =
211 (disable_reasons & Extension::DISABLE_NOT_VERIFIED) != 0; 211 (disable_reasons & Extension::DISABLE_NOT_VERIFIED) != 0;
212 extension_data->SetBoolean("suspiciousInstall", suspicious_install); 212 extension_data->SetBoolean("suspiciousInstall", suspicious_install);
213 if (suspicious_install) 213 if (suspicious_install)
214 should_do_verification_check_ = true; 214 should_do_verification_check_ = true;
215 215
216 bool corrupt_install =
217 (disable_reasons & Extension::DISABLE_CORRUPTED) != 0;
218 extension_data->SetBoolean("corruptInstall", corrupt_install);
219
216 bool managed_install = 220 bool managed_install =
217 !management_policy_->UserMayModifySettings(extension, NULL); 221 !management_policy_->UserMayModifySettings(extension, NULL);
218 extension_data->SetBoolean("managedInstall", managed_install); 222 extension_data->SetBoolean("managedInstall", managed_install);
219 223
220 // We should not get into a state where both are true. 224 // We should not get into a state where both are true.
221 DCHECK(managed_install == false || suspicious_install == false); 225 DCHECK(managed_install == false || suspicious_install == false);
226 DCHECK(managed_install == false || corrupt_install == false);
Bernhard Bauer 2014/05/05 11:27:18 Could you merge these? And also replace the compa
Finnur 2014/05/05 13:02:02 Actually, now that I think about it, the latter DC
222 227
223 GURL icon = 228 GURL icon =
224 ExtensionIconSource::GetIconURL(extension, 229 ExtensionIconSource::GetIconURL(extension,
225 extension_misc::EXTENSION_ICON_MEDIUM, 230 extension_misc::EXTENSION_ICON_MEDIUM,
226 ExtensionIconSet::MATCH_BIGGER, 231 ExtensionIconSet::MATCH_BIGGER,
227 !enabled, NULL); 232 !enabled, NULL);
228 if (Manifest::IsUnpackedLocation(extension->location())) 233 if (Manifest::IsUnpackedLocation(extension->location()))
229 extension_data->SetString("path", extension->path().value()); 234 extension_data->SetString("path", extension->path().value());
230 extension_data->SetString("icon", icon.spec()); 235 extension_data->SetString("icon", icon.spec());
231 extension_data->SetBoolean("isUnpacked", 236 extension_data->SetBoolean("isUnpacked",
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 source->AddString("extensionSettingsPermissions", 455 source->AddString("extensionSettingsPermissions",
451 l10n_util::GetStringUTF16(IDS_EXTENSIONS_PERMISSIONS_LINK)); 456 l10n_util::GetStringUTF16(IDS_EXTENSIONS_PERMISSIONS_LINK));
452 source->AddString("extensionSettingsVisitWebsite", 457 source->AddString("extensionSettingsVisitWebsite",
453 l10n_util::GetStringUTF16(IDS_EXTENSIONS_VISIT_WEBSITE)); 458 l10n_util::GetStringUTF16(IDS_EXTENSIONS_VISIT_WEBSITE));
454 source->AddString("extensionSettingsVisitWebStore", 459 source->AddString("extensionSettingsVisitWebStore",
455 l10n_util::GetStringUTF16(IDS_EXTENSIONS_VISIT_WEBSTORE)); 460 l10n_util::GetStringUTF16(IDS_EXTENSIONS_VISIT_WEBSTORE));
456 source->AddString("extensionSettingsPolicyControlled", 461 source->AddString("extensionSettingsPolicyControlled",
457 l10n_util::GetStringUTF16(IDS_EXTENSIONS_POLICY_CONTROLLED)); 462 l10n_util::GetStringUTF16(IDS_EXTENSIONS_POLICY_CONTROLLED));
458 source->AddString("extensionSettingsManagedMode", 463 source->AddString("extensionSettingsManagedMode",
459 l10n_util::GetStringUTF16(IDS_EXTENSIONS_LOCKED_MANAGED_USER)); 464 l10n_util::GetStringUTF16(IDS_EXTENSIONS_LOCKED_MANAGED_USER));
465 source->AddString("extensionSettingsCorruptInstall",
466 l10n_util::GetStringUTF16(
467 IDS_EXTENSIONS_CORRUPTED_EXTENSION));
460 source->AddString("extensionSettingsSuspiciousInstall", 468 source->AddString("extensionSettingsSuspiciousInstall",
461 l10n_util::GetStringFUTF16( 469 l10n_util::GetStringFUTF16(
462 IDS_EXTENSIONS_ADDED_WITHOUT_KNOWLEDGE, 470 IDS_EXTENSIONS_ADDED_WITHOUT_KNOWLEDGE,
463 l10n_util::GetStringUTF16(IDS_EXTENSION_WEB_STORE_TITLE))); 471 l10n_util::GetStringUTF16(IDS_EXTENSION_WEB_STORE_TITLE)));
464 source->AddString("extensionSettingsSuspiciousInstallLearnMore", 472 source->AddString("extensionSettingsLearnMore",
465 l10n_util::GetStringUTF16(IDS_LEARN_MORE)); 473 l10n_util::GetStringUTF16(IDS_LEARN_MORE));
474 source->AddString("extensionSettingsCorruptInstallHelpUrl",
475 base::ASCIIToUTF16(google_util::AppendGoogleLocaleParam(
476 GURL(chrome::kCorruptExtensionURL)).spec()));
466 source->AddString("extensionSettingsSuspiciousInstallHelpUrl", 477 source->AddString("extensionSettingsSuspiciousInstallHelpUrl",
467 base::ASCIIToUTF16(google_util::AppendGoogleLocaleParam( 478 base::ASCIIToUTF16(google_util::AppendGoogleLocaleParam(
468 GURL(chrome::kRemoveNonCWSExtensionURL)).spec())); 479 GURL(chrome::kRemoveNonCWSExtensionURL)).spec()));
469 source->AddString("extensionSettingsShowButton", 480 source->AddString("extensionSettingsShowButton",
470 l10n_util::GetStringUTF16(IDS_EXTENSIONS_SHOW_BUTTON)); 481 l10n_util::GetStringUTF16(IDS_EXTENSIONS_SHOW_BUTTON));
471 source->AddString("extensionSettingsLoadUnpackedButton", 482 source->AddString("extensionSettingsLoadUnpackedButton",
472 l10n_util::GetStringUTF16(IDS_EXTENSIONS_LOAD_UNPACKED_BUTTON)); 483 l10n_util::GetStringUTF16(IDS_EXTENSIONS_LOAD_UNPACKED_BUTTON));
473 source->AddString("extensionSettingsPackButton", 484 source->AddString("extensionSettingsPackButton",
474 l10n_util::GetStringUTF16(IDS_EXTENSIONS_PACK_BUTTON)); 485 l10n_util::GetStringUTF16(IDS_EXTENSIONS_PACK_BUTTON));
475 source->AddString("extensionSettingsCommandsLink", 486 source->AddString("extensionSettingsCommandsLink",
(...skipping 799 matching lines...) Expand 10 before | Expand all | Expand 10 after
1275 extension_service_->EnableExtension(extension_id); 1286 extension_service_->EnableExtension(extension_id);
1276 } else { 1287 } else {
1277 ExtensionErrorReporter::GetInstance()->ReportError( 1288 ExtensionErrorReporter::GetInstance()->ReportError(
1278 base::UTF8ToUTF16(JoinString(requirement_errors, ' ')), 1289 base::UTF8ToUTF16(JoinString(requirement_errors, ' ')),
1279 true); // Be noisy. 1290 true); // Be noisy.
1280 } 1291 }
1281 requirements_checker_.reset(); 1292 requirements_checker_.reset();
1282 } 1293 }
1283 1294
1284 } // namespace extensions 1295 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698