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_INFOBARS_INFOBAR_GTK_H_ | 5 #ifndef CHROME_BROWSER_UI_GTK_INFOBARS_INFOBAR_GTK_H_ |
6 #define CHROME_BROWSER_UI_GTK_INFOBARS_INFOBAR_GTK_H_ | 6 #define CHROME_BROWSER_UI_GTK_INFOBARS_INFOBAR_GTK_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <gtk/gtk.h> | 9 #include <gtk/gtk.h> |
10 | 10 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 ui::GtkSignalRegistrar* Signals(); | 64 ui::GtkSignalRegistrar* Signals(); |
65 | 65 |
66 // Creates a label with the appropriate font and color for the current | 66 // Creates a label with the appropriate font and color for the current |
67 // gtk-theme state. It is InfoBarGtk's responsibility to observe browser | 67 // gtk-theme state. It is InfoBarGtk's responsibility to observe browser |
68 // theme changes and update the label's state. | 68 // theme changes and update the label's state. |
69 GtkWidget* CreateLabel(const std::string& text); | 69 GtkWidget* CreateLabel(const std::string& text); |
70 | 70 |
71 // Creates a link button with the appropriate current gtk-theme state. | 71 // Creates a link button with the appropriate current gtk-theme state. |
72 GtkWidget* CreateLinkButton(const std::string& text); | 72 GtkWidget* CreateLinkButton(const std::string& text); |
73 | 73 |
| 74 // Builds a button with an arrow in it to emulate the menu-button style from |
| 75 // the windows version. |
| 76 static GtkWidget* CreateMenuButton(const std::string& text); |
| 77 |
74 // Adds |display_text| to the infobar. If |link_text| is not empty, it is | 78 // Adds |display_text| to the infobar. If |link_text| is not empty, it is |
75 // rendered as a hyperlink and inserted into |display_text| at |link_offset|, | 79 // rendered as a hyperlink and inserted into |display_text| at |link_offset|, |
76 // or right aligned in the infobar if |link_offset| is |npos|. If a link is | 80 // or right aligned in the infobar if |link_offset| is |npos|. If a link is |
77 // supplied, |link_callback| must not be null. It will be invoked on click. | 81 // supplied, |link_callback| must not be null. It will be invoked on click. |
78 void AddLabelWithInlineLink(const string16& display_text, | 82 void AddLabelWithInlineLink(const string16& display_text, |
79 const string16& link_text, | 83 const string16& link_text, |
80 size_t link_offset, | 84 size_t link_offset, |
81 GCallback callback); | 85 GCallback callback); |
82 | 86 |
83 // Shows the menu with |model| with the context of |sender|. InfobarGtk takes | 87 // Shows the menu with |model| with the context of |sender|. InfobarGtk takes |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 | 133 |
130 // The current menu displayed. Can be null. We own this on the base class so | 134 // The current menu displayed. Can be null. We own this on the base class so |
131 // we can cancel the menu while we're closing. | 135 // we can cancel the menu while we're closing. |
132 scoped_ptr<ui::MenuModel> menu_model_; | 136 scoped_ptr<ui::MenuModel> menu_model_; |
133 scoped_ptr<MenuGtk> menu_; | 137 scoped_ptr<MenuGtk> menu_; |
134 | 138 |
135 DISALLOW_COPY_AND_ASSIGN(InfoBarGtk); | 139 DISALLOW_COPY_AND_ASSIGN(InfoBarGtk); |
136 }; | 140 }; |
137 | 141 |
138 #endif // CHROME_BROWSER_UI_GTK_INFOBARS_INFOBAR_GTK_H_ | 142 #endif // CHROME_BROWSER_UI_GTK_INFOBARS_INFOBAR_GTK_H_ |
OLD | NEW |