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

Side by Side Diff: extensions/common/features/feature.cc

Issue 2116293003: extensions: Generate hash of extension ID at a higher level Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
« no previous file with comments | « extensions/common/features/feature.h ('k') | extensions/common/features/simple_feature.h » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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/features/feature.h" 5 #include "extensions/common/features/feature.h"
6 6
7 #include <map> 7 #include <map>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 15 matching lines...) Expand all
26 return MACOSX_PLATFORM; 26 return MACOSX_PLATFORM;
27 #elif defined(OS_WIN) 27 #elif defined(OS_WIN)
28 return WIN_PLATFORM; 28 return WIN_PLATFORM;
29 #else 29 #else
30 return UNSPECIFIED_PLATFORM; 30 return UNSPECIFIED_PLATFORM;
31 #endif 31 #endif
32 } 32 }
33 33
34 Feature::Availability Feature::IsAvailableToExtension( 34 Feature::Availability Feature::IsAvailableToExtension(
35 const Extension* extension) const { 35 const Extension* extension) const {
36 return IsAvailableToManifest(extension->id(), 36 return IsAvailableToManifest(extension->id(), HashedIdInHex(extension->id()),
37 extension->GetType(), 37 extension->GetType(), extension->location(),
38 extension->location(), 38 extension->manifest_version(),
39 extension->manifest_version()); 39 GetCurrentPlatform());
40 } 40 }
41 41
42 Feature::Availability Feature::IsAvailableToEnvironment() const { 42 Feature::Availability Feature::IsAvailableToEnvironment() const {
43 return IsAvailableToManifest("", // extension_id 43 return IsAvailableToManifest("", // extension_id
44 Manifest::TYPE_UNKNOWN, 44 Manifest::TYPE_UNKNOWN,
45 Manifest::INVALID_LOCATION, 45 Manifest::INVALID_LOCATION,
46 -1); // manifest_version 46 -1); // manifest_version
47 } 47 }
48 48
49 Feature::Feature() : no_parent_(false) {} 49 Feature::Feature() : no_parent_(false) {}
50 50
51 Feature::~Feature() {} 51 Feature::~Feature() {}
52 52
53 } // namespace extensions 53 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/common/features/feature.h ('k') | extensions/common/features/simple_feature.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698