OLD | NEW |
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/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 <set> | 9 #include <set> |
10 #include <vector> | 10 #include <vector> |
(...skipping 1181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1192 for (int i = 0; i < bb_count; ++i) { | 1192 for (int i = 0; i < bb_count; ++i) { |
1193 if (!GetBookmarkButton(i)->IsVisible()) | 1193 if (!GetBookmarkButton(i)->IsVisible()) |
1194 return i; | 1194 return i; |
1195 } | 1195 } |
1196 return bb_count; | 1196 return bb_count; |
1197 } | 1197 } |
1198 | 1198 |
1199 MenuButton* BookmarkBarView::CreateOtherBookmarkedButton() { | 1199 MenuButton* BookmarkBarView::CreateOtherBookmarkedButton() { |
1200 MenuButton* button = new BookmarkFolderButton( | 1200 MenuButton* button = new BookmarkFolderButton( |
1201 this, | 1201 this, |
1202 UTF16ToWide(l10n_util::GetStringUTF16(IDS_BOOMARK_BAR_OTHER_BOOKMARKED)), | 1202 UTF16ToWide(l10n_util::GetStringUTF16(IDS_BOOKMARK_BAR_OTHER_BOOKMARKED)), |
1203 this, | 1203 this, |
1204 false); | 1204 false); |
1205 button->set_id(VIEW_ID_OTHER_BOOKMARKS); | 1205 button->set_id(VIEW_ID_OTHER_BOOKMARKS); |
1206 button->SetIcon(GetFolderIcon()); | 1206 button->SetIcon(GetFolderIcon()); |
1207 button->set_context_menu_controller(this); | 1207 button->set_context_menu_controller(this); |
1208 button->set_tag(kOtherFolderButtonTag); | 1208 button->set_tag(kOtherFolderButtonTag); |
1209 button->SetAccessibleName( | 1209 button->SetAccessibleName( |
1210 l10n_util::GetStringUTF16(IDS_BOOMARK_BAR_OTHER_BOOKMARKED)); | 1210 l10n_util::GetStringUTF16(IDS_BOOKMARK_BAR_OTHER_BOOKMARKED)); |
1211 return button; | 1211 return button; |
1212 } | 1212 } |
1213 | 1213 |
1214 MenuButton* BookmarkBarView::CreateOverflowButton() { | 1214 MenuButton* BookmarkBarView::CreateOverflowButton() { |
1215 MenuButton* button = new OverFlowButton(this); | 1215 MenuButton* button = new OverFlowButton(this); |
1216 button->SetIcon(*ResourceBundle::GetSharedInstance(). | 1216 button->SetIcon(*ResourceBundle::GetSharedInstance(). |
1217 GetBitmapNamed(IDR_BOOKMARK_BAR_CHEVRONS)); | 1217 GetBitmapNamed(IDR_BOOKMARK_BAR_CHEVRONS)); |
1218 | 1218 |
1219 // The overflow button's image contains an arrow and therefore it is a | 1219 // The overflow button's image contains an arrow and therefore it is a |
1220 // direction sensitive image and we need to flip it if the UI layout is | 1220 // direction sensitive image and we need to flip it if the UI layout is |
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1724 (1 - size_animation_->GetCurrentValue()))); | 1724 (1 - size_animation_->GetCurrentValue()))); |
1725 } else { | 1725 } else { |
1726 prefsize.set_height( | 1726 prefsize.set_height( |
1727 static_cast<int>( | 1727 static_cast<int>( |
1728 browser_defaults::kBookmarkBarHeight * | 1728 browser_defaults::kBookmarkBarHeight * |
1729 size_animation_->GetCurrentValue())); | 1729 size_animation_->GetCurrentValue())); |
1730 } | 1730 } |
1731 } | 1731 } |
1732 return prefsize; | 1732 return prefsize; |
1733 } | 1733 } |
OLD | NEW |