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

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

Issue 2379763003: Extract permission alias info from PermissionsProvider (Closed)
Patch Set: not nesting Alias in AliasProvider Created 4 years, 2 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
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "extensions/common/alias.h"
6
7 #include "base/logging.h"
8 #include "base/version.h"
9 #include "components/version_info/version_info.h"
10
11 namespace extensions {
12
13 namespace {
14
15 bool CurrentVersionWithinAliasVersionBound(const char* version_string) {
16 if (!version_string)
17 return true;
18 base::Version upper_version_bound(version_string);
19 CHECK(upper_version_bound.IsValid());
20
21 base::Version current_version(version_info::GetVersionNumber());
22 return upper_version_bound.CompareTo(current_version) > 0;
23 }
24
25 } // namespace
26
27 Alias::Alias(const char* const name,
28 const char* const real_name,
29 const char* const upper_version_bound)
30 : name_(name),
31 real_name_(real_name),
32 valid_(CurrentVersionWithinAliasVersionBound(upper_version_bound)) {}
33
34 Alias::~Alias() {}
35
36 } // namespace extension
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698