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

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

Issue 7003039: ui/base/models: Add empty() accessor to TreeNode class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sky review Created 9 years, 6 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 #include "chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk.h" 5 #include "chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after
524 } 524 }
525 525
526 bookmark_utils::ConfigureButtonForNode(model_->other_node(), 526 bookmark_utils::ConfigureButtonForNode(model_->other_node(),
527 model_, other_bookmarks_button_, theme_service_); 527 model_, other_bookmarks_button_, theme_service_);
528 528
529 SetInstructionState(); 529 SetInstructionState();
530 SetChevronState(); 530 SetChevronState();
531 } 531 }
532 532
533 void BookmarkBarGtk::SetInstructionState() { 533 void BookmarkBarGtk::SetInstructionState() {
534 show_instructions_ = (model_->GetBookmarkBarNode()->child_count() == 0); 534 show_instructions_ = model_->GetBookmarkBarNode()->empty();
535 if (show_instructions_) { 535 if (show_instructions_) {
536 gtk_widget_hide(bookmark_toolbar_.get()); 536 gtk_widget_hide(bookmark_toolbar_.get());
537 gtk_widget_show_all(instructions_); 537 gtk_widget_show_all(instructions_);
538 } else { 538 } else {
539 gtk_widget_hide(instructions_); 539 gtk_widget_hide(instructions_);
540 gtk_widget_show(bookmark_toolbar_.get()); 540 gtk_widget_show(bookmark_toolbar_.get());
541 } 541 }
542 } 542 }
543 543
544 void BookmarkBarGtk::SetChevronState() { 544 void BookmarkBarGtk::SetChevronState() {
(...skipping 921 matching lines...) Expand 10 before | Expand all | Expand 10 after
1466 1466
1467 // Find the GtkWidget* for the actual target button. 1467 // Find the GtkWidget* for the actual target button.
1468 int shift = dir == GTK_MENU_DIR_PARENT ? -1 : 1; 1468 int shift = dir == GTK_MENU_DIR_PARENT ? -1 : 1;
1469 button_idx = (button_idx + shift + folder_list.size()) % folder_list.size(); 1469 button_idx = (button_idx + shift + folder_list.size()) % folder_list.size();
1470 PopupForButton(folder_list[button_idx]); 1470 PopupForButton(folder_list[button_idx]);
1471 } 1471 }
1472 1472
1473 void BookmarkBarGtk::CloseMenu() { 1473 void BookmarkBarGtk::CloseMenu() {
1474 current_context_menu_->Cancel(); 1474 current_context_menu_->Cancel();
1475 } 1475 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698