diff options
author | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-13 18:11:35 +0000 |
---|---|---|
committer | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-13 18:11:35 +0000 |
commit | 7c412c528670943fc1c54a95878b54336cddda10 (patch) | |
tree | 27abc510cc2ca8f654c902dd982463d28db4e8a3 | |
parent | fe27083936007c146b15d6297f65eef658458797 (diff) | |
download | chromium_src-7c412c528670943fc1c54a95878b54336cddda10.zip chromium_src-7c412c528670943fc1c54a95878b54336cddda10.tar.gz chromium_src-7c412c528670943fc1c54a95878b54336cddda10.tar.bz2 |
WidgetWin was an accelerator target, it does not need to.
BUG=None
TEST=make sure Esc still works in the bookmark bubble and that accelerators work as expected.
Review URL: http://codereview.chromium.org/271067
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28842 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/views/frame/browser_frame_win.cc | 5 | ||||
-rw-r--r-- | chrome/browser/views/frame/browser_frame_win.h | 1 | ||||
-rw-r--r-- | chrome/browser/views/info_bubble.cc | 2 | ||||
-rw-r--r-- | chrome/browser/views/info_bubble.h | 8 | ||||
-rw-r--r-- | views/widget/widget_win.cc | 13 | ||||
-rw-r--r-- | views/widget/widget_win.h | 9 |
6 files changed, 11 insertions, 27 deletions
diff --git a/chrome/browser/views/frame/browser_frame_win.cc b/chrome/browser/views/frame/browser_frame_win.cc index 4c7cd02..4315346 100644 --- a/chrome/browser/views/frame/browser_frame_win.cc +++ b/chrome/browser/views/frame/browser_frame_win.cc @@ -121,11 +121,6 @@ bool BrowserFrameWin::AlwaysUseNativeFrame() const { /////////////////////////////////////////////////////////////////////////////// // BrowserFrame, views::WidgetWin overrides: -bool BrowserFrameWin::AcceleratorPressed( - const views::Accelerator& accelerator) { - return browser_view_->AcceleratorPressed(accelerator); -} - bool BrowserFrameWin::GetAccelerator(int cmd_id, views::Accelerator* accelerator) { return browser_view_->GetAccelerator(cmd_id, accelerator); diff --git a/chrome/browser/views/frame/browser_frame_win.h b/chrome/browser/views/frame/browser_frame_win.h index 7bde95f..dc23eb7 100644 --- a/chrome/browser/views/frame/browser_frame_win.h +++ b/chrome/browser/views/frame/browser_frame_win.h @@ -48,7 +48,6 @@ class BrowserFrameWin : public BrowserFrame, public views::WindowWin { protected: // Overridden from views::WidgetWin: - virtual bool AcceleratorPressed(const views::Accelerator& accelerator); virtual bool GetAccelerator(int cmd_id, views::Accelerator* accelerator); virtual void OnEndSession(BOOL ending, UINT logoff); virtual void OnEnterSizeMove(); diff --git a/chrome/browser/views/info_bubble.cc b/chrome/browser/views/info_bubble.cc index bba77a9f3..1218f46 100644 --- a/chrome/browser/views/info_bubble.cc +++ b/chrome/browser/views/info_bubble.cc @@ -277,11 +277,9 @@ void InfoBubble::Init(views::Window* parent, #endif SetBounds(window_bounds); -#if defined(OS_WIN) // Register the Escape accelerator for closing. GetFocusManager()->RegisterAccelerator( views::Accelerator(base::VKEY_ESCAPE, false, false, false), this); -#endif // Done creating the bubble. NotificationService::current()->Notify(NotificationType::INFO_BUBBLE_CREATED, diff --git a/chrome/browser/views/info_bubble.h b/chrome/browser/views/info_bubble.h index 5ee23f5..996413a 100644 --- a/chrome/browser/views/info_bubble.h +++ b/chrome/browser/views/info_bubble.h @@ -79,11 +79,13 @@ class InfoBubbleDelegate { // TODO: this code is ifdef-tastic. It might be cleaner to refactor the // WidgetFoo subclass into a separate class that calls into InfoBubble. // That way InfoBubble has no (or very few) ifdefs. +class InfoBubble #if defined(OS_WIN) -class InfoBubble : public views::WidgetWin { + : public views::WidgetWin, #elif defined(OS_LINUX) -class InfoBubble : public views::WidgetGtk { + : public views::WidgetGtk, #endif + public views::AcceleratorTarget { public: // Shows the InfoBubble. |parent| is set as the parent window, |contents| are // the contents shown in the bubble, and |position_relative_to| is a rect in @@ -126,7 +128,7 @@ class InfoBubble : public views::WidgetGtk { // the close is the result of pressing escape. void Close(bool closed_by_escape); - // Overridden from WidgetWin/WidgetGtk: + // Overridden from AcceleratorTarget: virtual bool AcceleratorPressed(const views::Accelerator& accelerator); // The delegate, if any. diff --git a/views/widget/widget_win.cc b/views/widget/widget_win.cc index 16f4860..a4f2181 100644 --- a/views/widget/widget_win.cc +++ b/views/widget/widget_win.cc @@ -328,6 +328,10 @@ void WidgetWin::ViewHierarchyChanged(bool is_add, View *parent, drop_target_->ResetTargetViewIfEquals(child); } +bool WidgetWin::GetAccelerator(int cmd_id, Accelerator* accelerator) { + return false; +} + void WidgetWin::SetUseLayeredBuffer(bool use_layered_buffer) { if (use_layered_buffer_ == use_layered_buffer) return; @@ -423,15 +427,6 @@ void WidgetWin::SetFocusTraversableParentView(View* parent_view) { root_view_->SetFocusTraversableParentView(parent_view); } -bool WidgetWin::AcceleratorPressed(const Accelerator& accelerator) { - return false; -} - -bool WidgetWin::GetAccelerator(int cmd_id, Accelerator* accelerator) { - return false; -} - - /////////////////////////////////////////////////////////////////////////////// // Message handlers diff --git a/views/widget/widget_win.h b/views/widget/widget_win.h index 147072e..40b3387 100644 --- a/views/widget/widget_win.h +++ b/views/widget/widget_win.h @@ -69,8 +69,7 @@ const int WM_NCUAHDRAWFRAME = 0xAF; class WidgetWin : public app::WindowImpl, public Widget, public MessageLoopForUI::Observer, - public FocusTraversable, - public AcceleratorTarget { + public FocusTraversable { public: WidgetWin(); virtual ~WidgetWin(); @@ -205,6 +204,7 @@ class WidgetWin : public app::WindowImpl, virtual FocusManager* GetFocusManager(); virtual void ViewHierarchyChanged(bool is_add, View *parent, View *child); + virtual bool GetAccelerator(int cmd_id, Accelerator* accelerator); // Overridden from MessageLoop::Observer: void WillProcessMessage(const MSG& msg); @@ -223,11 +223,6 @@ class WidgetWin : public app::WindowImpl, void SetFocusTraversableParent(FocusTraversable* parent); void SetFocusTraversableParentView(View* parent_view); - // Overridden from AcceleratorTarget: - virtual bool AcceleratorPressed(const Accelerator& accelerator); - - virtual bool GetAccelerator(int cmd_id, Accelerator* accelerator); - BOOL IsWindow() const { return ::IsWindow(GetNativeView()); } |