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

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

Issue 6125003: Make ExtensionBrowserEventRouter owned by ExtensionService.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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) 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 930 matching lines...) Expand 10 before | Expand all | Expand 10 after
941 IPC::Message* reply_message) { 941 IPC::Message* reply_message) {
942 bool success = false; 942 bool success = false;
943 const Extension* extension = GetEnabledExtension(extension_handle); 943 const Extension* extension = GetEnabledExtension(extension_handle);
944 ExtensionService* service = profile_->GetExtensionService(); 944 ExtensionService* service = profile_->GetExtensionService();
945 ExtensionMessageService* message_service = 945 ExtensionMessageService* message_service =
946 profile_->GetExtensionMessageService(); 946 profile_->GetExtensionMessageService();
947 Browser* browser = browser_tracker_->GetResource(browser_handle); 947 Browser* browser = browser_tracker_->GetResource(browser_handle);
948 if (extension && service && message_service && browser) { 948 if (extension && service && message_service && browser) {
949 int tab_id = ExtensionTabUtil::GetTabId(browser->GetSelectedTabContents()); 949 int tab_id = ExtensionTabUtil::GetTabId(browser->GetSelectedTabContents());
950 if (extension->page_action()) { 950 if (extension->page_action()) {
951 ExtensionBrowserEventRouter::GetInstance()->PageActionExecuted( 951 service->browser_event_router()->PageActionExecuted(
952 browser->profile(), extension->id(), "action", tab_id, "", 1); 952 browser->profile(), extension->id(), "action", tab_id, "", 1);
953 success = true; 953 success = true;
954 } else if (extension->browser_action()) { 954 } else if (extension->browser_action()) {
955 ExtensionBrowserEventRouter::GetInstance()->BrowserActionExecuted( 955 service->browser_event_router()->BrowserActionExecuted(
956 browser->profile(), extension->id(), browser); 956 browser->profile(), extension->id(), browser);
957 success = true; 957 success = true;
958 } 958 }
959 } 959 }
960 AutomationMsg_ExecuteExtensionActionInActiveTabAsync::WriteReplyParams( 960 AutomationMsg_ExecuteExtensionActionInActiveTabAsync::WriteReplyParams(
961 reply_message, success); 961 reply_message, success);
962 Send(reply_message); 962 Send(reply_message);
963 } 963 }
964 964
965 void AutomationProvider::MoveExtensionBrowserAction( 965 void AutomationProvider::MoveExtensionBrowserAction(
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
1030 } 1030 }
1031 } 1031 }
1032 } 1032 }
1033 1033
1034 void AutomationProvider::SaveAsAsync(int tab_handle) { 1034 void AutomationProvider::SaveAsAsync(int tab_handle) {
1035 NavigationController* tab = NULL; 1035 NavigationController* tab = NULL;
1036 TabContents* tab_contents = GetTabContentsForHandle(tab_handle, &tab); 1036 TabContents* tab_contents = GetTabContentsForHandle(tab_handle, &tab);
1037 if (tab_contents) 1037 if (tab_contents)
1038 tab_contents->OnSavePage(); 1038 tab_contents->OnSavePage();
1039 } 1039 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/browser_action_apitest.cc » ('j') | chrome/browser/extensions/extension_service.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698