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

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

Issue 1697223002: Remove HostDesktopType from c/b/ui/bookmarks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@metro-mode-21
Patch Set: #else and mac Created 4 years, 10 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
« 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 <stdint.h> 7 #include <stdint.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <limits> 10 #include <limits>
(...skipping 1539 matching lines...) Expand 10 before | Expand all | Expand 10 after
1550 profile_pref_registrar_.Init(browser_->profile()->GetPrefs()); 1550 profile_pref_registrar_.Init(browser_->profile()->GetPrefs());
1551 profile_pref_registrar_.Add( 1551 profile_pref_registrar_.Add(
1552 bookmarks::prefs::kShowAppsShortcutInBookmarkBar, 1552 bookmarks::prefs::kShowAppsShortcutInBookmarkBar,
1553 base::Bind(&BookmarkBarView::OnAppsPageShortcutVisibilityPrefChanged, 1553 base::Bind(&BookmarkBarView::OnAppsPageShortcutVisibilityPrefChanged,
1554 base::Unretained(this))); 1554 base::Unretained(this)));
1555 profile_pref_registrar_.Add( 1555 profile_pref_registrar_.Add(
1556 bookmarks::prefs::kShowManagedBookmarksInBookmarkBar, 1556 bookmarks::prefs::kShowManagedBookmarksInBookmarkBar,
1557 base::Bind(&BookmarkBarView::OnShowManagedBookmarksPrefChanged, 1557 base::Bind(&BookmarkBarView::OnShowManagedBookmarksPrefChanged,
1558 base::Unretained(this))); 1558 base::Unretained(this)));
1559 apps_page_shortcut_->SetVisible( 1559 apps_page_shortcut_->SetVisible(
1560 chrome::ShouldShowAppsShortcutInBookmarkBar( 1560 chrome::ShouldShowAppsShortcutInBookmarkBar(browser_->profile()));
1561 browser_->profile(), browser_->host_desktop_type()));
1562 1561
1563 bookmarks_separator_view_ = new ButtonSeparatorView(); 1562 bookmarks_separator_view_ = new ButtonSeparatorView();
1564 AddChildView(bookmarks_separator_view_); 1563 AddChildView(bookmarks_separator_view_);
1565 UpdateBookmarksSeparatorVisibility(); 1564 UpdateBookmarksSeparatorVisibility();
1566 1565
1567 instructions_ = new BookmarkBarInstructionsView(this); 1566 instructions_ = new BookmarkBarInstructionsView(this);
1568 AddChildView(instructions_); 1567 AddChildView(instructions_);
1569 1568
1570 set_context_menu_controller(this); 1569 set_context_menu_controller(this);
1571 1570
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after
2053 // Ash does not paint the bookmarks separator line because it looks odd on 2052 // Ash does not paint the bookmarks separator line because it looks odd on
2054 // the flat background. We keep it present for layout, but don't draw it. 2053 // the flat background. We keep it present for layout, but don't draw it.
2055 bookmarks_separator_view_->SetVisible( 2054 bookmarks_separator_view_->SetVisible(
2056 browser_->host_desktop_type() != chrome::HOST_DESKTOP_TYPE_ASH && 2055 browser_->host_desktop_type() != chrome::HOST_DESKTOP_TYPE_ASH &&
2057 other_bookmarks_button_->visible()); 2056 other_bookmarks_button_->visible());
2058 } 2057 }
2059 2058
2060 void BookmarkBarView::OnAppsPageShortcutVisibilityPrefChanged() { 2059 void BookmarkBarView::OnAppsPageShortcutVisibilityPrefChanged() {
2061 DCHECK(apps_page_shortcut_); 2060 DCHECK(apps_page_shortcut_);
2062 // Only perform layout if required. 2061 // Only perform layout if required.
2063 bool visible = chrome::ShouldShowAppsShortcutInBookmarkBar( 2062 bool visible =
2064 browser_->profile(), browser_->host_desktop_type()); 2063 chrome::ShouldShowAppsShortcutInBookmarkBar(browser_->profile());
2065 if (apps_page_shortcut_->visible() == visible) 2064 if (apps_page_shortcut_->visible() == visible)
2066 return; 2065 return;
2067 apps_page_shortcut_->SetVisible(visible); 2066 apps_page_shortcut_->SetVisible(visible);
2068 UpdateBookmarksSeparatorVisibility(); 2067 UpdateBookmarksSeparatorVisibility();
2069 LayoutAndPaint(); 2068 LayoutAndPaint();
2070 } 2069 }
2071 2070
2072 void BookmarkBarView::OnShowManagedBookmarksPrefChanged() { 2071 void BookmarkBarView::OnShowManagedBookmarksPrefChanged() {
2073 if (UpdateOtherAndManagedButtonsVisibility()) 2072 if (UpdateOtherAndManagedButtonsVisibility())
2074 LayoutAndPaint(); 2073 LayoutAndPaint();
2075 } 2074 }
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