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

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

Issue 13800017: Move the Apps shortcut to the left of the bookmarks bar, and use new icon. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Without the bitmaps. Created 7 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/app/theme/theme_resources.grd ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 72fd27703a5896ad434e46c540cdd147e3a28573..789c211454f38c28e136fb8dba39843ee4fadfff 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
+++ b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
@@ -1389,7 +1389,7 @@ views::TextButton* BookmarkBarView::CreateAppsPageShortcutButton() {
IDS_BOOKMARK_BAR_APPS_SHORTCUT_TOOLTIP));
button->set_id(VIEW_ID_BOOKMARK_BAR_ELEMENT);
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
- button->SetIcon(*rb.GetImageSkiaNamed(IDR_WEBSTORE_ICON_16));
+ button->SetIcon(*rb.GetImageSkiaNamed(IDR_BOOKMARK_BAR_APPS_SHORTCUT));
button->set_context_menu_controller(this);
button->set_tag(kAppsShortcutButtonTag);
return button;
@@ -1720,8 +1720,7 @@ void BookmarkBarView::UpdateBookmarksSeparatorVisibility() {
// the flat background. We keep it present for layout, but don't draw it.
bookmarks_separator_view_->SetVisible(
browser_->host_desktop_type() != chrome::HOST_DESKTOP_TYPE_ASH &&
- (other_bookmarked_button_->visible() ||
- apps_page_shortcut_->visible()));
+ other_bookmarked_button_->visible());
}
gfx::Size BookmarkBarView::LayoutItems(bool compute_bounds_only) {
@@ -1766,6 +1765,17 @@ gfx::Size BookmarkBarView::LayoutItems(bool compute_bounds_only) {
// Next, layout out the buttons. Any buttons that are placed beyond the
// visible region and made invisible.
+
+ // Start with the apps page shortcut button.
+ if (apps_page_shortcut_->visible()) {
+ if (!compute_bounds_only) {
+ apps_page_shortcut_->SetBounds(x, y, apps_page_shortcut_pref.width(),
+ height);
+ }
+ x += apps_page_shortcut_pref.width() + kButtonPadding;
+ }
+
+ // Then go through the bookmark buttons.
if (GetBookmarkButtonCount() == 0 && model_ && model_->IsLoaded()) {
gfx::Size pref = instructions_->GetPreferredSize();
if (!compute_bounds_only) {
@@ -1831,15 +1841,6 @@ gfx::Size BookmarkBarView::LayoutItems(bool compute_bounds_only) {
x += other_bookmarked_pref.width() + kButtonPadding;
}
- // The app page shortcut button.
- if (apps_page_shortcut_->visible()) {
- if (!compute_bounds_only) {
- apps_page_shortcut_->SetBounds(x, y, apps_page_shortcut_pref.width(),
- height);
- }
- x += apps_page_shortcut_pref.width() + kButtonPadding;
- }
-
// Set the preferred size computed so far.
if (compute_bounds_only) {
x += kRightMargin;
« no previous file with comments | « chrome/app/theme/theme_resources.grd ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698