| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/webstore_installer.h" | 5 #include "chrome/browser/extensions/webstore_installer.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 cmd_line->GetSwitchValueASCII(switches::kAppsGalleryDownloadURL); | 73 cmd_line->GetSwitchValueASCII(switches::kAppsGalleryDownloadURL); |
| 74 return GURL(base::StringPrintf(download_url.c_str(), | 74 return GURL(base::StringPrintf(download_url.c_str(), |
| 75 extension_id.c_str())); | 75 extension_id.c_str())); |
| 76 } | 76 } |
| 77 std::vector<std::string> params; | 77 std::vector<std::string> params; |
| 78 params.push_back("id=" + extension_id); | 78 params.push_back("id=" + extension_id); |
| 79 if (!install_source.empty()) | 79 if (!install_source.empty()) |
| 80 params.push_back("installsource=" + install_source); | 80 params.push_back("installsource=" + install_source); |
| 81 params.push_back("lang=" + g_browser_process->GetApplicationLocale()); | 81 params.push_back("lang=" + g_browser_process->GetApplicationLocale()); |
| 82 params.push_back("uc"); | 82 params.push_back("uc"); |
| 83 std::string url_string = extension_urls::GetWebstoreUpdateUrl().spec(); | 83 std::string url_string = extension_urls::GetWebstoreUpdateUrl(true).spec(); |
| 84 | 84 |
| 85 GURL url(url_string + "?response=redirect&x=" + | 85 GURL url(url_string + "?response=redirect&x=" + |
| 86 net::EscapeQueryParamValue(JoinString(params, '&'), true)); | 86 net::EscapeQueryParamValue(JoinString(params, '&'), true)); |
| 87 DCHECK(url.is_valid()); | 87 DCHECK(url.is_valid()); |
| 88 | 88 |
| 89 return url; | 89 return url; |
| 90 } | 90 } |
| 91 | 91 |
| 92 // Must be executed on the FILE thread. | 92 // Must be executed on the FILE thread. |
| 93 void GetDownloadFilePath( | 93 void GetDownloadFilePath( |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 } | 339 } |
| 340 | 340 |
| 341 void WebstoreInstaller::ReportSuccess() { | 341 void WebstoreInstaller::ReportSuccess() { |
| 342 if (delegate_) { | 342 if (delegate_) { |
| 343 delegate_->OnExtensionInstallSuccess(id_); | 343 delegate_->OnExtensionInstallSuccess(id_); |
| 344 delegate_ = NULL; | 344 delegate_ = NULL; |
| 345 } | 345 } |
| 346 | 346 |
| 347 Release(); // Balanced in Start(). | 347 Release(); // Balanced in Start(). |
| 348 } | 348 } |
| OLD | NEW |