| 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 <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <limits> | 10 #include <limits> |
| (...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 609 browser_view_(browser_view), | 609 browser_view_(browser_view), |
| 610 infobar_visible_(false), | 610 infobar_visible_(false), |
| 611 size_animation_(this), | 611 size_animation_(this), |
| 612 throbbing_view_(NULL), | 612 throbbing_view_(NULL), |
| 613 bookmark_bar_state_(BookmarkBar::SHOW), | 613 bookmark_bar_state_(BookmarkBar::SHOW), |
| 614 animating_detached_(false), | 614 animating_detached_(false), |
| 615 show_folder_method_factory_(this) { | 615 show_folder_method_factory_(this) { |
| 616 set_id(VIEW_ID_BOOKMARK_BAR); | 616 set_id(VIEW_ID_BOOKMARK_BAR); |
| 617 Init(); | 617 Init(); |
| 618 | 618 |
| 619 if (ui::MaterialDesignController::IsModeMaterial()) { |
| 620 // Don't let the bookmarks show on top of the location bar while animating. |
| 621 SetPaintToLayer(true); |
| 622 layer()->SetFillsBoundsOpaquely(false); |
| 623 layer()->SetMasksToBounds(true); |
| 624 } |
| 625 |
| 619 size_animation_.Reset(1); | 626 size_animation_.Reset(1); |
| 620 } | 627 } |
| 621 | 628 |
| 622 BookmarkBarView::~BookmarkBarView() { | 629 BookmarkBarView::~BookmarkBarView() { |
| 623 if (model_) | 630 if (model_) |
| 624 model_->RemoveObserver(this); | 631 model_->RemoveObserver(this); |
| 625 | 632 |
| 626 // It's possible for the menu to outlive us, reset the observer to make sure | 633 // It's possible for the menu to outlive us, reset the observer to make sure |
| 627 // it doesn't have a reference to us. | 634 // it doesn't have a reference to us. |
| 628 if (bookmark_menu_) { | 635 if (bookmark_menu_) { |
| (...skipping 1519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2148 return; | 2155 return; |
| 2149 apps_page_shortcut_->SetVisible(visible); | 2156 apps_page_shortcut_->SetVisible(visible); |
| 2150 UpdateBookmarksSeparatorVisibility(); | 2157 UpdateBookmarksSeparatorVisibility(); |
| 2151 LayoutAndPaint(); | 2158 LayoutAndPaint(); |
| 2152 } | 2159 } |
| 2153 | 2160 |
| 2154 void BookmarkBarView::OnShowManagedBookmarksPrefChanged() { | 2161 void BookmarkBarView::OnShowManagedBookmarksPrefChanged() { |
| 2155 if (UpdateOtherAndManagedButtonsVisibility()) | 2162 if (UpdateOtherAndManagedButtonsVisibility()) |
| 2156 LayoutAndPaint(); | 2163 LayoutAndPaint(); |
| 2157 } | 2164 } |
| OLD | NEW |