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

Side by Side Diff: chrome/browser/automation/automation_provider.cc

Issue 8417012: Refactor loading out of ExtensionService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: finally Created 9 years, 1 month 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/automation/automation_provider.h" 5 #include "chrome/browser/automation/automation_provider.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 #include "chrome/browser/content_settings/host_content_settings_map.h" 43 #include "chrome/browser/content_settings/host_content_settings_map.h"
44 #include "chrome/browser/dom_operation_notification_details.h" 44 #include "chrome/browser/dom_operation_notification_details.h"
45 #include "chrome/browser/extensions/crx_installer.h" 45 #include "chrome/browser/extensions/crx_installer.h"
46 #include "chrome/browser/extensions/extension_browser_event_router.h" 46 #include "chrome/browser/extensions/extension_browser_event_router.h"
47 #include "chrome/browser/extensions/extension_host.h" 47 #include "chrome/browser/extensions/extension_host.h"
48 #include "chrome/browser/extensions/extension_install_ui.h" 48 #include "chrome/browser/extensions/extension_install_ui.h"
49 #include "chrome/browser/extensions/extension_message_service.h" 49 #include "chrome/browser/extensions/extension_message_service.h"
50 #include "chrome/browser/extensions/extension_service.h" 50 #include "chrome/browser/extensions/extension_service.h"
51 #include "chrome/browser/extensions/extension_tab_util.h" 51 #include "chrome/browser/extensions/extension_tab_util.h"
52 #include "chrome/browser/extensions/extension_toolbar_model.h" 52 #include "chrome/browser/extensions/extension_toolbar_model.h"
53 #include "chrome/browser/extensions/unpacked_installer.h"
53 #include "chrome/browser/extensions/user_script_master.h" 54 #include "chrome/browser/extensions/user_script_master.h"
54 #include "chrome/browser/net/url_request_mock_util.h" 55 #include "chrome/browser/net/url_request_mock_util.h"
55 #include "chrome/browser/prefs/pref_service.h" 56 #include "chrome/browser/prefs/pref_service.h"
56 #include "chrome/browser/printing/print_job.h" 57 #include "chrome/browser/printing/print_job.h"
57 #include "chrome/browser/profiles/profile_manager.h" 58 #include "chrome/browser/profiles/profile_manager.h"
58 #include "chrome/browser/ssl/ssl_blocking_page.h" 59 #include "chrome/browser/ssl/ssl_blocking_page.h"
59 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog.h" 60 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog.h"
60 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog_queue.h" 61 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog_queue.h"
61 #include "chrome/browser/ui/browser_list.h" 62 #include "chrome/browser/ui/browser_list.h"
62 #include "chrome/browser/ui/browser_window.h" 63 #include "chrome/browser/ui/browser_window.h"
(...skipping 787 matching lines...) Expand 10 before | Expand all | Expand 10 after
850 new ExtensionReadyNotificationObserver( 851 new ExtensionReadyNotificationObserver(
851 manager, 852 manager,
852 service, 853 service,
853 this, 854 this,
854 AutomationMsg_InstallExtension::ID, 855 AutomationMsg_InstallExtension::ID,
855 reply_message); 856 reply_message);
856 857
857 if (extension_path.MatchesExtension(FILE_PATH_LITERAL(".crx"))) { 858 if (extension_path.MatchesExtension(FILE_PATH_LITERAL(".crx"))) {
858 ExtensionInstallUI* client = 859 ExtensionInstallUI* client =
859 (with_ui ? new ExtensionInstallUI(profile_) : NULL); 860 (with_ui ? new ExtensionInstallUI(profile_) : NULL);
860 scoped_refptr<CrxInstaller> installer(service->MakeCrxInstaller(client)); 861 scoped_refptr<CrxInstaller> installer(
862 CrxInstaller::Create(service, client));
861 if (!with_ui) 863 if (!with_ui)
862 installer->set_allow_silent_install(true); 864 installer->set_allow_silent_install(true);
863 installer->set_install_cause(extension_misc::INSTALL_CAUSE_AUTOMATION); 865 installer->set_install_cause(extension_misc::INSTALL_CAUSE_AUTOMATION);
864 installer->InstallCrx(extension_path); 866 installer->InstallCrx(extension_path);
865 } else { 867 } else {
866 service->LoadExtension(extension_path, with_ui); 868 scoped_refptr<extensions::UnpackedInstaller> installer(
869 extensions::UnpackedInstaller::Create(service));
870 installer->set_prompt_for_plugins(with_ui);
871 installer->Load(extension_path);
867 } 872 }
868 } else { 873 } else {
869 AutomationMsg_InstallExtension::WriteReplyParams(reply_message, 0); 874 AutomationMsg_InstallExtension::WriteReplyParams(reply_message, 0);
870 Send(reply_message); 875 Send(reply_message);
871 } 876 }
872 } 877 }
873 878
874 void AutomationProvider::UninstallExtension(int extension_handle, 879 void AutomationProvider::UninstallExtension(int extension_handle,
875 bool* success) { 880 bool* success) {
876 *success = false; 881 *success = false;
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
1014 } 1019 }
1015 } 1020 }
1016 } 1021 }
1017 1022
1018 void AutomationProvider::SaveAsAsync(int tab_handle) { 1023 void AutomationProvider::SaveAsAsync(int tab_handle) {
1019 NavigationController* tab = NULL; 1024 NavigationController* tab = NULL;
1020 TabContents* tab_contents = GetTabContentsForHandle(tab_handle, &tab); 1025 TabContents* tab_contents = GetTabContentsForHandle(tab_handle, &tab);
1021 if (tab_contents) 1026 if (tab_contents)
1022 tab_contents->OnSavePage(); 1027 tab_contents->OnSavePage();
1023 } 1028 }
OLDNEW
« no previous file with comments | « chrome/browser/autocomplete/autocomplete_browsertest.cc ('k') | chrome/browser/chromeos/accessibility_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698