| 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/extension_settings_handler.h" | 5 #include "chrome/browser/ui/webui/extensions/extension_settings_handler.h" |
| 6 | 6 |
| 7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
| 8 #include "base/base64.h" | 8 #include "base/base64.h" |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 912 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 923 | 923 |
| 924 string16 select_title = | 924 string16 select_title = |
| 925 l10n_util::GetStringUTF16(IDS_EXTENSION_LOAD_FROM_DIRECTORY); | 925 l10n_util::GetStringUTF16(IDS_EXTENSION_LOAD_FROM_DIRECTORY); |
| 926 | 926 |
| 927 const int kFileTypeIndex = 0; // No file type information to index. | 927 const int kFileTypeIndex = 0; // No file type information to index. |
| 928 const ui::SelectFileDialog::Type kSelectType = | 928 const ui::SelectFileDialog::Type kSelectType = |
| 929 ui::SelectFileDialog::SELECT_FOLDER; | 929 ui::SelectFileDialog::SELECT_FOLDER; |
| 930 load_extension_dialog_ = ui::SelectFileDialog::Create( | 930 load_extension_dialog_ = ui::SelectFileDialog::Create( |
| 931 this, new ChromeSelectFilePolicy(web_ui()->GetWebContents())); | 931 this, new ChromeSelectFilePolicy(web_ui()->GetWebContents())); |
| 932 load_extension_dialog_->SelectFile( | 932 load_extension_dialog_->SelectFile( |
| 933 kSelectType, select_title, last_unpacked_directory_, NULL, | 933 kSelectType, |
| 934 kFileTypeIndex, FILE_PATH_LITERAL(""), | 934 select_title, |
| 935 web_ui()->GetWebContents()->GetView()->GetTopLevelNativeWindow(), NULL); | 935 last_unpacked_directory_, |
| 936 NULL, |
| 937 kFileTypeIndex, |
| 938 base::FilePath::StringType(), |
| 939 web_ui()->GetWebContents()->GetView()->GetTopLevelNativeWindow(), |
| 940 NULL); |
| 936 } | 941 } |
| 937 | 942 |
| 938 void ExtensionSettingsHandler::ShowAlert(const std::string& message) { | 943 void ExtensionSettingsHandler::ShowAlert(const std::string& message) { |
| 939 ListValue arguments; | 944 ListValue arguments; |
| 940 arguments.Append(Value::CreateStringValue(message)); | 945 arguments.Append(Value::CreateStringValue(message)); |
| 941 web_ui()->CallJavascriptFunction("alert", arguments); | 946 web_ui()->CallJavascriptFunction("alert", arguments); |
| 942 } | 947 } |
| 943 | 948 |
| 944 const Extension* ExtensionSettingsHandler::GetActiveExtension( | 949 const Extension* ExtensionSettingsHandler::GetActiveExtension( |
| 945 const ListValue* args) { | 950 const ListValue* args) { |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1114 std::vector<std::string> requirement_errors) { | 1119 std::vector<std::string> requirement_errors) { |
| 1115 if (requirement_errors.empty()) { | 1120 if (requirement_errors.empty()) { |
| 1116 extension_service_->EnableExtension(extension_id); | 1121 extension_service_->EnableExtension(extension_id); |
| 1117 } else { | 1122 } else { |
| 1118 ExtensionErrorReporter::GetInstance()->ReportError( | 1123 ExtensionErrorReporter::GetInstance()->ReportError( |
| 1119 UTF8ToUTF16(JoinString(requirement_errors, ' ')), | 1124 UTF8ToUTF16(JoinString(requirement_errors, ' ')), |
| 1120 true /* be noisy */); | 1125 true /* be noisy */); |
| 1121 } | 1126 } |
| 1122 requirements_checker_.reset(); | 1127 requirements_checker_.reset(); |
| 1123 } | 1128 } |
| OLD | NEW |