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 917 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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, | 933 kSelectType, |
934 select_title, | 934 select_title, |
935 last_unpacked_directory_, | 935 last_unpacked_directory_, |
936 NULL, | 936 NULL, |
937 kFileTypeIndex, | 937 kFileTypeIndex, |
938 FILE_PATH_LITERAL(std::string()), | 938 base::FilePath::StringType(), |
939 web_ui()->GetWebContents()->GetView()->GetTopLevelNativeWindow(), | 939 web_ui()->GetWebContents()->GetView()->GetTopLevelNativeWindow(), |
940 NULL); | 940 NULL); |
941 } | 941 } |
942 | 942 |
943 void ExtensionSettingsHandler::ShowAlert(const std::string& message) { | 943 void ExtensionSettingsHandler::ShowAlert(const std::string& message) { |
944 ListValue arguments; | 944 ListValue arguments; |
945 arguments.Append(Value::CreateStringValue(message)); | 945 arguments.Append(Value::CreateStringValue(message)); |
946 web_ui()->CallJavascriptFunction("alert", arguments); | 946 web_ui()->CallJavascriptFunction("alert", arguments); |
947 } | 947 } |
948 | 948 |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1119 std::vector<std::string> requirement_errors) { | 1119 std::vector<std::string> requirement_errors) { |
1120 if (requirement_errors.empty()) { | 1120 if (requirement_errors.empty()) { |
1121 extension_service_->EnableExtension(extension_id); | 1121 extension_service_->EnableExtension(extension_id); |
1122 } else { | 1122 } else { |
1123 ExtensionErrorReporter::GetInstance()->ReportError( | 1123 ExtensionErrorReporter::GetInstance()->ReportError( |
1124 UTF8ToUTF16(JoinString(requirement_errors, ' ')), | 1124 UTF8ToUTF16(JoinString(requirement_errors, ' ')), |
1125 true /* be noisy */); | 1125 true /* be noisy */); |
1126 } | 1126 } |
1127 requirements_checker_.reset(); | 1127 requirements_checker_.reset(); |
1128 } | 1128 } |
OLD | NEW |