| 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/bundle_installer.h" | 5 #include "chrome/browser/extensions/bundle_installer.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 // lets CrxInstaller bypass the prompt. | 158 // lets CrxInstaller bypass the prompt. |
| 159 scoped_ptr<WebstoreInstaller::Approval> approval( | 159 scoped_ptr<WebstoreInstaller::Approval> approval( |
| 160 WebstoreInstaller::Approval::CreateWithNoInstallPrompt( | 160 WebstoreInstaller::Approval::CreateWithNoInstallPrompt( |
| 161 profile_, | 161 profile_, |
| 162 i->first, | 162 i->first, |
| 163 scoped_ptr<base::DictionaryValue>( | 163 scoped_ptr<base::DictionaryValue>( |
| 164 parsed_manifests_[i->first]->DeepCopy()), true)); | 164 parsed_manifests_[i->first]->DeepCopy()), true)); |
| 165 approval->use_app_installed_bubble = false; | 165 approval->use_app_installed_bubble = false; |
| 166 approval->skip_post_install_ui = true; | 166 approval->skip_post_install_ui = true; |
| 167 | 167 |
| 168 scoped_refptr<WebstoreInstaller> installer = new WebstoreInstaller( | 168 scoped_refptr<WebstoreInstaller> installer = |
| 169 profile_, | 169 new WebstoreInstaller(profile_, |
| 170 this, | 170 this, |
| 171 controller, | 171 controller->GetWebContents(), |
| 172 i->first, | 172 i->first, |
| 173 approval.Pass(), | 173 approval.Pass(), |
| 174 WebstoreInstaller::INSTALL_SOURCE_OTHER); | 174 WebstoreInstaller::INSTALL_SOURCE_OTHER); |
| 175 installer->Start(); | 175 installer->Start(); |
| 176 } | 176 } |
| 177 } | 177 } |
| 178 | 178 |
| 179 base::string16 BundleInstaller::GetHeadingTextFor(Item::State state) const { | 179 base::string16 BundleInstaller::GetHeadingTextFor(Item::State state) const { |
| 180 // For STATE_FAILED, we can't tell if the items were apps or extensions | 180 // For STATE_FAILED, we can't tell if the items were apps or extensions |
| 181 // so we always show the same message. | 181 // so we always show the same message. |
| 182 if (state == Item::STATE_FAILED) { | 182 if (state == Item::STATE_FAILED) { |
| 183 if (GetItemsWithState(state).size()) | 183 if (GetItemsWithState(state).size()) |
| 184 return l10n_util::GetStringUTF16(IDS_EXTENSION_BUNDLE_ERROR_HEADING); | 184 return l10n_util::GetStringUTF16(IDS_EXTENSION_BUNDLE_ERROR_HEADING); |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 void BundleInstaller::OnBrowserAdded(Browser* browser) {} | 348 void BundleInstaller::OnBrowserAdded(Browser* browser) {} |
| 349 | 349 |
| 350 void BundleInstaller::OnBrowserRemoved(Browser* browser) { | 350 void BundleInstaller::OnBrowserRemoved(Browser* browser) { |
| 351 if (browser_ == browser) | 351 if (browser_ == browser) |
| 352 browser_ = NULL; | 352 browser_ = NULL; |
| 353 } | 353 } |
| 354 | 354 |
| 355 void BundleInstaller::OnBrowserSetLastActive(Browser* browser) {} | 355 void BundleInstaller::OnBrowserSetLastActive(Browser* browser) {} |
| 356 | 356 |
| 357 } // namespace extensions | 357 } // namespace extensions |
| OLD | NEW |