OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_VIEWS_DROPDOWN_BAR_HOST_H_ | 5 #ifndef CHROME_BROWSER_VIEWS_DROPDOWN_BAR_HOST_H_ |
6 #define CHROME_BROWSER_VIEWS_DROPDOWN_BAR_HOST_H_ | 6 #define CHROME_BROWSER_VIEWS_DROPDOWN_BAR_HOST_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "app/animation.h" | 9 #include "app/animation.h" |
10 #include "base/scoped_ptr.h" | 10 #include "base/scoped_ptr.h" |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 virtual void FocusWillChange(views::View* focused_before, | 71 virtual void FocusWillChange(views::View* focused_before, |
72 views::View* focused_now); | 72 views::View* focused_now); |
73 | 73 |
74 // Overridden from views::AcceleratorTarget: | 74 // Overridden from views::AcceleratorTarget: |
75 virtual bool AcceleratorPressed(const views::Accelerator& accelerator) = 0; | 75 virtual bool AcceleratorPressed(const views::Accelerator& accelerator) = 0; |
76 | 76 |
77 // AnimationDelegate implementation: | 77 // AnimationDelegate implementation: |
78 virtual void AnimationProgressed(const Animation* animation); | 78 virtual void AnimationProgressed(const Animation* animation); |
79 virtual void AnimationEnded(const Animation* animation); | 79 virtual void AnimationEnded(const Animation* animation); |
80 | 80 |
81 // Get the offset with which to paint the theme image. | |
82 void GetThemePosition(gfx::Rect* bounds); | |
83 | |
84 // During testing we can disable animations by setting this flag to true, | 81 // During testing we can disable animations by setting this flag to true, |
85 // so that opening and closing the dropdown bar is shown instantly, instead of | 82 // so that opening and closing the dropdown bar is shown instantly, instead of |
86 // having to poll it while it animates to open/closed status. | 83 // having to poll it while it animates to open/closed status. |
87 static bool disable_animations_during_testing_; | 84 static bool disable_animations_during_testing_; |
88 | 85 |
89 // Returns the browser view that the dropdown belongs to. | 86 // Returns the browser view that the dropdown belongs to. |
90 BrowserView* browser_view() const { return browser_view_; } | 87 BrowserView* browser_view() const { return browser_view_; } |
91 | 88 |
92 // Registers this class as the handler for when Escape is pressed. Once we | 89 // Registers this class as the handler for when Escape is pressed. Once we |
93 // loose focus we will unregister Escape and (any accelerators the derived | 90 // loose focus we will unregister Escape and (any accelerators the derived |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 scoped_ptr<views::Widget> host_; | 179 scoped_ptr<views::Widget> host_; |
183 | 180 |
184 // A flag to manually manage visibility. GTK/X11 is asynchrnous and | 181 // A flag to manually manage visibility. GTK/X11 is asynchrnous and |
185 // the state of the widget can be out of sync. | 182 // the state of the widget can be out of sync. |
186 bool is_visible_; | 183 bool is_visible_; |
187 | 184 |
188 DISALLOW_COPY_AND_ASSIGN(DropdownBarHost); | 185 DISALLOW_COPY_AND_ASSIGN(DropdownBarHost); |
189 }; | 186 }; |
190 | 187 |
191 #endif // CHROME_BROWSER_VIEWS_DROPDOWN_BAR_HOST_H_ | 188 #endif // CHROME_BROWSER_VIEWS_DROPDOWN_BAR_HOST_H_ |
OLD | NEW |