Chromium Code Reviews| 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 // Creates a menu button with the appropriate current gtk-theme state. | |
|
Evan Stade
2012/03/05 22:13:51
this comment is inaccurate. Just use the comment f
| |
| 75 static GtkWidget* CreateMenuButton(const std::string& text); | |
| 76 | |
| 74 // Adds |display_text| to the infobar. If |link_text| is not empty, it is | 77 // 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|, | 78 // 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 | 79 // 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. | 80 // supplied, |link_callback| must not be null. It will be invoked on click. |
| 78 void AddLabelWithInlineLink(const string16& display_text, | 81 void AddLabelWithInlineLink(const string16& display_text, |
| 79 const string16& link_text, | 82 const string16& link_text, |
| 80 size_t link_offset, | 83 size_t link_offset, |
| 81 GCallback callback); | 84 GCallback callback); |
| 82 | 85 |
| 83 // Shows the menu with |model| with the context of |sender|. InfobarGtk takes | 86 // 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 | 132 |
| 130 // The current menu displayed. Can be null. We own this on the base class so | 133 // 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. | 134 // we can cancel the menu while we're closing. |
| 132 scoped_ptr<ui::MenuModel> menu_model_; | 135 scoped_ptr<ui::MenuModel> menu_model_; |
| 133 scoped_ptr<MenuGtk> menu_; | 136 scoped_ptr<MenuGtk> menu_; |
| 134 | 137 |
| 135 DISALLOW_COPY_AND_ASSIGN(InfoBarGtk); | 138 DISALLOW_COPY_AND_ASSIGN(InfoBarGtk); |
| 136 }; | 139 }; |
| 137 | 140 |
| 138 #endif // CHROME_BROWSER_UI_GTK_INFOBARS_INFOBAR_GTK_H_ | 141 #endif // CHROME_BROWSER_UI_GTK_INFOBARS_INFOBAR_GTK_H_ |
| OLD | NEW |