| 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/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/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 896 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 907 } | 907 } |
| 908 } | 908 } |
| 909 | 909 |
| 910 void AutomationProvider::DisableExtension(int extension_handle, | 910 void AutomationProvider::DisableExtension(int extension_handle, |
| 911 bool* success) { | 911 bool* success) { |
| 912 *success = false; | 912 *success = false; |
| 913 const Extension* extension = GetEnabledExtension(extension_handle); | 913 const Extension* extension = GetEnabledExtension(extension_handle); |
| 914 ExtensionService* service = profile_->GetExtensionService(); | 914 ExtensionService* service = profile_->GetExtensionService(); |
| 915 if (extension && service) { | 915 if (extension && service) { |
| 916 ExtensionUnloadNotificationObserver observer; | 916 ExtensionUnloadNotificationObserver observer; |
| 917 service->DisableExtension(extension->id()); | 917 service->DisableExtension(extension->id(), Extension::DISABLE_USER_ACTION); |
| 918 // The extension unload notification should have been sent synchronously | 918 // The extension unload notification should have been sent synchronously |
| 919 // with the disable. Just to be safe, check that it was received. | 919 // with the disable. Just to be safe, check that it was received. |
| 920 *success = observer.did_receive_unload_notification(); | 920 *success = observer.did_receive_unload_notification(); |
| 921 } | 921 } |
| 922 } | 922 } |
| 923 | 923 |
| 924 void AutomationProvider::ExecuteExtensionActionInActiveTabAsync( | 924 void AutomationProvider::ExecuteExtensionActionInActiveTabAsync( |
| 925 int extension_handle, int browser_handle, | 925 int extension_handle, int browser_handle, |
| 926 IPC::Message* reply_message) { | 926 IPC::Message* reply_message) { |
| 927 bool success = false; | 927 bool success = false; |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1015 } | 1015 } |
| 1016 } | 1016 } |
| 1017 } | 1017 } |
| 1018 | 1018 |
| 1019 void AutomationProvider::SaveAsAsync(int tab_handle) { | 1019 void AutomationProvider::SaveAsAsync(int tab_handle) { |
| 1020 NavigationController* tab = NULL; | 1020 NavigationController* tab = NULL; |
| 1021 WebContents* web_contents = GetWebContentsForHandle(tab_handle, &tab); | 1021 WebContents* web_contents = GetWebContentsForHandle(tab_handle, &tab); |
| 1022 if (web_contents) | 1022 if (web_contents) |
| 1023 web_contents->OnSavePage(); | 1023 web_contents->OnSavePage(); |
| 1024 } | 1024 } |
| OLD | NEW |