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> |
(...skipping 15 matching lines...) Expand all Loading... | |
26 public LocationBar { | 26 public LocationBar { |
27 public: | 27 public: |
28 LocationBarViewGtk(CommandUpdater* command_updater, | 28 LocationBarViewGtk(CommandUpdater* command_updater, |
29 ToolbarModel* toolbar_model); | 29 ToolbarModel* toolbar_model); |
30 ~LocationBarViewGtk(); | 30 ~LocationBarViewGtk(); |
31 | 31 |
32 void Init(); | 32 void Init(); |
33 | 33 |
34 void SetProfile(Profile* profile); | 34 void SetProfile(Profile* profile); |
35 | 35 |
36 // Return the native vbox widget. You must call Init() first, or the result | 36 // Returns the widget the caller should host. You must call Init() first. |
37 // will be NULL. This is the widget that an embedder should host. | 37 GtkWidget* widget() { return outer_bin_; } |
38 GtkWidget* widget() { return vbox_; } | |
39 | 38 |
40 // Updates the location bar. We also reset the bar's permanent text and | 39 // Updates the location bar. We also reset the bar's permanent text and |
41 // security style, and, if |tab_for_state_restoring| is non-NULL, also | 40 // security style, and, if |tab_for_state_restoring| is non-NULL, also |
42 // restore saved state that the tab holds. | 41 // restore saved state that the tab holds. |
43 void Update(const TabContents* tab_for_state_restoring); | 42 void Update(const TabContents* tab_for_state_restoring); |
44 | 43 |
45 // Implement the AutocompleteEditController interface. | 44 // Implement the AutocompleteEditController interface. |
46 virtual void OnAutocompleteAccept(const GURL& url, | 45 virtual void OnAutocompleteAccept(const GURL& url, |
47 WindowOpenDisposition disposition, | 46 WindowOpenDisposition disposition, |
48 PageTransition::Type transition, | 47 PageTransition::Type transition, |
49 const GURL& alternate_nav_url); | 48 const GURL& alternate_nav_url); |
50 virtual void OnChanged(); | 49 virtual void OnChanged(); |
51 virtual void OnInputInProgress(bool in_progress); | 50 virtual void OnInputInProgress(bool in_progress); |
52 virtual SkBitmap GetFavIcon() const; | 51 virtual SkBitmap GetFavIcon() const; |
53 virtual std::wstring GetTitle() const; | 52 virtual std::wstring GetTitle() const; |
54 | 53 |
55 // Implement the LocationBar interface. | 54 // Implement the LocationBar interface. |
56 virtual void ShowFirstRunBubble(); | 55 virtual void ShowFirstRunBubble(); |
57 virtual std::wstring GetInputString() const; | 56 virtual std::wstring GetInputString() const; |
58 virtual WindowOpenDisposition GetWindowOpenDisposition() const; | 57 virtual WindowOpenDisposition GetWindowOpenDisposition() const; |
59 virtual PageTransition::Type GetPageTransition() const; | 58 virtual PageTransition::Type GetPageTransition() const; |
60 virtual void AcceptInput(); | 59 virtual void AcceptInput(); |
61 virtual void FocusLocation(); | 60 virtual void FocusLocation(); |
62 virtual void FocusSearch(); | 61 virtual void FocusSearch(); |
63 virtual void SaveStateToContents(TabContents* contents); | 62 virtual void SaveStateToContents(TabContents* contents); |
64 | 63 |
65 private: | 64 private: |
66 GtkWidget* vbox_; | 65 // The outermost widget we want to be hosted. |
66 GtkWidget* outer_bin_; | |
67 | |
68 // This is the widget you probably care about, our inner vbox (inside the | |
Evan Martin
2009/03/13 16:33:29
Who is "you" in this case? The first half of this
| |
69 // the border) which holds the elements inside the location bar. | |
70 GtkWidget* inner_vbox_; | |
67 | 71 |
68 scoped_ptr<AutocompleteEditViewGtk> location_entry_; | 72 scoped_ptr<AutocompleteEditViewGtk> location_entry_; |
69 | 73 |
70 Profile* profile_; | 74 Profile* profile_; |
71 CommandUpdater* command_updater_; | 75 CommandUpdater* command_updater_; |
72 ToolbarModel* toolbar_model_; | 76 ToolbarModel* toolbar_model_; |
73 | 77 |
74 // When we get an OnAutocompleteAccept notification from the autocomplete | 78 // When we get an OnAutocompleteAccept notification from the autocomplete |
75 // edit, we save the input string so we can give it back to the browser on | 79 // edit, we save the input string so we can give it back to the browser on |
76 // the LocationBar interface via GetInputString(). | 80 // the LocationBar interface via GetInputString(). |
77 std::wstring location_input_; | 81 std::wstring location_input_; |
78 | 82 |
79 // The user's desired disposition for how their input should be opened | 83 // The user's desired disposition for how their input should be opened |
80 WindowOpenDisposition disposition_; | 84 WindowOpenDisposition disposition_; |
81 | 85 |
82 // The transition type to use for the navigation | 86 // The transition type to use for the navigation |
83 PageTransition::Type transition_; | 87 PageTransition::Type transition_; |
84 | 88 |
85 DISALLOW_COPY_AND_ASSIGN(LocationBarViewGtk); | 89 DISALLOW_COPY_AND_ASSIGN(LocationBarViewGtk); |
86 }; | 90 }; |
87 | 91 |
88 #endif // CHROME_BROWSER_GTK_LOCATION_BAR_VIEW_GTK_H_ | 92 #endif // CHROME_BROWSER_GTK_LOCATION_BAR_VIEW_GTK_H_ |
OLD | NEW |