Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(194)

Side by Side Diff: chrome/browser/ui/gtk/infobars/infobar_gtk.h

Issue 7981045: Make infobars ignore button clicks when closing. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 protected: 53 protected:
54 // Spacing after message (and before buttons). 54 // Spacing after message (and before buttons).
55 static const int kEndOfLabelSpacing; 55 static const int kEndOfLabelSpacing;
56 56
57 // Creates a label with the appropriate font and color for the current 57 // Creates a label with the appropriate font and color for the current
58 // gtk-theme state. It is InfoBarGtk's responsibility to observe browser 58 // gtk-theme state. It is InfoBarGtk's responsibility to observe browser
59 // theme changes and update the label's state. 59 // theme changes and update the label's state.
60 GtkWidget* CreateLabel(const std::string& text); 60 GtkWidget* CreateLabel(const std::string& text);
61 61
62 // Creates a link button with the appropriate current gtk-theme state. 62 // Creates a link button with the appropriate current gtk-theme state.
63 // NOTE: Subclasses must ignore link clicks if we're unowned.
63 GtkWidget* CreateLinkButton(const std::string& text); 64 GtkWidget* CreateLinkButton(const std::string& text);
64 65
65 // Adds |display_text| to the infobar. If |link_text| is not empty, it is 66 // Adds |display_text| to the infobar. If |link_text| is not empty, it is
66 // rendered as a hyperlink and inserted into |display_text| at |link_offset|, 67 // rendered as a hyperlink and inserted into |display_text| at |link_offset|,
67 // or right aligned in the infobar if |link_offset| is |npos|. If a link is 68 // or right aligned in the infobar if |link_offset| is |npos|. If a link is
68 // supplied, |link_callback| must not be null. It will be invoked on click. 69 // supplied, |link_callback| must not be null. It will be invoked on click.
70 // NOTE: Subclasses must ignore link clicks if we're unowned.
69 void AddLabelWithInlineLink(const string16& display_text, 71 void AddLabelWithInlineLink(const string16& display_text,
70 const string16& link_text, 72 const string16& link_text,
71 size_t link_offset, 73 size_t link_offset,
72 GCallback callback); 74 GCallback callback);
73 75
74 // InfoBar: 76 // InfoBar:
75 virtual void PlatformSpecificShow(bool animate) OVERRIDE; 77 virtual void PlatformSpecificShow(bool animate) OVERRIDE;
76 virtual void PlatformSpecificOnHeightsRecalculated() OVERRIDE; 78 virtual void PlatformSpecificOnHeightsRecalculated() OVERRIDE;
77 79
78 // NotificationObserver: 80 // NotificationObserver:
(...skipping 26 matching lines...) Expand all
105 void UpdateBorderColor(); 107 void UpdateBorderColor();
106 108
107 // A GtkExpandedContainer that contains |bg_box_| so we can varry the height 109 // A GtkExpandedContainer that contains |bg_box_| so we can varry the height
108 // of the infobar. 110 // of the infobar.
109 ui::OwnedWidgetGtk widget_; 111 ui::OwnedWidgetGtk widget_;
110 112
111 DISALLOW_COPY_AND_ASSIGN(InfoBarGtk); 113 DISALLOW_COPY_AND_ASSIGN(InfoBarGtk);
112 }; 114 };
113 115
114 #endif // CHROME_BROWSER_UI_GTK_INFOBARS_INFOBAR_GTK_H_ 116 #endif // CHROME_BROWSER_UI_GTK_INFOBARS_INFOBAR_GTK_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698