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

Side by Side Diff: extensions/common/extension.cc

Issue 819193002: Make callers of CommandLine use it via the base:: namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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
« no previous file with comments | « extensions/browser/extension_prefs_factory.cc ('k') | extensions/common/feature_switch.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "extensions/common/extension.h" 5 #include "extensions/common/extension.h"
6 6
7 #include "base/base64.h" 7 #include "base/base64.h"
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 if (is_hosted_app()) 334 if (is_hosted_app())
335 return false; 335 return false;
336 336
337 return true; 337 return true;
338 } 338 }
339 339
340 bool Extension::ShouldNotBeVisible() const { 340 bool Extension::ShouldNotBeVisible() const {
341 // Don't show component extensions because they are only extensions as an 341 // Don't show component extensions because they are only extensions as an
342 // implementation detail of Chrome. 342 // implementation detail of Chrome.
343 if (extensions::Manifest::IsComponentLocation(location()) && 343 if (extensions::Manifest::IsComponentLocation(location()) &&
344 !CommandLine::ForCurrentProcess()->HasSwitch( 344 !base::CommandLine::ForCurrentProcess()->HasSwitch(
345 switches::kShowComponentExtensionOptions)) { 345 switches::kShowComponentExtensionOptions)) {
346 return true; 346 return true;
347 } 347 }
348 348
349 // Always show unpacked extensions and apps. 349 // Always show unpacked extensions and apps.
350 if (Manifest::IsUnpackedLocation(location())) 350 if (Manifest::IsUnpackedLocation(location()))
351 return false; 351 return false;
352 352
353 // Don't show apps that aren't visible in either launcher or ntp. 353 // Don't show apps that aren't visible in either launcher or ntp.
354 if (is_app() && !ShouldDisplayInAppLauncher() && !ShouldDisplayInNewTabPage()) 354 if (is_app() && !ShouldDisplayInAppLauncher() && !ShouldDisplayInNewTabPage())
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
707 if (!manifest_->GetInteger(keys::kManifestVersion, &manifest_version) || 707 if (!manifest_->GetInteger(keys::kManifestVersion, &manifest_version) ||
708 manifest_version < 1) { 708 manifest_version < 1) {
709 *error = base::ASCIIToUTF16(errors::kInvalidManifestVersion); 709 *error = base::ASCIIToUTF16(errors::kInvalidManifestVersion);
710 return false; 710 return false;
711 } 711 }
712 } 712 }
713 713
714 manifest_version_ = manifest_->GetManifestVersion(); 714 manifest_version_ = manifest_->GetManifestVersion();
715 if (manifest_version_ < kModernManifestVersion && 715 if (manifest_version_ < kModernManifestVersion &&
716 ((creation_flags_ & REQUIRE_MODERN_MANIFEST_VERSION && 716 ((creation_flags_ & REQUIRE_MODERN_MANIFEST_VERSION &&
717 !CommandLine::ForCurrentProcess()->HasSwitch( 717 !base::CommandLine::ForCurrentProcess()->HasSwitch(
718 switches::kAllowLegacyExtensionManifests)) || 718 switches::kAllowLegacyExtensionManifests)) ||
719 GetType() == Manifest::TYPE_PLATFORM_APP)) { 719 GetType() == Manifest::TYPE_PLATFORM_APP)) {
720 *error = ErrorUtils::FormatErrorMessageUTF16( 720 *error = ErrorUtils::FormatErrorMessageUTF16(
721 errors::kInvalidManifestVersionOld, 721 errors::kInvalidManifestVersionOld,
722 base::IntToString(kModernManifestVersion), 722 base::IntToString(kModernManifestVersion),
723 is_platform_app() ? "apps" : "extensions"); 723 is_platform_app() ? "apps" : "extensions");
724 return false; 724 return false;
725 } 725 }
726 726
727 return true; 727 return true;
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
775 775
776 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo( 776 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo(
777 const Extension* extension, 777 const Extension* extension,
778 const PermissionSet* permissions, 778 const PermissionSet* permissions,
779 Reason reason) 779 Reason reason)
780 : reason(reason), 780 : reason(reason),
781 extension(extension), 781 extension(extension),
782 permissions(permissions) {} 782 permissions(permissions) {}
783 783
784 } // namespace extensions 784 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/extension_prefs_factory.cc ('k') | extensions/common/feature_switch.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698