| 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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 // Returns the animation offset. | 135 // Returns the animation offset. |
| 136 int animation_offset() const { return animation_offset_; } | 136 int animation_offset() const { return animation_offset_; } |
| 137 | 137 |
| 138 // Retrieves the boundary that the dropdown widget has to work with | 138 // Retrieves the boundary that the dropdown widget has to work with |
| 139 // within the Chrome frame window. The boundary differs depending on | 139 // within the Chrome frame window. The boundary differs depending on |
| 140 // the dropdown bar implementation. The default implementation | 140 // the dropdown bar implementation. The default implementation |
| 141 // returns the boundary of browser_view and the drop down | 141 // returns the boundary of browser_view and the drop down |
| 142 // can be shown in any client area. | 142 // can be shown in any client area. |
| 143 virtual void GetWidgetBounds(gfx::Rect* bounds); | 143 virtual void GetWidgetBounds(gfx::Rect* bounds); |
| 144 | 144 |
| 145 // The find bar widget needs rounded edges, so we create a polygon | |
| 146 // that corresponds to the background images for this window (and | |
| 147 // make the polygon only contain the pixels that we want to | |
| 148 // draw). The polygon is then given to SetWindowRgn which changes | |
| 149 // the window from being a rectangle in shape, to being a rect with | |
| 150 // curved edges. We also check to see if the region should be | |
| 151 // truncated to prevent from drawing onto Chrome's window border. | |
| 152 void UpdateWindowEdges(const gfx::Rect& new_pos); | |
| 153 | |
| 154 // Allows implementation to tweak widget position. | 145 // Allows implementation to tweak widget position. |
| 155 void SetWidgetPositionNative(const gfx::Rect& new_pos, bool no_redraw); | 146 void SetWidgetPositionNative(const gfx::Rect& new_pos, bool no_redraw); |
| 156 | 147 |
| 157 // Returns a keyboard event suitable for forwarding. | 148 // Returns a keyboard event suitable for forwarding. |
| 158 content::NativeWebKeyboardEvent GetKeyboardEvent( | 149 content::NativeWebKeyboardEvent GetKeyboardEvent( |
| 159 const content::WebContents* contents, | 150 const content::WebContents* contents, |
| 160 const ui::KeyEvent& key_event); | 151 const ui::KeyEvent& key_event); |
| 161 | 152 |
| 162 // Returns the animation for the dropdown. | 153 // Returns the animation for the dropdown. |
| 163 gfx::SlideAnimation* animation() { | 154 gfx::SlideAnimation* animation() { |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 scoped_ptr<views::Widget> host_; | 191 scoped_ptr<views::Widget> host_; |
| 201 | 192 |
| 202 // A flag to manually manage visibility. GTK/X11 is asynchronous and | 193 // A flag to manually manage visibility. GTK/X11 is asynchronous and |
| 203 // the state of the widget can be out of sync. | 194 // the state of the widget can be out of sync. |
| 204 bool is_visible_; | 195 bool is_visible_; |
| 205 | 196 |
| 206 DISALLOW_COPY_AND_ASSIGN(DropdownBarHost); | 197 DISALLOW_COPY_AND_ASSIGN(DropdownBarHost); |
| 207 }; | 198 }; |
| 208 | 199 |
| 209 #endif // CHROME_BROWSER_UI_VIEWS_DROPDOWN_BAR_HOST_H_ | 200 #endif // CHROME_BROWSER_UI_VIEWS_DROPDOWN_BAR_HOST_H_ |
| OLD | NEW |