| 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 #include "extensions/common/extension.h" | 67 #include "extensions/common/extension.h" |
| 68 #include "extensions/common/extension_set.h" | 68 #include "extensions/common/extension_set.h" |
| 69 #include "ui/accessibility/ax_node_data.h" | 69 #include "ui/accessibility/ax_node_data.h" |
| 70 #include "ui/base/dragdrop/drag_utils.h" | 70 #include "ui/base/dragdrop/drag_utils.h" |
| 71 #include "ui/base/dragdrop/os_exchange_data.h" | 71 #include "ui/base/dragdrop/os_exchange_data.h" |
| 72 #include "ui/base/l10n/l10n_util.h" | 72 #include "ui/base/l10n/l10n_util.h" |
| 73 #include "ui/base/page_transition_types.h" | 73 #include "ui/base/page_transition_types.h" |
| 74 #include "ui/base/resource/resource_bundle.h" | 74 #include "ui/base/resource/resource_bundle.h" |
| 75 #include "ui/base/theme_provider.h" | 75 #include "ui/base/theme_provider.h" |
| 76 #include "ui/base/window_open_disposition.h" | 76 #include "ui/base/window_open_disposition.h" |
| 77 #include "ui/compositor/layer_type.h" |
| 77 #include "ui/compositor/paint_recorder.h" | 78 #include "ui/compositor/paint_recorder.h" |
| 78 #include "ui/gfx/animation/slide_animation.h" | 79 #include "ui/gfx/animation/slide_animation.h" |
| 79 #include "ui/gfx/canvas.h" | 80 #include "ui/gfx/canvas.h" |
| 80 #include "ui/gfx/color_utils.h" | 81 #include "ui/gfx/color_utils.h" |
| 81 #include "ui/gfx/favicon_size.h" | 82 #include "ui/gfx/favicon_size.h" |
| 82 #include "ui/gfx/geometry/insets.h" | 83 #include "ui/gfx/geometry/insets.h" |
| 83 #include "ui/gfx/geometry/rect.h" | 84 #include "ui/gfx/geometry/rect.h" |
| 84 #include "ui/gfx/image/image_skia_operations.h" | 85 #include "ui/gfx/image/image_skia_operations.h" |
| 85 #include "ui/gfx/paint_vector_icon.h" | 86 #include "ui/gfx/paint_vector_icon.h" |
| 86 #include "ui/gfx/scoped_canvas.h" | 87 #include "ui/gfx/scoped_canvas.h" |
| (...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 580 infobar_visible_(false), | 581 infobar_visible_(false), |
| 581 size_animation_(this), | 582 size_animation_(this), |
| 582 throbbing_view_(nullptr), | 583 throbbing_view_(nullptr), |
| 583 bookmark_bar_state_(BookmarkBar::SHOW), | 584 bookmark_bar_state_(BookmarkBar::SHOW), |
| 584 animating_detached_(false), | 585 animating_detached_(false), |
| 585 show_folder_method_factory_(this) { | 586 show_folder_method_factory_(this) { |
| 586 set_id(VIEW_ID_BOOKMARK_BAR); | 587 set_id(VIEW_ID_BOOKMARK_BAR); |
| 587 Init(); | 588 Init(); |
| 588 | 589 |
| 589 // Don't let the bookmarks show on top of the location bar while animating. | 590 // Don't let the bookmarks show on top of the location bar while animating. |
| 590 SetPaintToLayer(true); | 591 SetPaintToLayer(ui::LAYER_TEXTURED); |
| 591 layer()->SetMasksToBounds(true); | 592 layer()->SetMasksToBounds(true); |
| 592 layer()->SetFillsBoundsOpaquely(false); | 593 layer()->SetFillsBoundsOpaquely(false); |
| 593 | 594 |
| 594 size_animation_.Reset(1); | 595 size_animation_.Reset(1); |
| 595 } | 596 } |
| 596 | 597 |
| 597 BookmarkBarView::~BookmarkBarView() { | 598 BookmarkBarView::~BookmarkBarView() { |
| 598 if (model_) | 599 if (model_) |
| 599 model_->RemoveObserver(this); | 600 model_->RemoveObserver(this); |
| 600 | 601 |
| (...skipping 1547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2148 return; | 2149 return; |
| 2149 apps_page_shortcut_->SetVisible(visible); | 2150 apps_page_shortcut_->SetVisible(visible); |
| 2150 UpdateBookmarksSeparatorVisibility(); | 2151 UpdateBookmarksSeparatorVisibility(); |
| 2151 LayoutAndPaint(); | 2152 LayoutAndPaint(); |
| 2152 } | 2153 } |
| 2153 | 2154 |
| 2154 void BookmarkBarView::OnShowManagedBookmarksPrefChanged() { | 2155 void BookmarkBarView::OnShowManagedBookmarksPrefChanged() { |
| 2155 if (UpdateOtherAndManagedButtonsVisibility()) | 2156 if (UpdateOtherAndManagedButtonsVisibility()) |
| 2156 LayoutAndPaint(); | 2157 LayoutAndPaint(); |
| 2157 } | 2158 } |
| OLD | NEW |