OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_GTK_FIND_BAR_GTK_H_ | 5 #ifndef CHROME_BROWSER_UI_GTK_FIND_BAR_GTK_H_ |
6 #define CHROME_BROWSER_UI_GTK_FIND_BAR_GTK_H_ | 6 #define CHROME_BROWSER_UI_GTK_FIND_BAR_GTK_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <gtk/gtk.h> | 9 #include <gtk/gtk.h> |
10 | 10 |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 | 97 |
98 // Returns the rectangle representing where to position the find bar. If | 98 // Returns the rectangle representing where to position the find bar. If |
99 // |avoid_overlapping_rect| is specified, the return value will be a rectangle | 99 // |avoid_overlapping_rect| is specified, the return value will be a rectangle |
100 // located immediately to the left of |avoid_overlapping_rect|, as long as | 100 // located immediately to the left of |avoid_overlapping_rect|, as long as |
101 // there is enough room for the dialog to draw within the bounds. If not, the | 101 // there is enough room for the dialog to draw within the bounds. If not, the |
102 // dialog position returned will overlap |avoid_overlapping_rect|. | 102 // dialog position returned will overlap |avoid_overlapping_rect|. |
103 // Note: |avoid_overlapping_rect| is expected to use coordinates relative to | 103 // Note: |avoid_overlapping_rect| is expected to use coordinates relative to |
104 // the top of the page area, (it will be converted to coordinates relative to | 104 // the top of the page area, (it will be converted to coordinates relative to |
105 // the top of the browser window, when comparing against the dialog | 105 // the top of the browser window, when comparing against the dialog |
106 // coordinates). The returned value is relative to the browser window. | 106 // coordinates). The returned value is relative to the browser window. |
107 gfx::Rect GetDialogPosition(gfx::Rect avoid_overlapping_rect); | 107 gfx::Rect GetDialogPosition(const gfx::Rect& avoid_overlapping_rect); |
108 | 108 |
109 // Adjust the text alignment according to the text direction of the widget | 109 // Adjust the text alignment according to the text direction of the widget |
110 // and |text_entry_|'s content, to make sure the real text alignment is | 110 // and |text_entry_|'s content, to make sure the real text alignment is |
111 // always in sync with the UI language direction. | 111 // always in sync with the UI language direction. |
112 void AdjustTextAlignment(); | 112 void AdjustTextAlignment(); |
113 | 113 |
114 // Get the position of the findbar within the floating container. | 114 // Get the position of the findbar within the floating container. |
115 gfx::Point GetPosition(); | 115 gfx::Point GetPosition(); |
116 | 116 |
117 static void OnParentSet(GtkWidget* widget, GtkObject* old_parent, | 117 static void OnParentSet(GtkWidget* widget, GtkObject* old_parent, |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 // The selection rect we are currently showing. We cache it to avoid covering | 231 // The selection rect we are currently showing. We cache it to avoid covering |
232 // it up. | 232 // it up. |
233 gfx::Rect selection_rect_; | 233 gfx::Rect selection_rect_; |
234 | 234 |
235 content::NotificationRegistrar registrar_; | 235 content::NotificationRegistrar registrar_; |
236 | 236 |
237 DISALLOW_COPY_AND_ASSIGN(FindBarGtk); | 237 DISALLOW_COPY_AND_ASSIGN(FindBarGtk); |
238 }; | 238 }; |
239 | 239 |
240 #endif // CHROME_BROWSER_UI_GTK_FIND_BAR_GTK_H_ | 240 #endif // CHROME_BROWSER_UI_GTK_FIND_BAR_GTK_H_ |
OLD | NEW |