| 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/crx_installer.h" | 5 #include "chrome/browser/extensions/crx_installer.h" |
| 6 | 6 |
| 7 #include "base/at_exit.h" | 7 #include "base/at_exit.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 | 109 |
| 110 // Overriding some of the ExtensionInstallUI API. | 110 // Overriding some of the ExtensionInstallUI API. |
| 111 void ConfirmInstall(Delegate* delegate, | 111 void ConfirmInstall(Delegate* delegate, |
| 112 const Extension* extension, | 112 const Extension* extension, |
| 113 const ShowDialogCallback& show_dialog_callback) override { | 113 const ShowDialogCallback& show_dialog_callback) override { |
| 114 proxy_->set_confirmation_requested(); | 114 proxy_->set_confirmation_requested(); |
| 115 delegate->InstallUIProceed(); | 115 delegate->InstallUIProceed(); |
| 116 } | 116 } |
| 117 void OnInstallSuccess(const Extension* extension, SkBitmap* icon) override { | 117 void OnInstallSuccess(const Extension* extension, SkBitmap* icon) override { |
| 118 proxy_->set_extension_id(extension->id()); | 118 proxy_->set_extension_id(extension->id()); |
| 119 base::MessageLoopForUI::current()->Quit(); | 119 base::MessageLoopForUI::current()->QuitWhenIdle(); |
| 120 } | 120 } |
| 121 void OnInstallFailure(const CrxInstallError& error) override { | 121 void OnInstallFailure(const CrxInstallError& error) override { |
| 122 proxy_->set_error(error.message()); | 122 proxy_->set_error(error.message()); |
| 123 base::MessageLoopForUI::current()->Quit(); | 123 base::MessageLoopForUI::current()->QuitWhenIdle(); |
| 124 } | 124 } |
| 125 | 125 |
| 126 private: | 126 private: |
| 127 scoped_refptr<MockPromptProxy> proxy_; | 127 scoped_refptr<MockPromptProxy> proxy_; |
| 128 }; | 128 }; |
| 129 | 129 |
| 130 MockPromptProxy::MockPromptProxy(content::WebContents* web_contents) | 130 MockPromptProxy::MockPromptProxy(content::WebContents* web_contents) |
| 131 : web_contents_(web_contents), confirmation_requested_(false) { | 131 : web_contents_(web_contents), confirmation_requested_(false) { |
| 132 } | 132 } |
| 133 | 133 |
| (...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 591 ManagementPolicyMock policy; | 591 ManagementPolicyMock policy; |
| 592 extensions::ExtensionSystem::Get(profile()) | 592 extensions::ExtensionSystem::Get(profile()) |
| 593 ->management_policy() | 593 ->management_policy() |
| 594 ->RegisterProvider(&policy); | 594 ->RegisterProvider(&policy); |
| 595 | 595 |
| 596 base::FilePath crx_path = test_data_dir_.AppendASCII("crx_installer/v1.crx"); | 596 base::FilePath crx_path = test_data_dir_.AppendASCII("crx_installer/v1.crx"); |
| 597 EXPECT_FALSE(InstallExtension(crx_path, 0)); | 597 EXPECT_FALSE(InstallExtension(crx_path, 0)); |
| 598 } | 598 } |
| 599 | 599 |
| 600 } // namespace extensions | 600 } // namespace extensions |
| OLD | NEW |