| 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/ui/webui/extensions/install_extension_handler.h" | 5 #include "chrome/browser/ui/webui/extensions/install_extension_handler.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/browser/extensions/crx_installer.h" | 10 #include "chrome/browser/extensions/crx_installer.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 } | 28 } |
| 29 | 29 |
| 30 void InstallExtensionHandler::GetLocalizedValues( | 30 void InstallExtensionHandler::GetLocalizedValues( |
| 31 DictionaryValue* localized_strings) { | 31 DictionaryValue* localized_strings) { |
| 32 DCHECK(localized_strings); | 32 DCHECK(localized_strings); |
| 33 localized_strings->SetString( | 33 localized_strings->SetString( |
| 34 "extensionSettingsInstallDropTarget", | 34 "extensionSettingsInstallDropTarget", |
| 35 l10n_util::GetStringUTF16(IDS_EXTENSIONS_INSTALL_DROP_TARGET)); | 35 l10n_util::GetStringUTF16(IDS_EXTENSIONS_INSTALL_DROP_TARGET)); |
| 36 localized_strings->SetBoolean( | 36 localized_strings->SetBoolean( |
| 37 "offStoreInstallEnabled", | 37 "offStoreInstallEnabled", |
| 38 extensions::switch_utils::IsOffStoreInstallEnabled()); | 38 extensions::switch_utils::IsEasyOffStoreInstallEnabled()); |
| 39 } | 39 } |
| 40 | 40 |
| 41 void InstallExtensionHandler::RegisterMessages() { | 41 void InstallExtensionHandler::RegisterMessages() { |
| 42 web_ui()->RegisterMessageCallback( | 42 web_ui()->RegisterMessageCallback( |
| 43 "startDrag", | 43 "startDrag", |
| 44 base::Bind(&InstallExtensionHandler::HandleStartDragMessage, | 44 base::Bind(&InstallExtensionHandler::HandleStartDragMessage, |
| 45 base::Unretained(this))); | 45 base::Unretained(this))); |
| 46 web_ui()->RegisterMessageCallback( | 46 web_ui()->RegisterMessageCallback( |
| 47 "stopDrag", | 47 "stopDrag", |
| 48 base::Bind(&InstallExtensionHandler::HandleStopDragMessage, | 48 base::Bind(&InstallExtensionHandler::HandleStopDragMessage, |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 } else if (EndsWith(file_to_install_.BaseName().value(), | 99 } else if (EndsWith(file_to_install_.BaseName().value(), |
| 100 FILE_PATH_LITERAL(".crx"), | 100 FILE_PATH_LITERAL(".crx"), |
| 101 kCaseSensitive)) { | 101 kCaseSensitive)) { |
| 102 crx_installer->InstallCrx(file_to_install_); | 102 crx_installer->InstallCrx(file_to_install_); |
| 103 } else { | 103 } else { |
| 104 CHECK(false); | 104 CHECK(false); |
| 105 } | 105 } |
| 106 | 106 |
| 107 file_to_install_.clear(); | 107 file_to_install_.clear(); |
| 108 } | 108 } |
| OLD | NEW |