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

Unified Diff: chrome/browser/ui/gtk/global_bookmark_menu.cc

Issue 6982010: GTK: Hardy build fix for r84860. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/gtk/global_bookmark_menu.cc
diff --git a/chrome/browser/ui/gtk/global_bookmark_menu.cc b/chrome/browser/ui/gtk/global_bookmark_menu.cc
index c06fc1b04a2e611fa78dc513375fd8f3a1e424c5..09d16c65cac0b6d5d57c47024ef5f2583677b2b6 100644
--- a/chrome/browser/ui/gtk/global_bookmark_menu.cc
+++ b/chrome/browser/ui/gtk/global_bookmark_menu.cc
@@ -60,6 +60,11 @@ void GlobalBookmarkMenu::RebuildMenuInFuture() {
}
void GlobalBookmarkMenu::RebuildMenu() {
+#if !GTK_CHECK_VERSION(2, 16, 1)
+ // We can't deal with this case; we need to use dynamic APIs. Thankfully,
+ // this will never visibly do anything on earlier versions of GTK+.
+ return;
+#endif
BookmarkModel* model = profile_->GetBookmarkModel();
DCHECK(model);
DCHECK(model->IsLoaded());
@@ -132,9 +137,14 @@ void GlobalBookmarkMenu::AddNodeToMenu(const BookmarkNode* node,
void GlobalBookmarkMenu::ConfigureMenuItem(const BookmarkNode* node,
GtkWidget* menu_item) {
+ // This check is only to make things compile on Hardy; this code won't
+ // display any visible widgets in older systems that don't have a global menu
+ // bar.
+#if GTK_CHECK_VERSION(2, 16, 1)
string16 elided_name = l10n_util::TruncateString(node->GetTitle(), kMaxChars);
gtk_menu_item_set_label(GTK_MENU_ITEM(menu_item),
UTF16ToUTF8(elided_name).c_str());
+#endif
if (node->is_url()) {
std::string tooltip = gtk_util::BuildTooltipTitleFor(node->GetTitle(),
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698