OLD | NEW |
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/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 899 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
910 void AutomationProvider::ExecuteExtensionActionInActiveTabAsync( | 910 void AutomationProvider::ExecuteExtensionActionInActiveTabAsync( |
911 int extension_handle, int browser_handle, | 911 int extension_handle, int browser_handle, |
912 IPC::Message* reply_message) { | 912 IPC::Message* reply_message) { |
913 bool success = false; | 913 bool success = false; |
914 const Extension* extension = GetEnabledExtension(extension_handle); | 914 const Extension* extension = GetEnabledExtension(extension_handle); |
915 ExtensionService* service = profile_->GetExtensionService(); | 915 ExtensionService* service = profile_->GetExtensionService(); |
916 ExtensionMessageService* message_service = | 916 ExtensionMessageService* message_service = |
917 profile_->GetExtensionMessageService(); | 917 profile_->GetExtensionMessageService(); |
918 Browser* browser = browser_tracker_->GetResource(browser_handle); | 918 Browser* browser = browser_tracker_->GetResource(browser_handle); |
919 if (extension && service && message_service && browser) { | 919 if (extension && service && message_service && browser) { |
920 int tab_id = ExtensionTabUtil::GetTabId(browser->GetSelectedTabContents()); | 920 int tab_id = ExtensionTabUtil::GetTabId(browser->GetSelectedWebContents()); |
921 if (extension->page_action()) { | 921 if (extension->page_action()) { |
922 service->browser_event_router()->PageActionExecuted( | 922 service->browser_event_router()->PageActionExecuted( |
923 browser->profile(), extension->id(), "action", tab_id, "", 1); | 923 browser->profile(), extension->id(), "action", tab_id, "", 1); |
924 success = true; | 924 success = true; |
925 } else if (extension->browser_action()) { | 925 } else if (extension->browser_action()) { |
926 service->browser_event_router()->BrowserActionExecuted( | 926 service->browser_event_router()->BrowserActionExecuted( |
927 browser->profile(), extension->id(), browser); | 927 browser->profile(), extension->id(), browser); |
928 success = true; | 928 success = true; |
929 } | 929 } |
930 } | 930 } |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1001 } | 1001 } |
1002 } | 1002 } |
1003 } | 1003 } |
1004 | 1004 |
1005 void AutomationProvider::SaveAsAsync(int tab_handle) { | 1005 void AutomationProvider::SaveAsAsync(int tab_handle) { |
1006 NavigationController* tab = NULL; | 1006 NavigationController* tab = NULL; |
1007 WebContents* web_contents = GetWebContentsForHandle(tab_handle, &tab); | 1007 WebContents* web_contents = GetWebContentsForHandle(tab_handle, &tab); |
1008 if (web_contents) | 1008 if (web_contents) |
1009 web_contents->OnSavePage(); | 1009 web_contents->OnSavePage(); |
1010 } | 1010 } |
OLD | NEW |