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

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

Issue 200003: Chrome side of the fix for http://b/issue?id=1694574, which is a bug caused w... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 3 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
Index: chrome/browser/automation/automation_provider_win.cc
===================================================================
--- chrome/browser/automation/automation_provider_win.cc (revision 25555)
+++ chrome/browser/automation/automation_provider_win.cc (working copy)
@@ -335,10 +335,14 @@
*tab_handle = 0;
*tab_container_window = NULL;
*tab_window = NULL;
- ExternalTabContainer* external_tab_container =
+ scoped_refptr<ExternalTabContainer> external_tab_container =
new ExternalTabContainer(this, automation_resource_message_filter_);
+
Profile* profile = settings.is_off_the_record ?
profile_->GetOffTheRecordProfile() : profile_;
+
+ // When the ExternalTabContainer window is created we grab a reference on it
+ // which is released when the window is destroyed.
external_tab_container->Init(profile, settings.parent, settings.dimensions,
settings.style, settings.load_requests_via_automation,
settings.handle_top_level_requests, NULL);
@@ -350,7 +354,7 @@
*tab_container_window = external_tab_container->GetNativeView();
*tab_window = tab_contents->GetNativeView();
} else {
- delete external_tab_container;
+ external_tab_container->Uninitialize();
}
}
@@ -451,3 +455,33 @@
tab_contents->delegate()->ExecuteContextMenuCommand(command);
}
}
+
+void AutomationProvider::ConnectExternalTab(
+ intptr_t cookie,
+ gfx::NativeWindow* tab_container_window,
+ gfx::NativeWindow* tab_window,
+ int* tab_handle) {
+ *tab_handle = 0;
+ *tab_container_window = NULL;
+ *tab_window = NULL;
+
+ scoped_refptr<ExternalTabContainer> external_tab_container =
+ ExternalTabContainer::RemovePendingTab(cookie);
+ if (!external_tab_container.get()) {
+ NOTREACHED();
+ return;
+ }
+
+ if (AddExternalTab(external_tab_container)) {
+ external_tab_container->Reinitialize(this,
+ automation_resource_message_filter_);
+ TabContents* tab_contents = external_tab_container->tab_contents();
+ *tab_handle = external_tab_container->tab_handle();
+ external_tab_container->set_tab_handle(*tab_handle);
+ *tab_container_window = external_tab_container->GetNativeView();
+ *tab_window = tab_contents->GetNativeView();
+ } else {
+ external_tab_container->Uninitialize();
+ }
+}
+
« no previous file with comments | « chrome/browser/automation/automation_provider.cc ('k') | chrome/browser/automation/automation_resource_message_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698