diff options
author | amit@chromium.org <amit@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-14 22:09:03 +0000 |
---|---|---|
committer | amit@chromium.org <amit@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-14 22:09:03 +0000 |
commit | 95c3c59d275042225cda4589525cb279f66f1f2c (patch) | |
tree | f9fc3164096b65db04c60060a882bf68e7d5d7df /chrome/browser | |
parent | 7d7b882f49e7c33e1ad7b113234fd6af94fac608 (diff) | |
download | chromium_src-95c3c59d275042225cda4589525cb279f66f1f2c.zip chromium_src-95c3c59d275042225cda4589525cb279f66f1f2c.tar.gz chromium_src-95c3c59d275042225cda4589525cb279f66f1f2c.tar.bz2 |
Remove the defunct SetAccelerator message and replace it with an
automation message to set initial settings.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/155376
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20676 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/automation/automation_provider.cc | 33 | ||||
-rw-r--r-- | chrome/browser/automation/automation_provider.h | 17 | ||||
-rw-r--r-- | chrome/browser/extensions/extension_uitest.cc | 12 | ||||
-rw-r--r-- | chrome/browser/external_tab_container.cc | 16 | ||||
-rw-r--r-- | chrome/browser/external_tab_container.h | 9 |
5 files changed, 28 insertions, 59 deletions
diff --git a/chrome/browser/automation/automation_provider.cc b/chrome/browser/automation/automation_provider.cc index 49bd64f..36e348d 100644 --- a/chrome/browser/automation/automation_provider.cc +++ b/chrome/browser/automation/automation_provider.cc @@ -999,8 +999,6 @@ void AutomationProvider::OnMessageReceived(const IPC::Message& message) { IPC_MESSAGE_HANDLER(AutomationMsg_HideInterstitialPage, HideInterstitialPage) #if defined(OS_WIN) - IPC_MESSAGE_HANDLER(AutomationMsg_SetAcceleratorsForTab, - SetAcceleratorsForTab) IPC_MESSAGE_HANDLER(AutomationMsg_ProcessUnhandledAccelerator, ProcessUnhandledAccelerator) #endif @@ -2383,20 +2381,19 @@ void AutomationProvider::CloseBrowserAsync(int browser_handle) { #if defined(OS_WIN) // TODO(port): Remove windowsisms. -void AutomationProvider::CreateExternalTab(HWND parent, - const gfx::Rect& dimensions, - unsigned int style, - bool incognito, - HWND* tab_container_window, - HWND* tab_window, - int* tab_handle) { +void AutomationProvider::CreateExternalTab( + const IPC::ExternalTabSettings& settings, + gfx::NativeWindow* tab_container_window, gfx::NativeWindow* tab_window, + int* tab_handle) { *tab_handle = 0; *tab_container_window = NULL; *tab_window = NULL; ExternalTabContainer* external_tab_container = new ExternalTabContainer(this, automation_resource_message_filter_); - Profile* profile = incognito? profile_->GetOffTheRecordProfile() : profile_; - external_tab_container->Init(profile, parent, dimensions, style); + Profile* profile = settings.is_off_the_record ? + profile_->GetOffTheRecordProfile() : profile_; + external_tab_container->Init(profile, settings.parent, settings.dimensions, + settings.style, settings.load_requests_via_automation); TabContents* tab_contents = external_tab_container->tab_contents(); if (tab_contents) { *tab_handle = tab_tracker_->Add(&tab_contents->controller()); @@ -2422,20 +2419,6 @@ void AutomationProvider::NavigateInExternalTab( } #if defined(OS_WIN) -// TODO(port): remove windowisms. -void AutomationProvider::SetAcceleratorsForTab(int handle, - HACCEL accel_table, - int accel_entry_count, - bool* status) { - *status = false; - - ExternalTabContainer* external_tab = GetExternalTabForHandle(handle); - if (external_tab) { - external_tab->SetAccelerators(accel_table, accel_entry_count); - *status = true; - } -} - void AutomationProvider::ProcessUnhandledAccelerator( const IPC::Message& message, int handle, const MSG& msg) { ExternalTabContainer* external_tab = GetExternalTabForHandle(handle); diff --git a/chrome/browser/automation/automation_provider.h b/chrome/browser/automation/automation_provider.h index 8c57e7a..ed23671 100644 --- a/chrome/browser/automation/automation_provider.h +++ b/chrome/browser/automation/automation_provider.h @@ -37,6 +37,7 @@ struct AutomationMsg_Find_Params; namespace IPC { struct Reposition_Params; +struct ExternalTabSettings; } class LoginHandler; @@ -289,14 +290,10 @@ class AutomationProvider : public base::RefCounted<AutomationProvider>, IPC::Message* reply_message); void HideInterstitialPage(int tab_handle, bool* success); -// TODO(port): remove windowisms. -#if defined(OS_WIN) - void CreateExternalTab(HWND parent, const gfx::Rect& dimensions, - unsigned int style, bool incognito, - HWND* tab_container_window, - HWND* tab_window, + void CreateExternalTab(const IPC::ExternalTabSettings& settings, + gfx::NativeWindow* tab_container_window, + gfx::NativeWindow* tab_window, int* tab_handle); -#endif // defined(OS_WIN) void NavigateInExternalTab( int handle, const GURL& url, @@ -318,12 +315,6 @@ class AutomationProvider : public base::RefCounted<AutomationProvider>, // TODO(port): remove windowisms. #if defined(OS_WIN) - // This sets the keyboard accelerators to be used by an externally - // hosted tab. This call is not valid on a regular tab hosted within - // Chrome. - void SetAcceleratorsForTab(int handle, HACCEL accel_table, - int accel_entry_count, bool* status); - void OnTabReposition(int tab_handle, const IPC::Reposition_Params& params); void OnForwardContextMenuCommandToChrome(int tab_handle, int command); diff --git a/chrome/browser/extensions/extension_uitest.cc b/chrome/browser/extensions/extension_uitest.cc index 359ba9a..6d7bc8c 100644 --- a/chrome/browser/extensions/extension_uitest.cc +++ b/chrome/browser/extensions/extension_uitest.cc @@ -54,10 +54,18 @@ class ExtensionUITest : public ParentTestType { } void TestWithURL(const GURL& url) { + const IPC::ExternalTabSettings settings = { + NULL, + gfx::Rect(), + WS_POPUP, + false, + false + }; + HWND external_tab_container = NULL; HWND tab_wnd = NULL; - scoped_refptr<TabProxy> tab(automation()->CreateExternalTab(NULL, - gfx::Rect(), WS_POPUP, false, &external_tab_container, &tab_wnd)); + scoped_refptr<TabProxy> tab(automation()->CreateExternalTab(settings, + &external_tab_container, &tab_wnd)); ASSERT_TRUE(tab != NULL); ASSERT_NE(FALSE, ::IsWindow(external_tab_container)); DoAdditionalPreNavigateSetup(tab.get()); diff --git a/chrome/browser/external_tab_container.cc b/chrome/browser/external_tab_container.cc index a2d71b5..acc6e9d 100644 --- a/chrome/browser/external_tab_container.cc +++ b/chrome/browser/external_tab_container.cc @@ -27,15 +27,10 @@ static const wchar_t kWindowObjectKey[] = L"ChromeWindowObject"; -// TODO(sanjeevr): The external_accel_table_ and external_accel_entry_count_ -// member variables are now obsolete and we don't use them. -// We need to remove them. ExternalTabContainer::ExternalTabContainer( AutomationProvider* automation, AutomationResourceMessageFilter* filter) : automation_(automation), tab_contents_(NULL), - external_accel_table_(NULL), - external_accel_entry_count_(0), tab_contents_container_(NULL), tab_handle_(0), ignore_next_load_notification_(false), @@ -50,12 +45,15 @@ ExternalTabContainer::~ExternalTabContainer() { bool ExternalTabContainer::Init(Profile* profile, HWND parent, const gfx::Rect& bounds, - DWORD style) { + DWORD style, + bool load_requests_via_automation) { if (IsWindow()) { NOTREACHED(); return false; } + load_requests_via_automation_ = load_requests_via_automation; + set_window_style(WS_POPUP); views::WidgetWin::Init(NULL, bounds); if (!IsWindow()) { @@ -117,12 +115,6 @@ bool ExternalTabContainer::Init(Profile* profile, return true; } -void ExternalTabContainer::SetAccelerators(HACCEL accel_table, - int accel_table_entry_count) { - external_accel_table_ = accel_table; - external_accel_entry_count_ = accel_table_entry_count; -} - void ExternalTabContainer::ProcessUnhandledAccelerator(const MSG& msg) { // We just received an accelerator key that we had sent to external host // back. Since the external host was not interested in handling this, we diff --git a/chrome/browser/external_tab_container.h b/chrome/browser/external_tab_container.h index d40a0f4..64accf5 100644 --- a/chrome/browser/external_tab_container.h +++ b/chrome/browser/external_tab_container.h @@ -39,10 +39,8 @@ class ExternalTabContainer : public TabContentsDelegate, bool Init(Profile* profile, HWND parent, const gfx::Rect& bounds, - DWORD style); - - // Sets the keyboard accelerators needed by the external host - void SetAccelerators(HACCEL accel_table, int accel_table_entry_count); + DWORD style, + bool load_requests_via_automation); // This is invoked when the external host reflects back to us a keyboard // message it did not process @@ -126,9 +124,6 @@ class ExternalTabContainer : public TabContentsDelegate, NotificationRegistrar registrar_; - // The accelerator table of the external host. - HACCEL external_accel_table_; - unsigned int external_accel_entry_count_; // A view to handle focus cycling TabContentsContainer* tab_contents_container_; |