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/pack_extension_handler.h" | 5 #include "chrome/browser/ui/webui/extensions/pack_extension_handler.h" |
6 | 6 |
| 7 #include "chrome/browser/chrome_select_file_policy.h" |
7 #include "chrome/browser/extensions/extension_creator.h" | 8 #include "chrome/browser/extensions/extension_creator.h" |
8 #include "base/bind.h" | 9 #include "base/bind.h" |
9 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
10 #include "content/public/browser/web_contents.h" | 11 #include "content/public/browser/web_contents.h" |
11 #include "content/public/browser/web_contents_view.h" | 12 #include "content/public/browser/web_contents_view.h" |
12 #include "content/public/browser/web_ui.h" | 13 #include "content/public/browser/web_ui.h" |
13 #include "grit/generated_resources.h" | 14 #include "grit/generated_resources.h" |
14 #include "ui/base/l10n/l10n_util.h" | 15 #include "ui/base/l10n/l10n_util.h" |
15 | 16 |
16 PackExtensionHandler::PackExtensionHandler() { | 17 PackExtensionHandler::PackExtensionHandler() { |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 IDS_EXTENSION_PACK_DIALOG_KEY_FILE_TYPE_DESCRIPTION)); | 174 IDS_EXTENSION_PACK_DIALOG_KEY_FILE_TYPE_DESCRIPTION)); |
174 info.include_all_files = true; | 175 info.include_all_files = true; |
175 file_type_index = 1; | 176 file_type_index = 1; |
176 } else { | 177 } else { |
177 NOTREACHED(); | 178 NOTREACHED(); |
178 } | 179 } |
179 | 180 |
180 load_extension_dialog_ = SelectFileDialog::Create(this); | 181 load_extension_dialog_ = SelectFileDialog::Create(this); |
181 load_extension_dialog_->SelectFile( | 182 load_extension_dialog_->SelectFile( |
182 type, select_title, FilePath(), &info, file_type_index, | 183 type, select_title, FilePath(), &info, file_type_index, |
183 FILE_PATH_LITERAL(""), web_ui()->GetWebContents(), | 184 FILE_PATH_LITERAL(""), |
184 web_ui()->GetWebContents()->GetView()->GetTopLevelNativeWindow(), NULL); | 185 ChromeSelectFilePolicy::DisplayInfobarCallback( |
| 186 web_ui()->GetWebContents()), |
| 187 web_ui()->GetWebContents()->GetView()->GetTopLevelNativeWindow(), |
| 188 NULL); |
185 } | 189 } |
186 | 190 |
187 void PackExtensionHandler::ShowAlert(const std::string& message) { | 191 void PackExtensionHandler::ShowAlert(const std::string& message) { |
188 ListValue arguments; | 192 ListValue arguments; |
189 arguments.Append(Value::CreateStringValue(message)); | 193 arguments.Append(Value::CreateStringValue(message)); |
190 web_ui()->CallJavascriptFunction("PackExtensionOverlay.showError", arguments); | 194 web_ui()->CallJavascriptFunction("PackExtensionOverlay.showError", arguments); |
191 } | 195 } |
OLD | NEW |