| 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/crx_installer.h" | 5 #include "chrome/browser/extensions/crx_installer.h" |
| 6 #include "chrome/browser/extensions/extension_browsertest.h" | 6 #include "chrome/browser/extensions/extension_browsertest.h" |
| 7 #include "chrome/browser/extensions/extension_install_ui.h" | 7 #include "chrome/browser/extensions/extension_install_ui.h" |
| 8 #include "chrome/browser/extensions/extension_service.h" | 8 #include "chrome/browser/extensions/extension_service.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 bool confirmation_requested() { return confirmation_requested_; } | 24 bool confirmation_requested() { return confirmation_requested_; } |
| 25 | 25 |
| 26 // Overriding some of the ExtensionInstallUI API. | 26 // Overriding some of the ExtensionInstallUI API. |
| 27 void ConfirmInstall(Delegate* delegate, const Extension* extension) { | 27 void ConfirmInstall(Delegate* delegate, const Extension* extension) { |
| 28 confirmation_requested_ = true; | 28 confirmation_requested_ = true; |
| 29 delegate->InstallUIProceed(); | 29 delegate->InstallUIProceed(); |
| 30 } | 30 } |
| 31 void OnInstallSuccess(const Extension* extension, SkBitmap* icon) { | 31 void OnInstallSuccess(const Extension* extension, SkBitmap* icon) { |
| 32 MessageLoopForUI::current()->Quit(); | 32 MessageLoopForUI::current()->Quit(); |
| 33 } | 33 } |
| 34 void OnInstallFailure(const std::string& error) { | 34 void OnInstallFailure(const string16& error) { |
| 35 ADD_FAILURE() << "install failed"; | 35 ADD_FAILURE() << "install failed"; |
| 36 MessageLoopForUI::current()->Quit(); | 36 MessageLoopForUI::current()->Quit(); |
| 37 } | 37 } |
| 38 | 38 |
| 39 private: | 39 private: |
| 40 bool confirmation_requested_; | 40 bool confirmation_requested_; |
| 41 }; | 41 }; |
| 42 | 42 |
| 43 } // namespace | 43 } // namespace |
| 44 | 44 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 test_data_dir_.AppendASCII("experimental")); | 88 test_data_dir_.AppendASCII("experimental")); |
| 89 ASSERT_FALSE(crx_path.empty()); | 89 ASSERT_FALSE(crx_path.empty()); |
| 90 | 90 |
| 91 // Now reset the command line so that we are testing specifically whether | 91 // Now reset the command line so that we are testing specifically whether |
| 92 // installing from webstore enables experimental permissions. | 92 // installing from webstore enables experimental permissions. |
| 93 *(CommandLine::ForCurrentProcess()) = old_command_line; | 93 *(CommandLine::ForCurrentProcess()) = old_command_line; |
| 94 | 94 |
| 95 EXPECT_FALSE(InstallExtension(crx_path, 0)); | 95 EXPECT_FALSE(InstallExtension(crx_path, 0)); |
| 96 EXPECT_TRUE(InstallExtensionFromWebstore(crx_path, 1)); | 96 EXPECT_TRUE(InstallExtensionFromWebstore(crx_path, 1)); |
| 97 } | 97 } |
| OLD | NEW |