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

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

Issue 1560027: Refactor FileVersionInfo into an interface with platform implementations. (Closed)
Patch Set: comments Created 10 years, 8 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 | « chrome/chrome_exe.gypi ('k') | chrome/renderer/renderer_glue.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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/common/extensions/extension.h" 5 #include "chrome/common/extensions/extension.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "app/l10n_util.h" 9 #include "app/l10n_util.h"
10 #include "app/resource_bundle.h" 10 #include "app/resource_bundle.h"
11 #include "base/base64.h" 11 #include "base/base64.h"
12 #include "base/basictypes.h" 12 #include "base/basictypes.h"
13 #include "base/command_line.h" 13 #include "base/command_line.h"
14 #include "base/file_path.h" 14 #include "base/file_path.h"
15 #include "base/file_util.h" 15 #include "base/file_util.h"
16 #include "base/file_version_info.h" 16 #include "base/file_version_info.h"
17 #include "base/logging.h" 17 #include "base/logging.h"
18 #include "base/stl_util-inl.h" 18 #include "base/stl_util-inl.h"
19 #include "base/third_party/nss/blapi.h" 19 #include "base/third_party/nss/blapi.h"
20 #include "base/third_party/nss/sha256.h" 20 #include "base/third_party/nss/sha256.h"
21 #include "base/utf_string_conversions.h" 21 #include "base/utf_string_conversions.h"
22 #include "chrome/app/chrome_version_info.h"
22 #include "chrome/common/chrome_constants.h" 23 #include "chrome/common/chrome_constants.h"
23 #include "chrome/common/chrome_switches.h" 24 #include "chrome/common/chrome_switches.h"
24 #include "chrome/common/extensions/extension_constants.h" 25 #include "chrome/common/extensions/extension_constants.h"
25 #include "chrome/common/extensions/extension_error_reporter.h" 26 #include "chrome/common/extensions/extension_error_reporter.h"
26 #include "chrome/common/extensions/extension_error_utils.h" 27 #include "chrome/common/extensions/extension_error_utils.h"
27 #include "chrome/common/extensions/extension_l10n_util.h" 28 #include "chrome/common/extensions/extension_l10n_util.h"
28 #include "chrome/common/extensions/user_script.h" 29 #include "chrome/common/extensions/user_script.h"
29 #include "chrome/common/notification_service.h" 30 #include "chrome/common/notification_service.h"
30 #include "chrome/common/url_constants.h" 31 #include "chrome/common/url_constants.h"
31 #include "grit/chromium_strings.h" 32 #include "grit/chromium_strings.h"
(...skipping 936 matching lines...) Expand 10 before | Expand all | Expand 10 after
968 } 969 }
969 970
970 scoped_ptr<Version> minimum_version( 971 scoped_ptr<Version> minimum_version(
971 Version::GetVersionFromString(minimum_version_string)); 972 Version::GetVersionFromString(minimum_version_string));
972 if (!minimum_version.get()) { 973 if (!minimum_version.get()) {
973 *error = errors::kInvalidMinimumChromeVersion; 974 *error = errors::kInvalidMinimumChromeVersion;
974 return false; 975 return false;
975 } 976 }
976 977
977 scoped_ptr<FileVersionInfo> current_version_info( 978 scoped_ptr<FileVersionInfo> current_version_info(
978 FileVersionInfo::CreateFileVersionInfoForCurrentModule()); 979 chrome_app::GetChromeVersionInfo());
979 if (!current_version_info.get()) { 980 if (!current_version_info.get()) {
980 DCHECK(false); 981 DCHECK(false);
981 return false; 982 return false;
982 } 983 }
983 984
984 scoped_ptr<Version> current_version( 985 scoped_ptr<Version> current_version(
985 Version::GetVersionFromString(current_version_info->file_version())); 986 Version::GetVersionFromString(current_version_info->file_version()));
986 if (!current_version.get()) { 987 if (!current_version.get()) {
987 DCHECK(false); 988 DCHECK(false);
988 return false; 989 return false;
(...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after
1616 } else { 1617 } else {
1617 return false; 1618 return false;
1618 } 1619 }
1619 } else { 1620 } else {
1620 return true; 1621 return true;
1621 } 1622 }
1622 } 1623 }
1623 } 1624 }
1624 return false; 1625 return false;
1625 } 1626 }
OLDNEW
« no previous file with comments | « chrome/chrome_exe.gypi ('k') | chrome/renderer/renderer_glue.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698