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

Unified Diff: chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc

Issue 8776025: Makes views show the 'mobile' bookmark folder where appropriate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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
Index: chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
index c351fb2e5c69ae3fb8373e37c0c638912de3fd45..3e5fc17364ec973e5402736410e8f2bf3112402a 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
+++ b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
@@ -833,15 +833,17 @@ void BookmarkBarView::ShowImportDialog() {
}
void BookmarkBarView::Loaded(BookmarkModel* model, bool ids_reassigned) {
- volatile int button_count = GetBookmarkButtonCount();
- DCHECK(button_count == 0); // If non-zero it means Load was invoked more than
- // once, or we didn't properly clear things.
- // Either of which shouldn't happen
+ // There should be no buttons. If non-zero it means Load was invoked more than
+ // once, or we didn't properly clear things. Either of which shouldn't happen.
+ DCHECK_EQ(0, GetBookmarkButtonCount());
const BookmarkNode* node = model_->bookmark_bar_node();
- DCHECK(node && model_->other_node());
+ DCHECK(node);
// Create a button for each of the children on the bookmark bar.
for (int i = 0, child_count = node->child_count(); i < child_count; ++i)
AddChildViewAt(CreateBookmarkButton(node->GetChild(i)), i);
+ DCHECK(model_->other_node());
+ other_bookmarked_button_->SetAccessibleName(model_->other_node()->GetTitle());
+ other_bookmarked_button_->SetText(model_->other_node()->GetTitle());
UpdateColors();
UpdateOtherBookmarksVisibility();
other_bookmarked_button_->SetEnabled(true);
@@ -1167,17 +1169,12 @@ int BookmarkBarView::GetFirstHiddenNodeIndex() {
}
MenuButton* BookmarkBarView::CreateOtherBookmarkedButton() {
- MenuButton* button = new BookmarkFolderButton(
- this,
- l10n_util::GetStringUTF16(IDS_BOOKMARK_BAR_OTHER_BOOKMARKED),
- this,
- false);
+ // Title is set in Loaded.
+ MenuButton* button = new BookmarkFolderButton(this, string16(), this, false);
button->set_id(VIEW_ID_OTHER_BOOKMARKS);
button->SetIcon(GetFolderIcon());
button->set_context_menu_controller(this);
button->set_tag(kOtherFolderButtonTag);
- button->SetAccessibleName(
- l10n_util::GetStringUTF16(IDS_BOOKMARK_BAR_OTHER_BOOKMARKED));
return button;
}
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/ui/views/bookmarks/bookmark_menu_controller_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698