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

Side by Side Diff: chrome/browser/gtk/bookmark_bar_gtk.cc

Issue 203010: GTK: fix bookmark bar regression:... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: plusplus readability Created 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "chrome/browser/gtk/bookmark_bar_gtk.h" 5 #include "chrome/browser/gtk/bookmark_bar_gtk.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "app/gfx/text_elider.h" 9 #include "app/gfx/text_elider.h"
10 #include "app/gtk_dnd_util.h" 10 #include "app/gtk_dnd_util.h"
(...skipping 959 matching lines...) Expand 10 before | Expand all | Expand 10 after
970 return TRUE; 970 return TRUE;
971 } 971 }
972 972
973 // MenuBarHelper::Delegate implementation -------------------------------------- 973 // MenuBarHelper::Delegate implementation --------------------------------------
974 void BookmarkBarGtk::PopupForButton(GtkWidget* button) { 974 void BookmarkBarGtk::PopupForButton(GtkWidget* button) {
975 const BookmarkNode* node = GetNodeForToolButton(button); 975 const BookmarkNode* node = GetNodeForToolButton(button);
976 DCHECK(node); 976 DCHECK(node);
977 DCHECK(page_navigator_); 977 DCHECK(page_navigator_);
978 978
979 int first_hidden = GetFirstHiddenBookmark(0, NULL); 979 int first_hidden = GetFirstHiddenBookmark(0, NULL);
980 if (button != overflow_button_ && button != other_bookmarks_button_ && 980 if (first_hidden == -1) {
981 node->GetParent()->IndexOfChild(node) >= first_hidden) { 981 // No overflow exists: don't show anything for the overflow button.
982 return; 982 if (button == overflow_button_)
983 return;
984 } else {
985 // Overflow exists: don't show anything for an overflowed folder button.
986 if (button != overflow_button_ && button != other_bookmarks_button_ &&
987 node->GetParent()->IndexOfChild(node) >= first_hidden) {
988 return;
989 }
983 } 990 }
984 991
985 current_menu_.reset( 992 current_menu_.reset(
986 new BookmarkMenuController(browser_, profile_, 993 new BookmarkMenuController(browser_, profile_,
987 page_navigator_, 994 page_navigator_,
988 GTK_WINDOW(gtk_widget_get_toplevel(button)), 995 GTK_WINDOW(gtk_widget_get_toplevel(button)),
989 node, 996 node,
990 button == overflow_button_ ? 997 button == overflow_button_ ?
991 first_hidden : 0, 998 first_hidden : 0,
992 false)); 999 false));
(...skipping 23 matching lines...) Expand all
1016 break; 1023 break;
1017 } 1024 }
1018 } 1025 }
1019 DCHECK_NE(button_idx, -1); 1026 DCHECK_NE(button_idx, -1);
1020 1027
1021 // Find the GtkWidget* for the actual target button. 1028 // Find the GtkWidget* for the actual target button.
1022 int shift = dir == GTK_MENU_DIR_PARENT ? -1 : 1; 1029 int shift = dir == GTK_MENU_DIR_PARENT ? -1 : 1;
1023 button_idx = (button_idx + shift + folder_list.size()) % folder_list.size(); 1030 button_idx = (button_idx + shift + folder_list.size()) % folder_list.size();
1024 PopupForButton(folder_list[button_idx]); 1031 PopupForButton(folder_list[button_idx]);
1025 } 1032 }
OLDNEW
« 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