| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_UI_VIEWS_DROPDOWN_BAR_HOST_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_DROPDOWN_BAR_HOST_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_DROPDOWN_BAR_HOST_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_DROPDOWN_BAR_HOST_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "content/public/browser/native_web_keyboard_event.h" | 10 #include "content/public/browser/native_web_keyboard_event.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 // Returns the rectangle representing where to position the dropdown widget. | 73 // Returns the rectangle representing where to position the dropdown widget. |
| 74 virtual gfx::Rect GetDialogPosition(gfx::Rect avoid_overlapping_rect) = 0; | 74 virtual gfx::Rect GetDialogPosition(gfx::Rect avoid_overlapping_rect) = 0; |
| 75 | 75 |
| 76 // Moves the widget to the provided location, moves it to top | 76 // Moves the widget to the provided location, moves it to top |
| 77 // in the z-order (HWND_TOP, not HWND_TOPMOST for windows) and shows | 77 // in the z-order (HWND_TOP, not HWND_TOPMOST for windows) and shows |
| 78 // the widget (if hidden). | 78 // the widget (if hidden). |
| 79 virtual void SetDialogPosition(const gfx::Rect& new_pos, bool no_redraw) = 0; | 79 virtual void SetDialogPosition(const gfx::Rect& new_pos, bool no_redraw) = 0; |
| 80 | 80 |
| 81 // Overridden from views::FocusChangeListener: | 81 // Overridden from views::FocusChangeListener: |
| 82 virtual void OnWillChangeFocus(views::View* focused_before, | 82 virtual void OnWillChangeFocus(views::View* focused_before, |
| 83 views::View* focused_now) OVERRIDE; | 83 views::View* focused_now) override; |
| 84 virtual void OnDidChangeFocus(views::View* focused_before, | 84 virtual void OnDidChangeFocus(views::View* focused_before, |
| 85 views::View* focused_now) OVERRIDE; | 85 views::View* focused_now) override; |
| 86 | 86 |
| 87 // Overridden from ui::AcceleratorTarget: | 87 // Overridden from ui::AcceleratorTarget: |
| 88 virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) = 0; | 88 virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) = 0; |
| 89 virtual bool CanHandleAccelerators() const = 0; | 89 virtual bool CanHandleAccelerators() const = 0; |
| 90 | 90 |
| 91 // gfx::AnimationDelegate implementation: | 91 // gfx::AnimationDelegate implementation: |
| 92 virtual void AnimationProgressed(const gfx::Animation* animation) OVERRIDE; | 92 virtual void AnimationProgressed(const gfx::Animation* animation) override; |
| 93 virtual void AnimationEnded(const gfx::Animation* animation) OVERRIDE; | 93 virtual void AnimationEnded(const gfx::Animation* animation) override; |
| 94 | 94 |
| 95 // During testing we can disable animations by setting this flag to true, | 95 // During testing we can disable animations by setting this flag to true, |
| 96 // so that opening and closing the dropdown bar is shown instantly, instead of | 96 // so that opening and closing the dropdown bar is shown instantly, instead of |
| 97 // having to poll it while it animates to open/closed status. | 97 // having to poll it while it animates to open/closed status. |
| 98 static bool disable_animations_during_testing_; | 98 static bool disable_animations_during_testing_; |
| 99 | 99 |
| 100 // Returns the browser view that the dropdown belongs to. | 100 // Returns the browser view that the dropdown belongs to. |
| 101 BrowserView* browser_view() const { return browser_view_; } | 101 BrowserView* browser_view() const { return browser_view_; } |
| 102 | 102 |
| 103 // Registers this class as the handler for when Escape is pressed. Once we | 103 // Registers this class as the handler for when Escape is pressed. Once we |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 scoped_ptr<views::Widget> host_; | 191 scoped_ptr<views::Widget> host_; |
| 192 | 192 |
| 193 // A flag to manually manage visibility. GTK/X11 is asynchronous and | 193 // A flag to manually manage visibility. GTK/X11 is asynchronous and |
| 194 // the state of the widget can be out of sync. | 194 // the state of the widget can be out of sync. |
| 195 bool is_visible_; | 195 bool is_visible_; |
| 196 | 196 |
| 197 DISALLOW_COPY_AND_ASSIGN(DropdownBarHost); | 197 DISALLOW_COPY_AND_ASSIGN(DropdownBarHost); |
| 198 }; | 198 }; |
| 199 | 199 |
| 200 #endif // CHROME_BROWSER_UI_VIEWS_DROPDOWN_BAR_HOST_H_ | 200 #endif // CHROME_BROWSER_UI_VIEWS_DROPDOWN_BAR_HOST_H_ |
| OLD | NEW |