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

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

Issue 801603002: Add support for command line switches to Features, and as proof that it works, (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: test fixes 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/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"
11 #include "base/strings/string_util.h" 11 #include "base/strings/string_util.h"
12 #include "base/strings/stringprintf.h" 12 #include "base/strings/stringprintf.h"
13 #include "extensions/common/extension.h" 13 #include "extensions/common/extension.h"
14 #include "extensions/common/manifest.h"
14 15
15 namespace extensions { 16 namespace extensions {
16 17
17 // static 18 // static
18 Feature::Platform Feature::GetCurrentPlatform() { 19 Feature::Platform Feature::GetCurrentPlatform() {
19 #if defined(OS_CHROMEOS) 20 #if defined(OS_CHROMEOS)
20 return CHROMEOS_PLATFORM; 21 return CHROMEOS_PLATFORM;
21 #elif defined(OS_LINUX) 22 #elif defined(OS_LINUX)
22 return LINUX_PLATFORM; 23 return LINUX_PLATFORM;
23 #elif defined(OS_MACOSX) 24 #elif defined(OS_MACOSX)
(...skipping 12 matching lines...) Expand all
36 } 37 }
37 38
38 Feature::Availability Feature::IsAvailableToExtension( 39 Feature::Availability Feature::IsAvailableToExtension(
39 const Extension* extension) { 40 const Extension* extension) {
40 return IsAvailableToManifest(extension->id(), 41 return IsAvailableToManifest(extension->id(),
41 extension->GetType(), 42 extension->GetType(),
42 extension->location(), 43 extension->location(),
43 extension->manifest_version()); 44 extension->manifest_version());
44 } 45 }
45 46
47 Feature::Availability Feature::IsAvailableToEnvironment() const {
48 return IsAvailableToManifest("", // extension_id
49 Manifest::TYPE_UNKNOWN,
50 Manifest::INVALID_LOCATION,
51 -1); // manifest_version
52 }
53
46 Feature::Feature() : no_parent_(false) {} 54 Feature::Feature() : no_parent_(false) {}
47 55
48 Feature::~Feature() {} 56 Feature::~Feature() {}
49 57
50 } // namespace extensions 58 } // 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