OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |