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

Side by Side Diff: chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc

Issue 332443004: Updated menu to hide the Managed Bookmarks to follow the folder's name. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 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
« no previous file with comments | « chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm ('k') | 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) 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 #include "chrome/browser/ui/views/bookmarks/bookmark_bar_view.h" 5 #include "chrome/browser/ui/views/bookmarks/bookmark_bar_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 1500 matching lines...) Expand 10 before | Expand all | Expand 10 after
1511 DCHECK(index >= 0 && index < GetBookmarkButtonCount()); 1511 DCHECK(index >= 0 && index < GetBookmarkButtonCount());
1512 views::View* button = child_at(index); 1512 views::View* button = child_at(index);
1513 RemoveChildView(button); 1513 RemoveChildView(button);
1514 base::MessageLoop::current()->DeleteSoon(FROM_HERE, button); 1514 base::MessageLoop::current()->DeleteSoon(FROM_HERE, button);
1515 Layout(); 1515 Layout();
1516 SchedulePaint(); 1516 SchedulePaint();
1517 } 1517 }
1518 1518
1519 void BookmarkBarView::BookmarkNodeChangedImpl(BookmarkModel* model, 1519 void BookmarkBarView::BookmarkNodeChangedImpl(BookmarkModel* model,
1520 const BookmarkNode* node) { 1520 const BookmarkNode* node) {
1521 if (node == client_->managed_node()) {
1522 // The managed node may have its title updated.
1523 managed_bookmarks_button_->SetAccessibleName(
1524 client_->managed_node()->GetTitle());
1525 managed_bookmarks_button_->SetText(client_->managed_node()->GetTitle());
1526 return;
1527 }
1528
1521 if (node->parent() != model->bookmark_bar_node()) { 1529 if (node->parent() != model->bookmark_bar_node()) {
1522 // We only care about nodes on the bookmark bar. 1530 // We only care about nodes on the bookmark bar.
1523 return; 1531 return;
1524 } 1532 }
1525 int index = model->bookmark_bar_node()->GetIndexOf(node); 1533 int index = model->bookmark_bar_node()->GetIndexOf(node);
1526 DCHECK_NE(-1, index); 1534 DCHECK_NE(-1, index);
1527 views::TextButton* button = GetBookmarkButton(index); 1535 views::TextButton* button = GetBookmarkButton(index);
1528 gfx::Size old_pref = button->GetPreferredSize(); 1536 gfx::Size old_pref = button->GetPreferredSize();
1529 ConfigureButton(node, button); 1537 ConfigureButton(node, button);
1530 gfx::Size new_pref = button->GetPreferredSize(); 1538 gfx::Size new_pref = button->GetPreferredSize();
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
1910 DCHECK(apps_page_shortcut_); 1918 DCHECK(apps_page_shortcut_);
1911 // Only perform layout if required. 1919 // Only perform layout if required.
1912 bool visible = chrome::ShouldShowAppsShortcutInBookmarkBar( 1920 bool visible = chrome::ShouldShowAppsShortcutInBookmarkBar(
1913 browser_->profile(), browser_->host_desktop_type()); 1921 browser_->profile(), browser_->host_desktop_type());
1914 if (apps_page_shortcut_->visible() == visible) 1922 if (apps_page_shortcut_->visible() == visible)
1915 return; 1923 return;
1916 apps_page_shortcut_->SetVisible(visible); 1924 apps_page_shortcut_->SetVisible(visible);
1917 UpdateBookmarksSeparatorVisibility(); 1925 UpdateBookmarksSeparatorVisibility();
1918 Layout(); 1926 Layout();
1919 } 1927 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698