OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "app/message_box_flags.h" | 9 #include "app/message_box_flags.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 929 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
940 IPC::Message* reply_message) { | 940 IPC::Message* reply_message) { |
941 bool success = false; | 941 bool success = false; |
942 const Extension* extension = GetEnabledExtension(extension_handle); | 942 const Extension* extension = GetEnabledExtension(extension_handle); |
943 ExtensionService* service = profile_->GetExtensionService(); | 943 ExtensionService* service = profile_->GetExtensionService(); |
944 ExtensionMessageService* message_service = | 944 ExtensionMessageService* message_service = |
945 profile_->GetExtensionMessageService(); | 945 profile_->GetExtensionMessageService(); |
946 Browser* browser = browser_tracker_->GetResource(browser_handle); | 946 Browser* browser = browser_tracker_->GetResource(browser_handle); |
947 if (extension && service && message_service && browser) { | 947 if (extension && service && message_service && browser) { |
948 int tab_id = ExtensionTabUtil::GetTabId(browser->GetSelectedTabContents()); | 948 int tab_id = ExtensionTabUtil::GetTabId(browser->GetSelectedTabContents()); |
949 if (extension->page_action()) { | 949 if (extension->page_action()) { |
950 ExtensionBrowserEventRouter::GetInstance()->PageActionExecuted( | 950 service->browser_event_router()->PageActionExecuted( |
951 browser->profile(), extension->id(), "action", tab_id, "", 1); | 951 browser->profile(), extension->id(), "action", tab_id, "", 1); |
952 success = true; | 952 success = true; |
953 } else if (extension->browser_action()) { | 953 } else if (extension->browser_action()) { |
954 ExtensionBrowserEventRouter::GetInstance()->BrowserActionExecuted( | 954 service->browser_event_router()->BrowserActionExecuted( |
955 browser->profile(), extension->id(), browser); | 955 browser->profile(), extension->id(), browser); |
956 success = true; | 956 success = true; |
957 } | 957 } |
958 } | 958 } |
959 AutomationMsg_ExecuteExtensionActionInActiveTabAsync::WriteReplyParams( | 959 AutomationMsg_ExecuteExtensionActionInActiveTabAsync::WriteReplyParams( |
960 reply_message, success); | 960 reply_message, success); |
961 Send(reply_message); | 961 Send(reply_message); |
962 } | 962 } |
963 | 963 |
964 void AutomationProvider::MoveExtensionBrowserAction( | 964 void AutomationProvider::MoveExtensionBrowserAction( |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1029 } | 1029 } |
1030 } | 1030 } |
1031 } | 1031 } |
1032 | 1032 |
1033 void AutomationProvider::SaveAsAsync(int tab_handle) { | 1033 void AutomationProvider::SaveAsAsync(int tab_handle) { |
1034 NavigationController* tab = NULL; | 1034 NavigationController* tab = NULL; |
1035 TabContents* tab_contents = GetTabContentsForHandle(tab_handle, &tab); | 1035 TabContents* tab_contents = GetTabContentsForHandle(tab_handle, &tab); |
1036 if (tab_contents) | 1036 if (tab_contents) |
1037 tab_contents->OnSavePage(); | 1037 tab_contents->OnSavePage(); |
1038 } | 1038 } |
OLD | NEW |