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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 cmd_line->GetSwitchValueASCII(switches::kAppsGalleryDownloadURL); | 71 cmd_line->GetSwitchValueASCII(switches::kAppsGalleryDownloadURL); |
72 return GURL(base::StringPrintf(download_url.c_str(), | 72 return GURL(base::StringPrintf(download_url.c_str(), |
73 extension_id.c_str())); | 73 extension_id.c_str())); |
74 } | 74 } |
75 std::vector<std::string> params; | 75 std::vector<std::string> params; |
76 params.push_back("id=" + extension_id); | 76 params.push_back("id=" + extension_id); |
77 if (!install_source.empty()) | 77 if (!install_source.empty()) |
78 params.push_back("installsource=" + install_source); | 78 params.push_back("installsource=" + install_source); |
79 params.push_back("lang=" + g_browser_process->GetApplicationLocale()); | 79 params.push_back("lang=" + g_browser_process->GetApplicationLocale()); |
80 params.push_back("uc"); | 80 params.push_back("uc"); |
81 std::string url_string = extension_urls::GetWebstoreUpdateUrl(true).spec(); | 81 std::string url_string = extension_urls::GetWebstoreUpdateUrl().spec(); |
82 | 82 |
83 GURL url(url_string + "?response=redirect&x=" + | 83 GURL url(url_string + "?response=redirect&x=" + |
84 net::EscapeQueryParamValue(JoinString(params, '&'), true)); | 84 net::EscapeQueryParamValue(JoinString(params, '&'), true)); |
85 DCHECK(url.is_valid()); | 85 DCHECK(url.is_valid()); |
86 | 86 |
87 return url; | 87 return url; |
88 } | 88 } |
89 | 89 |
90 // Must be executed on the FILE thread. | 90 // Must be executed on the FILE thread. |
91 void GetDownloadFilePath( | 91 void GetDownloadFilePath( |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 } | 334 } |
335 | 335 |
336 void WebstoreInstaller::ReportSuccess() { | 336 void WebstoreInstaller::ReportSuccess() { |
337 if (delegate_) { | 337 if (delegate_) { |
338 delegate_->OnExtensionInstallSuccess(id_); | 338 delegate_->OnExtensionInstallSuccess(id_); |
339 delegate_ = NULL; | 339 delegate_ = NULL; |
340 } | 340 } |
341 | 341 |
342 Release(); // Balanced in Start(). | 342 Release(); // Balanced in Start(). |
343 } | 343 } |
OLD | NEW |