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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 cmd_line->GetSwitchValueASCII(switches::kAppsGalleryDownloadURL); | 75 cmd_line->GetSwitchValueASCII(switches::kAppsGalleryDownloadURL); |
76 return GURL(base::StringPrintf(download_url.c_str(), | 76 return GURL(base::StringPrintf(download_url.c_str(), |
77 extension_id.c_str())); | 77 extension_id.c_str())); |
78 } | 78 } |
79 std::vector<std::string> params; | 79 std::vector<std::string> params; |
80 params.push_back("id=" + extension_id); | 80 params.push_back("id=" + extension_id); |
81 if (!install_source.empty()) | 81 if (!install_source.empty()) |
82 params.push_back("installsource=" + install_source); | 82 params.push_back("installsource=" + install_source); |
83 params.push_back("lang=" + g_browser_process->GetApplicationLocale()); | 83 params.push_back("lang=" + g_browser_process->GetApplicationLocale()); |
84 params.push_back("uc"); | 84 params.push_back("uc"); |
85 std::string url_string = extension_urls::GetWebstoreUpdateUrl(true).spec(); | 85 std::string url_string = extension_urls::GetWebstoreUpdateUrl().spec(); |
86 | 86 |
87 GURL url(url_string + "?response=redirect&x=" + | 87 GURL url(url_string + "?response=redirect&x=" + |
88 net::EscapeQueryParamValue(JoinString(params, '&'), true)); | 88 net::EscapeQueryParamValue(JoinString(params, '&'), true)); |
89 DCHECK(url.is_valid()); | 89 DCHECK(url.is_valid()); |
90 | 90 |
91 return url; | 91 return url; |
92 } | 92 } |
93 | 93 |
94 // Must be executed on the FILE thread. | 94 // Must be executed on the FILE thread. |
95 void GetDownloadFilePath( | 95 void GetDownloadFilePath( |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 void WebstoreInstaller::ReportSuccess() { | 353 void WebstoreInstaller::ReportSuccess() { |
354 if (delegate_) { | 354 if (delegate_) { |
355 delegate_->OnExtensionInstallSuccess(id_); | 355 delegate_->OnExtensionInstallSuccess(id_); |
356 delegate_ = NULL; | 356 delegate_ = NULL; |
357 } | 357 } |
358 | 358 |
359 Release(); // Balanced in Start(). | 359 Release(); // Balanced in Start(). |
360 } | 360 } |
361 | 361 |
362 } // namespace extensions | 362 } // namespace extensions |
OLD | NEW |