Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(490)

Side by Side Diff: chrome/browser/ui/webui/extensions/extension_settings_handler.cc

Issue 10667026: Start consolidating cross-port file selection code into ui/base/dialogs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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"
11 #include "base/command_line.h" 11 #include "base/command_line.h"
12 #include "base/file_util.h" 12 #include "base/file_util.h"
13 #include "base/string_number_conversions.h" 13 #include "base/string_number_conversions.h"
14 #include "base/utf_string_conversions.h" 14 #include "base/utf_string_conversions.h"
15 #include "base/values.h" 15 #include "base/values.h"
16 #include "base/version.h" 16 #include "base/version.h"
17 #include "chrome/browser/chrome_select_file_policy.h"
17 #include "chrome/browser/debugger/devtools_window.h" 18 #include "chrome/browser/debugger/devtools_window.h"
18 #include "chrome/browser/extensions/crx_installer.h" 19 #include "chrome/browser/extensions/crx_installer.h"
19 #include "chrome/browser/extensions/extension_disabled_ui.h" 20 #include "chrome/browser/extensions/extension_disabled_ui.h"
20 #include "chrome/browser/extensions/extension_host.h" 21 #include "chrome/browser/extensions/extension_host.h"
21 #include "chrome/browser/extensions/extension_service.h" 22 #include "chrome/browser/extensions/extension_service.h"
22 #include "chrome/browser/extensions/extension_system.h" 23 #include "chrome/browser/extensions/extension_system.h"
23 #include "chrome/browser/extensions/extension_warning_set.h" 24 #include "chrome/browser/extensions/extension_warning_set.h"
24 #include "chrome/browser/extensions/lazy_background_task_queue.h" 25 #include "chrome/browser/extensions/lazy_background_task_queue.h"
25 #include "chrome/browser/extensions/unpacked_installer.h" 26 #include "chrome/browser/extensions/unpacked_installer.h"
26 #include "chrome/browser/extensions/updater/extension_updater.h" 27 #include "chrome/browser/extensions/updater/extension_updater.h"
(...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after
713 DCHECK(args->empty()); 714 DCHECK(args->empty());
714 715
715 string16 select_title = 716 string16 select_title =
716 l10n_util::GetStringUTF16(IDS_EXTENSION_LOAD_FROM_DIRECTORY); 717 l10n_util::GetStringUTF16(IDS_EXTENSION_LOAD_FROM_DIRECTORY);
717 718
718 const int kFileTypeIndex = 0; // No file type information to index. 719 const int kFileTypeIndex = 0; // No file type information to index.
719 const SelectFileDialog::Type kSelectType = SelectFileDialog::SELECT_FOLDER; 720 const SelectFileDialog::Type kSelectType = SelectFileDialog::SELECT_FOLDER;
720 load_extension_dialog_ = SelectFileDialog::Create(this); 721 load_extension_dialog_ = SelectFileDialog::Create(this);
721 load_extension_dialog_->SelectFile( 722 load_extension_dialog_->SelectFile(
722 kSelectType, select_title, last_unpacked_directory_, NULL, 723 kSelectType, select_title, last_unpacked_directory_, NULL,
723 kFileTypeIndex, FILE_PATH_LITERAL(""), web_ui()->GetWebContents(), 724 kFileTypeIndex, FILE_PATH_LITERAL(""),
725 ChromeSelectFilePolicy::DisplayInfobarCallback(
726 web_ui()->GetWebContents()),
724 web_ui()->GetWebContents()->GetView()->GetTopLevelNativeWindow(), NULL); 727 web_ui()->GetWebContents()->GetView()->GetTopLevelNativeWindow(), NULL);
725 } 728 }
726 729
727 void ExtensionSettingsHandler::ShowAlert(const std::string& message) { 730 void ExtensionSettingsHandler::ShowAlert(const std::string& message) {
728 ListValue arguments; 731 ListValue arguments;
729 arguments.Append(Value::CreateStringValue(message)); 732 arguments.Append(Value::CreateStringValue(message));
730 web_ui()->CallJavascriptFunction("alert", arguments); 733 web_ui()->CallJavascriptFunction("alert", arguments);
731 } 734 }
732 735
733 const Extension* ExtensionSettingsHandler::GetActiveExtension( 736 const Extension* ExtensionSettingsHandler::GetActiveExtension(
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
854 return extension_uninstall_dialog_.get(); 857 return extension_uninstall_dialog_.get();
855 #else 858 #else
856 return NULL; 859 return NULL;
857 #endif // !defined(OS_ANDROID) 860 #endif // !defined(OS_ANDROID)
858 } 861 }
859 862
860 void ExtensionSettingsHandler::InspectExtensionHost(ExtensionHost* host) { 863 void ExtensionSettingsHandler::InspectExtensionHost(ExtensionHost* host) {
861 if (host) 864 if (host)
862 DevToolsWindow::OpenDevToolsWindow(host->render_view_host()); 865 DevToolsWindow::OpenDevToolsWindow(host->render_view_host());
863 } 866 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698