Chromium Code Reviews| 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_standalone_installer.h" | 5 #include "chrome/browser/extensions/webstore_standalone_installer.h" |
| 6 | 6 |
| 7 #include "base/values.h" | 7 #include "base/values.h" |
| 8 #include "base/version.h" | 8 #include "base/version.h" |
| 9 #include "chrome/browser/extensions/crx_installer.h" | 9 #include "chrome/browser/extensions/crx_installer.h" |
| 10 #include "chrome/browser/extensions/extension_install_prompt.h" | 10 #include "chrome/browser/extensions/extension_install_prompt.h" |
| 11 #include "chrome/browser/extensions/extension_install_ui.h" | 11 #include "chrome/browser/extensions/extension_install_ui.h" |
| 12 #include "chrome/browser/extensions/extension_install_ui_util.h" | |
| 12 #include "chrome/browser/extensions/extension_service.h" | 13 #include "chrome/browser/extensions/extension_service.h" |
| 13 #include "chrome/browser/extensions/install_tracker.h" | 14 #include "chrome/browser/extensions/install_tracker.h" |
| 14 #include "chrome/browser/extensions/webstore_data_fetcher.h" | 15 #include "chrome/browser/extensions/webstore_data_fetcher.h" |
| 15 #include "chrome/browser/profiles/profile.h" | 16 #include "chrome/browser/profiles/profile.h" |
| 16 #include "content/public/browser/web_contents.h" | 17 #include "content/public/browser/web_contents.h" |
| 17 #include "extensions/browser/extension_prefs.h" | 18 #include "extensions/browser/extension_prefs.h" |
| 18 #include "extensions/browser/extension_registry.h" | 19 #include "extensions/browser/extension_registry.h" |
| 19 #include "extensions/browser/extension_system.h" | 20 #include "extensions/browser/extension_system.h" |
| 20 #include "extensions/browser/extension_util.h" | 21 #include "extensions/browser/extension_util.h" |
| 21 #include "extensions/common/extension.h" | 22 #include "extensions/common/extension.h" |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 353 kInvalidManifestError); | 354 kInvalidManifestError); |
| 354 return; | 355 return; |
| 355 } | 356 } |
| 356 | 357 |
| 357 if (installed_extension->version()->CompareTo( | 358 if (installed_extension->version()->CompareTo( |
| 358 *extension_to_install->version()) < 0) { | 359 *extension_to_install->version()) < 0) { |
| 359 // If the existing extension is out of date, proceed with the install | 360 // If the existing extension is out of date, proceed with the install |
| 360 // to update the extension. | 361 // to update the extension. |
| 361 done = false; | 362 done = false; |
| 362 } else { | 363 } else { |
| 364 install_ui::ShowPostInstallUIForApproval( | |
| 365 profile_, *approval, installed_extension); | |
| 363 extension_service->PromoteEphemeralApp(installed_extension, false); | 366 extension_service->PromoteEphemeralApp(installed_extension, false); |
|
asargent_no_longer_on_chrome
2014/07/21 23:23:16
I notice that both of the places we call PromoteEp
tmdiep
2014/07/21 23:32:24
Hmm, I'm inclined to keep the post-install UI out
| |
| 364 } | 367 } |
| 365 } else if (!extension_service->IsExtensionEnabled(id_)) { | 368 } else if (!extension_service->IsExtensionEnabled(id_)) { |
| 366 // If the extension is installed but disabled, and not blacklisted, | 369 // If the extension is installed but disabled, and not blacklisted, |
| 367 // enable it. | 370 // enable it. |
| 368 extension_service->EnableExtension(id_); | 371 extension_service->EnableExtension(id_); |
| 369 } // else extension is installed and enabled; no work to be done. | 372 } // else extension is installed and enabled; no work to be done. |
| 370 | 373 |
| 371 if (done) { | 374 if (done) { |
| 372 CompleteInstall(install_result, install_message); | 375 CompleteInstall(install_result, install_message); |
| 373 return; | 376 return; |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 431 void WebstoreStandaloneInstaller::OnWebStoreDataFetcherDone() { | 434 void WebstoreStandaloneInstaller::OnWebStoreDataFetcherDone() { |
| 432 // An instance of this class is passed in as a delegate for the | 435 // An instance of this class is passed in as a delegate for the |
| 433 // WebstoreInstallHelper, ExtensionInstallPrompt and WebstoreInstaller, and | 436 // WebstoreInstallHelper, ExtensionInstallPrompt and WebstoreInstaller, and |
| 434 // therefore needs to remain alive until they are done. Clear the webstore | 437 // therefore needs to remain alive until they are done. Clear the webstore |
| 435 // data fetcher to avoid calling Release in AbortInstall while any of these | 438 // data fetcher to avoid calling Release in AbortInstall while any of these |
| 436 // operations are in progress. | 439 // operations are in progress. |
| 437 webstore_data_fetcher_.reset(); | 440 webstore_data_fetcher_.reset(); |
| 438 } | 441 } |
| 439 | 442 |
| 440 } // namespace extensions | 443 } // namespace extensions |
| OLD | NEW |