OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_GTK_LOCATION_BAR_VIEW_GTK_H_ | 5 #ifndef CHROME_BROWSER_GTK_LOCATION_BAR_VIEW_GTK_H_ |
6 #define CHROME_BROWSER_GTK_LOCATION_BAR_VIEW_GTK_H_ | 6 #define CHROME_BROWSER_GTK_LOCATION_BAR_VIEW_GTK_H_ |
7 | 7 |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
14 #include "base/scoped_ptr.h" | 14 #include "base/scoped_ptr.h" |
15 #include "base/scoped_vector.h" | 15 #include "base/scoped_vector.h" |
16 #include "chrome/browser/autocomplete/autocomplete_edit.h" | 16 #include "chrome/browser/autocomplete/autocomplete_edit.h" |
17 #include "chrome/browser/autocomplete/autocomplete_edit_view_gtk.h" | 17 #include "chrome/browser/autocomplete/autocomplete_edit_view_gtk.h" |
18 #include "chrome/browser/image_loading_tracker.h" | 18 #include "chrome/browser/image_loading_tracker.h" |
19 #include "chrome/browser/location_bar.h" | 19 #include "chrome/browser/location_bar.h" |
20 #include "chrome/common/notification_observer.h" | 20 #include "chrome/common/notification_observer.h" |
21 #include "chrome/common/notification_registrar.h" | 21 #include "chrome/common/notification_registrar.h" |
22 #include "chrome/common/owned_widget_gtk.h" | 22 #include "chrome/common/owned_widget_gtk.h" |
23 #include "chrome/common/page_transition_types.h" | 23 #include "chrome/common/page_transition_types.h" |
24 #include "webkit/glue/window_open_disposition.h" | 24 #include "webkit/glue/window_open_disposition.h" |
25 | 25 |
26 class AutocompleteEditViewGtk; | 26 class AutocompleteEditViewGtk; |
27 class AutocompletePopupPositioner; | 27 class BubblePositioner; |
28 class Browser; | 28 class Browser; |
29 class CommandUpdater; | 29 class CommandUpdater; |
30 class GtkThemeProvider; | 30 class GtkThemeProvider; |
31 class PageAction; | 31 class PageAction; |
32 class Profile; | 32 class Profile; |
33 class SkBitmap; | 33 class SkBitmap; |
34 class TabContents; | 34 class TabContents; |
35 class ToolbarModel; | 35 class ToolbarModel; |
36 | 36 |
37 class LocationBarViewGtk : public AutocompleteEditController, | 37 class LocationBarViewGtk : public AutocompleteEditController, |
38 public LocationBar, | 38 public LocationBar, |
39 public LocationBarTesting, | 39 public LocationBarTesting, |
40 public NotificationObserver { | 40 public NotificationObserver { |
41 public: | 41 public: |
42 LocationBarViewGtk(CommandUpdater* command_updater, | 42 LocationBarViewGtk(CommandUpdater* command_updater, |
43 ToolbarModel* toolbar_model, | 43 ToolbarModel* toolbar_model, |
44 AutocompletePopupPositioner* popup_positioner, | 44 const BubblePositioner* bubble_positioner, |
45 Browser* browser_); | 45 Browser* browser_); |
46 virtual ~LocationBarViewGtk(); | 46 virtual ~LocationBarViewGtk(); |
47 | 47 |
48 void Init(bool popup_window_mode); | 48 void Init(bool popup_window_mode); |
49 | 49 |
50 void SetProfile(Profile* profile); | 50 void SetProfile(Profile* profile); |
51 | 51 |
52 // Returns the widget the caller should host. You must call Init() first. | 52 // Returns the widget the caller should host. You must call Init() first. |
53 GtkWidget* widget() { return hbox_.get(); } | 53 GtkWidget* widget() { return hbox_.get(); } |
54 | 54 |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 GtkWidget* tab_to_search_hint_trailing_label_; | 203 GtkWidget* tab_to_search_hint_trailing_label_; |
204 | 204 |
205 scoped_ptr<AutocompleteEditViewGtk> location_entry_; | 205 scoped_ptr<AutocompleteEditViewGtk> location_entry_; |
206 | 206 |
207 Profile* profile_; | 207 Profile* profile_; |
208 CommandUpdater* command_updater_; | 208 CommandUpdater* command_updater_; |
209 ToolbarModel* toolbar_model_; | 209 ToolbarModel* toolbar_model_; |
210 Browser* browser_; | 210 Browser* browser_; |
211 | 211 |
212 // We need to hold on to this just to it pass to the edit. | 212 // We need to hold on to this just to it pass to the edit. |
213 AutocompletePopupPositioner* popup_positioner_; | 213 const BubblePositioner* bubble_positioner_; |
214 | 214 |
215 // When we get an OnAutocompleteAccept notification from the autocomplete | 215 // When we get an OnAutocompleteAccept notification from the autocomplete |
216 // edit, we save the input string so we can give it back to the browser on | 216 // edit, we save the input string so we can give it back to the browser on |
217 // the LocationBar interface via GetInputString(). | 217 // the LocationBar interface via GetInputString(). |
218 std::wstring location_input_; | 218 std::wstring location_input_; |
219 | 219 |
220 // The user's desired disposition for how their input should be opened. | 220 // The user's desired disposition for how their input should be opened. |
221 WindowOpenDisposition disposition_; | 221 WindowOpenDisposition disposition_; |
222 | 222 |
223 // The transition type to use for the navigation. | 223 // The transition type to use for the navigation. |
224 PageTransition::Type transition_; | 224 PageTransition::Type transition_; |
225 | 225 |
226 // Used schedule a task for the first run info bubble. | 226 // Used schedule a task for the first run info bubble. |
227 ScopedRunnableMethodFactory<LocationBarViewGtk> first_run_bubble_; | 227 ScopedRunnableMethodFactory<LocationBarViewGtk> first_run_bubble_; |
228 | 228 |
229 // When true, the location bar view is read only and also is has a slightly | 229 // When true, the location bar view is read only and also is has a slightly |
230 // different presentation (font size / color). This is used for popups. | 230 // different presentation (font size / color). This is used for popups. |
231 bool popup_window_mode_; | 231 bool popup_window_mode_; |
232 | 232 |
233 // Provides colors and rendering mode. | 233 // Provides colors and rendering mode. |
234 GtkThemeProvider* theme_provider_; | 234 GtkThemeProvider* theme_provider_; |
235 | 235 |
236 NotificationRegistrar registrar_; | 236 NotificationRegistrar registrar_; |
237 | 237 |
238 DISALLOW_COPY_AND_ASSIGN(LocationBarViewGtk); | 238 DISALLOW_COPY_AND_ASSIGN(LocationBarViewGtk); |
239 }; | 239 }; |
240 | 240 |
241 #endif // CHROME_BROWSER_GTK_LOCATION_BAR_VIEW_GTK_H_ | 241 #endif // CHROME_BROWSER_GTK_LOCATION_BAR_VIEW_GTK_H_ |
OLD | NEW |