| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_inline_installer.h" | 5 #include "chrome/browser/extensions/webstore_inline_installer.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 } | 231 } |
| 232 if (inline_install_not_supported) { | 232 if (inline_install_not_supported) { |
| 233 std::string redirect_url; | 233 std::string redirect_url; |
| 234 if (!webstore_data->GetString(kRedirectUrlKey, &redirect_url)) { | 234 if (!webstore_data->GetString(kRedirectUrlKey, &redirect_url)) { |
| 235 CompleteInstall(kInvalidWebstoreResponseError); | 235 CompleteInstall(kInvalidWebstoreResponseError); |
| 236 return; | 236 return; |
| 237 } | 237 } |
| 238 | 238 |
| 239 tab_contents()->OpenURL(OpenURLParams( | 239 tab_contents()->OpenURL(OpenURLParams( |
| 240 GURL(redirect_url), | 240 GURL(redirect_url), |
| 241 tab_contents()->GetURL(), | 241 content::Referrer(tab_contents()->GetURL(), |
| 242 WebKit::WebReferrerPolicyDefault), |
| 242 NEW_FOREGROUND_TAB, | 243 NEW_FOREGROUND_TAB, |
| 243 content::PAGE_TRANSITION_AUTO_BOOKMARK, | 244 content::PAGE_TRANSITION_AUTO_BOOKMARK, |
| 244 false)); | 245 false)); |
| 245 CompleteInstall(kInlineInstallSupportedError); | 246 CompleteInstall(kInlineInstallSupportedError); |
| 246 return; | 247 return; |
| 247 } | 248 } |
| 248 | 249 |
| 249 // Manifest, number of users, average rating and rating count are required. | 250 // Manifest, number of users, average rating and rating count are required. |
| 250 std::string manifest; | 251 std::string manifest; |
| 251 if (!webstore_data->GetString(kManifestKey, &manifest) || | 252 if (!webstore_data->GetString(kManifestKey, &manifest) || |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 426 if (tab_contents()) { | 427 if (tab_contents()) { |
| 427 if (error.empty()) { | 428 if (error.empty()) { |
| 428 delegate_->OnInlineInstallSuccess(install_id_); | 429 delegate_->OnInlineInstallSuccess(install_id_); |
| 429 } else { | 430 } else { |
| 430 delegate_->OnInlineInstallFailure(install_id_, error); | 431 delegate_->OnInlineInstallFailure(install_id_, error); |
| 431 } | 432 } |
| 432 } | 433 } |
| 433 | 434 |
| 434 Release(); // Matches the AddRef in BeginInstall. | 435 Release(); // Matches the AddRef in BeginInstall. |
| 435 } | 436 } |
| OLD | NEW |