| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/extensions/chrome_content_verifier_delegate.h" | 5 #include "chrome/browser/extensions/chrome_content_verifier_delegate.h" |
| 6 | 6 |
| 7 #include "base/base_switches.h" | 7 #include "base/base_switches.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/metrics/field_trial.h" | 9 #include "base/metrics/field_trial.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 const std::string& extension_id, | 128 const std::string& extension_id, |
| 129 const base::Version& version) { | 129 const base::Version& version) { |
| 130 // TODO(asargent) Factor out common code from the extension updater's | 130 // TODO(asargent) Factor out common code from the extension updater's |
| 131 // ManifestFetchData class that can be shared for use here. | 131 // ManifestFetchData class that can be shared for use here. |
| 132 std::vector<std::string> parts; | 132 std::vector<std::string> parts; |
| 133 parts.push_back("uc"); | 133 parts.push_back("uc"); |
| 134 parts.push_back("installsource=signature"); | 134 parts.push_back("installsource=signature"); |
| 135 parts.push_back("id=" + extension_id); | 135 parts.push_back("id=" + extension_id); |
| 136 parts.push_back("v=" + version.GetString()); | 136 parts.push_back("v=" + version.GetString()); |
| 137 std::string x_value = | 137 std::string x_value = |
| 138 net::EscapeQueryParamValue(base::JoinString(parts, "&"), true); | 138 net::EscapeQueryParamValue(JoinString(parts, "&"), true); |
| 139 std::string query = "response=redirect&x=" + x_value; | 139 std::string query = "response=redirect&x=" + x_value; |
| 140 | 140 |
| 141 GURL base_url = extension_urls::GetWebstoreUpdateUrl(); | 141 GURL base_url = extension_urls::GetWebstoreUpdateUrl(); |
| 142 GURL::Replacements replacements; | 142 GURL::Replacements replacements; |
| 143 replacements.SetQuery(query.c_str(), url::Component(0, query.length())); | 143 replacements.SetQuery(query.c_str(), url::Component(0, query.length())); |
| 144 return base_url.ReplaceComponents(replacements); | 144 return base_url.ReplaceComponents(replacements); |
| 145 } | 145 } |
| 146 | 146 |
| 147 std::set<base::FilePath> ChromeContentVerifierDelegate::GetBrowserImagePaths( | 147 std::set<base::FilePath> ChromeContentVerifierDelegate::GetBrowserImagePaths( |
| 148 const extensions::Extension* extension) { | 148 const extensions::Extension* extension) { |
| (...skipping 30 matching lines...) Expand all Loading... |
| 179 void ChromeContentVerifierDelegate::LogFailureForPolicyForceInstall( | 179 void ChromeContentVerifierDelegate::LogFailureForPolicyForceInstall( |
| 180 const std::string& extension_id) { | 180 const std::string& extension_id) { |
| 181 if (!ContainsKey(corrupt_policy_extensions_, extension_id)) { | 181 if (!ContainsKey(corrupt_policy_extensions_, extension_id)) { |
| 182 corrupt_policy_extensions_.insert(extension_id); | 182 corrupt_policy_extensions_.insert(extension_id); |
| 183 UMA_HISTOGRAM_BOOLEAN("Extensions.CorruptPolicyExtensionWouldBeDisabled", | 183 UMA_HISTOGRAM_BOOLEAN("Extensions.CorruptPolicyExtensionWouldBeDisabled", |
| 184 true); | 184 true); |
| 185 } | 185 } |
| 186 } | 186 } |
| 187 | 187 |
| 188 } // namespace extensions | 188 } // namespace extensions |
| OLD | NEW |