diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-12 20:38:49 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-12 20:38:49 +0000 |
commit | 3f70c1e17d42cccd53e1b827d239c86d1ed701da (patch) | |
tree | d1af746656d76471d38ae178375debdcb0a686ae /chrome/browser/external_tab_container.h | |
parent | ab8089b5a8442d10b85fd12b40b8771c86c81b8d (diff) | |
download | chromium_src-3f70c1e17d42cccd53e1b827d239c86d1ed701da.zip chromium_src-3f70c1e17d42cccd53e1b827d239c86d1ed701da.tar.gz chromium_src-3f70c1e17d42cccd53e1b827d239c86d1ed701da.tar.bz2 |
Unhandled keyboard messages coming back from the host browser running ChromeFrame need to process
accelerators. Currently accelerators are processed by the focus manager. We already have code in browser_view
to process unhandled keyboard messages coming back from the renderer. Moved this code to a new class
UnhandledKeyboardEventHandler which maintains state about whether the next character event has to be ignored, etc.
This class is now used by BrowserView and the ExternalTabContainer to process unhandled keyboard messages.
To support accelerators in ChromeFrame, the ExternalTabContainer needs to implement an Accelerator target. I also
added a minimal accelerator table for Chromeframe in the chrome_dll.rc and chrome_dll_resource.h files.
This fixes bug http://code.google.com/p/chromium/issues/detail?id=31672
Bug=31672
Review URL: http://codereview.chromium.org/536023
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36037 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/external_tab_container.h')
-rw-r--r-- | chrome/browser/external_tab_container.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/chrome/browser/external_tab_container.h b/chrome/browser/external_tab_container.h index 7388177..698d15b 100644 --- a/chrome/browser/external_tab_container.h +++ b/chrome/browser/external_tab_container.h @@ -13,9 +13,11 @@ #include "chrome/browser/browser.h" #include "chrome/browser/net/chrome_url_request_context.h" #include "chrome/browser/tab_contents/tab_contents_delegate.h" +#include "chrome/browser/views/unhandled_keyboard_event_handler.h" #include "chrome/common/navigation_types.h" #include "chrome/common/notification_observer.h" #include "chrome/common/notification_registrar.h" +#include "views/accelerator.h" #include "views/widget/widget_win.h" class AutomationProvider; @@ -34,7 +36,8 @@ struct NavigationInfo; class ExternalTabContainer : public TabContentsDelegate, public NotificationObserver, public views::WidgetWin, - public base::RefCounted<ExternalTabContainer> { + public base::RefCounted<ExternalTabContainer>, + public views::AcceleratorTarget { public: typedef std::map<intptr_t, scoped_refptr<ExternalTabContainer> > PendingTabs; @@ -169,6 +172,9 @@ class ExternalTabContainer : public TabContentsDelegate, // Overridden from views::WidgetWin: virtual views::Window* GetWindow(); + // Handles the specified |accelerator| being pressed. + bool AcceleratorPressed(const views::Accelerator& accelerator); + protected: // Overridden from views::WidgetWin: virtual LRESULT OnCreate(LPCREATESTRUCT create_struct); @@ -193,6 +199,8 @@ class ExternalTabContainer : public TabContentsDelegate, bool ProcessUnhandledKeyStroke(HWND window, UINT message, WPARAM wparam, LPARAM lparam); + void LoadAccelerators(); + TabContents* tab_contents_; scoped_refptr<AutomationProvider> automation_; @@ -239,6 +247,11 @@ class ExternalTabContainer : public TabContentsDelegate, // The URL request context to be used for this tab. Can be NULL. scoped_refptr<ChromeURLRequestContextGetter> request_context_; + UnhandledKeyboardEventHandler unhandled_keyboard_event_handler_; + + // A mapping between accelerators and commands. + std::map<views::Accelerator, int> accelerator_table_; + DISALLOW_COPY_AND_ASSIGN(ExternalTabContainer); }; |