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_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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "app/animation_delegate.h" | 9 #include "app/animation_delegate.h" |
10 #include "base/scoped_ptr.h" | 10 #include "base/scoped_ptr.h" |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 // curved edges. We also check to see if the region should be | 132 // curved edges. We also check to see if the region should be |
133 // truncated to prevent from drawing onto Chrome's window border. | 133 // truncated to prevent from drawing onto Chrome's window border. |
134 void UpdateWindowEdges(const gfx::Rect& new_pos); | 134 void UpdateWindowEdges(const gfx::Rect& new_pos); |
135 | 135 |
136 // Creates and returns the native Widget. | 136 // Creates and returns the native Widget. |
137 views::Widget* CreateHost(); | 137 views::Widget* CreateHost(); |
138 | 138 |
139 // Allows implementation to tweak widget position. | 139 // Allows implementation to tweak widget position. |
140 void SetWidgetPositionNative(const gfx::Rect& new_pos, bool no_redraw); | 140 void SetWidgetPositionNative(const gfx::Rect& new_pos, bool no_redraw); |
141 | 141 |
142 // Returns a keyboard event suitable for fowarding. | 142 // Returns a keyboard event suitable for forwarding. |
143 NativeWebKeyboardEvent GetKeyboardEvent( | 143 NativeWebKeyboardEvent GetKeyboardEvent( |
144 const TabContents* contents, | 144 const TabContents* contents, |
145 const views::Textfield::Keystroke& key_stroke); | 145 const views::Textfield::Keystroke& key_stroke); |
146 | 146 |
147 // Returns the animation for the dropdown. | 147 // Returns the animation for the dropdown. |
148 SlideAnimation* animation() { | 148 SlideAnimation* animation() { |
149 return animation_.get(); | 149 return animation_.get(); |
150 } | 150 } |
151 | 151 |
152 private: | 152 private: |
(...skipping 18 matching lines...) Expand all Loading... |
171 | 171 |
172 // Tracks and stores the last focused view which is not the DropdownBarView | 172 // Tracks and stores the last focused view which is not the DropdownBarView |
173 // or any of its children. Used to restore focus once the DropdownBarView is | 173 // or any of its children. Used to restore focus once the DropdownBarView is |
174 // closed. | 174 // closed. |
175 scoped_ptr<views::ExternalFocusTracker> focus_tracker_; | 175 scoped_ptr<views::ExternalFocusTracker> focus_tracker_; |
176 | 176 |
177 // Host is the Widget implementation that is created and maintained by the | 177 // Host is the Widget implementation that is created and maintained by the |
178 // dropdown bar. It contains the DropdownBarView. | 178 // dropdown bar. It contains the DropdownBarView. |
179 scoped_ptr<views::Widget> host_; | 179 scoped_ptr<views::Widget> host_; |
180 | 180 |
181 // A flag to manually manage visibility. GTK/X11 is asynchrnous and | 181 // A flag to manually manage visibility. GTK/X11 is asynchronous and |
182 // the state of the widget can be out of sync. | 182 // the state of the widget can be out of sync. |
183 bool is_visible_; | 183 bool is_visible_; |
184 | 184 |
185 DISALLOW_COPY_AND_ASSIGN(DropdownBarHost); | 185 DISALLOW_COPY_AND_ASSIGN(DropdownBarHost); |
186 }; | 186 }; |
187 | 187 |
188 #endif // CHROME_BROWSER_UI_VIEWS_DROPDOWN_BAR_HOST_H_ | 188 #endif // CHROME_BROWSER_UI_VIEWS_DROPDOWN_BAR_HOST_H_ |
OLD | NEW |