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

Unified Diff: chrome/browser/automation/automation_provider.cc

Issue 20179: Reverting 9388. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/automation/automation_provider.h ('k') | chrome/browser/external_tab_container.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/automation/automation_provider.cc
===================================================================
--- chrome/browser/automation/automation_provider.cc (revision 9391)
+++ chrome/browser/automation/automation_provider.cc (working copy)
@@ -770,8 +770,6 @@
SetAcceleratorsForTab)
IPC_MESSAGE_HANDLER(AutomationMsg_ProcessUnhandledAccelerator,
ProcessUnhandledAccelerator)
- IPC_MESSAGE_HANDLER(AutomationMsg_SetInitialFocus,
- SetInitialFocus)
IPC_MESSAGE_HANDLER(AutomationMsg_WaitForTabToBeRestored,
WaitForTabToBeRestored)
IPC_MESSAGE_HANDLER(AutomationMsg_GetSecurityState,
@@ -2107,10 +2105,18 @@
HACCEL accel_table,
int accel_entry_count) {
bool status = false;
- ExternalTabContainer* external_tab = GetExternalTabForHandle(handle);
- if (external_tab) {
- external_tab->SetAccelerators(accel_table, accel_entry_count);
- status = true;
+ if (tab_tracker_->ContainsHandle(handle)) {
+ NavigationController* tab = tab_tracker_->GetResource(handle);
+ TabContents* tab_contents = tab->GetTabContents(TAB_CONTENTS_WEB);
+ ExternalTabContainer* external_tab_container =
+ ExternalTabContainer::GetContainerForTab(
+ tab_contents->GetContainerHWND());
+ // This call is only valid on an externally hosted tab
+ if (external_tab_container) {
+ external_tab_container->SetAccelerators(accel_table,
+ accel_entry_count);
+ status = true;
+ }
}
Send(new AutomationMsg_SetAcceleratorsForTabResponse(message.routing_id(),
status));
@@ -2118,22 +2124,20 @@
void AutomationProvider::ProcessUnhandledAccelerator(
const IPC::Message& message, int handle, const MSG& msg) {
- ExternalTabContainer* external_tab = GetExternalTabForHandle(handle);
- if (external_tab) {
- external_tab->ProcessUnhandledAccelerator(msg);
+ if (tab_tracker_->ContainsHandle(handle)) {
+ NavigationController* tab = tab_tracker_->GetResource(handle);
+ TabContents* tab_contents = tab->GetTabContents(TAB_CONTENTS_WEB);
+ ExternalTabContainer* external_tab_container =
+ ExternalTabContainer::GetContainerForTab(
+ tab_contents->GetContainerHWND());
+ // This call is only valid on an externally hosted tab
+ if (external_tab_container) {
+ external_tab_container->ProcessUnhandledAccelerator(msg);
+ }
}
// This message expects no response.
}
-void AutomationProvider::SetInitialFocus(const IPC::Message& message,
- int handle, bool reverse) {
- ExternalTabContainer* external_tab = GetExternalTabForHandle(handle);
- if (external_tab) {
- external_tab->SetInitialFocus(reverse);
- }
- // This message expects no response.
-}
-
void AutomationProvider::WaitForTabToBeRestored(
const IPC::Message& message,
int tab_handle) {
@@ -2387,20 +2391,6 @@
return web_contents;
}
-ExternalTabContainer* AutomationProvider::GetExternalTabForHandle(int handle) {
- if (tab_tracker_->ContainsHandle(handle)) {
- NavigationController* tab = tab_tracker_->GetResource(handle);
- TabContents* tab_contents = tab->GetTabContents(TAB_CONTENTS_WEB);
- DCHECK(tab_contents);
- if (tab_contents) {
- HWND hwnd = tab_contents->GetContainerHWND();
- return ExternalTabContainer::GetContainerForTab(hwnd);
- }
- }
-
- return NULL;
-}
-
TestingAutomationProvider::TestingAutomationProvider(Profile* profile)
: AutomationProvider(profile) {
BrowserList::AddObserver(this);
« no previous file with comments | « chrome/browser/automation/automation_provider.h ('k') | chrome/browser/external_tab_container.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698