| OLD | NEW |
| 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 "chrome/browser/sxs_linux.h" | 5 #include "chrome/browser/sxs_linux.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 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" |
| 11 #include "base/files/file_util.h" | 11 #include "base/files/file_util.h" |
| 12 #include "base/files/important_file_writer.h" | 12 #include "base/files/important_file_writer.h" |
| 13 #include "base/logging.h" | 13 #include "base/logging.h" |
| 14 #include "base/path_service.h" | 14 #include "base/path_service.h" |
| 15 #include "base/strings/string_split.h" | 15 #include "base/strings/string_split.h" |
| 16 #include "base/strings/string_util.h" | 16 #include "base/strings/string_util.h" |
| 17 #include "chrome/common/channel_info.h" |
| 17 #include "chrome/common/chrome_paths.h" | 18 #include "chrome/common/chrome_paths.h" |
| 18 #include "chrome/common/chrome_result_codes.h" | 19 #include "chrome/common/chrome_result_codes.h" |
| 19 #include "chrome/common/chrome_switches.h" | 20 #include "chrome/common/chrome_switches.h" |
| 20 #include "chrome/common/chrome_version_info.h" | 21 #include "components/version_info/version_info.h" |
| 21 #include "content/public/browser/browser_thread.h" | 22 #include "content/public/browser/browser_thread.h" |
| 22 | 23 |
| 23 namespace { | 24 namespace { |
| 24 | 25 |
| 25 const char kChannelsFileName[] = "Channels"; | 26 const char kChannelsFileName[] = "Channels"; |
| 26 | 27 |
| 27 std::string GetChannelMarkForThisExecutable() { | 28 std::string GetChannelMarkForThisExecutable() { |
| 28 std::string product_channel_name; | 29 std::string product_channel_name; |
| 29 version_info::Channel product_channel( | 30 version_info::Channel product_channel(chrome::GetChannel()); |
| 30 chrome::VersionInfo::GetChannel()); | |
| 31 switch (product_channel) { | 31 switch (product_channel) { |
| 32 case version_info::Channel::UNKNOWN: { | 32 case version_info::Channel::UNKNOWN: { |
| 33 // Add the channel mark even for Chromium builds (which do not have | 33 // Add the channel mark even for Chromium builds (which do not have |
| 34 // channel) to better handle possibility of users using Chromium builds | 34 // channel) to better handle possibility of users using Chromium builds |
| 35 // with their Google Chrome profiles. Include version string modifier | 35 // with their Google Chrome profiles. Include version string modifier |
| 36 // as additional piece of information for debugging (it can't make | 36 // as additional piece of information for debugging (it can't make |
| 37 // a meaningful difference for the code since unknown does not match any | 37 // a meaningful difference for the code since unknown does not match any |
| 38 // real channel name). | 38 // real channel name). |
| 39 std::string version_string_modifier( | 39 std::string version_string_modifier(chrome::GetChannelString()); |
| 40 chrome::VersionInfo::GetVersionStringModifier()); | |
| 41 product_channel_name = "unknown (" + version_string_modifier + ")"; | 40 product_channel_name = "unknown (" + version_string_modifier + ")"; |
| 42 break; | 41 break; |
| 43 } | 42 } |
| 44 case version_info::Channel::CANARY: | 43 case version_info::Channel::CANARY: |
| 45 product_channel_name = "canary"; | 44 product_channel_name = "canary"; |
| 46 break; | 45 break; |
| 47 case version_info::Channel::DEV: | 46 case version_info::Channel::DEV: |
| 48 product_channel_name = "dev"; | 47 product_channel_name = "dev"; |
| 49 break; | 48 break; |
| 50 case version_info::Channel::BETA: | 49 case version_info::Channel::BETA: |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 if (!base::Move(source_path, target_path)) { | 149 if (!base::Move(source_path, target_path)) { |
| 151 LOG(ERROR) << "Failed to rename '" << source_path.value() | 150 LOG(ERROR) << "Failed to rename '" << source_path.value() |
| 152 << "' to '" << target_path.value() << "'"; | 151 << "' to '" << target_path.value() << "'"; |
| 153 return chrome::RESULT_CODE_SXS_MIGRATION_FAILED; | 152 return chrome::RESULT_CODE_SXS_MIGRATION_FAILED; |
| 154 } | 153 } |
| 155 | 154 |
| 156 return content::RESULT_CODE_NORMAL_EXIT; | 155 return content::RESULT_CODE_NORMAL_EXIT; |
| 157 } | 156 } |
| 158 | 157 |
| 159 } // namespace sxs_linux | 158 } // namespace sxs_linux |
| OLD | NEW |