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 1874 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1885 | 1885 |
1886 void BookmarkBarView::StartShowFolderDropMenuTimer(const BookmarkNode* node) { | 1886 void BookmarkBarView::StartShowFolderDropMenuTimer(const BookmarkNode* node) { |
1887 if (!animations_enabled) { | 1887 if (!animations_enabled) { |
1888 // So that tests can run as fast as possible disable the delay during | 1888 // So that tests can run as fast as possible disable the delay during |
1889 // testing. | 1889 // testing. |
1890 ShowDropFolderForNode(node); | 1890 ShowDropFolderForNode(node); |
1891 return; | 1891 return; |
1892 } | 1892 } |
1893 show_folder_method_factory_.InvalidateWeakPtrs(); | 1893 show_folder_method_factory_.InvalidateWeakPtrs(); |
1894 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( | 1894 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( |
1895 FROM_HERE, base::Bind(&BookmarkBarView::ShowDropFolderForNode, | 1895 FROM_HERE, |
1896 show_folder_method_factory_.GetWeakPtr(), node), | 1896 base::BindOnce(&BookmarkBarView::ShowDropFolderForNode, |
| 1897 show_folder_method_factory_.GetWeakPtr(), node), |
1897 base::TimeDelta::FromMilliseconds(views::GetMenuShowDelay())); | 1898 base::TimeDelta::FromMilliseconds(views::GetMenuShowDelay())); |
1898 } | 1899 } |
1899 | 1900 |
1900 void BookmarkBarView::CalculateDropLocation(const DropTargetEvent& event, | 1901 void BookmarkBarView::CalculateDropLocation(const DropTargetEvent& event, |
1901 const BookmarkNodeData& data, | 1902 const BookmarkNodeData& data, |
1902 DropLocation* location) { | 1903 DropLocation* location) { |
1903 DCHECK(model_); | 1904 DCHECK(model_); |
1904 DCHECK(model_->loaded()); | 1905 DCHECK(model_->loaded()); |
1905 DCHECK(data.is_valid()); | 1906 DCHECK(data.is_valid()); |
1906 | 1907 |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2151 return; | 2152 return; |
2152 apps_page_shortcut_->SetVisible(visible); | 2153 apps_page_shortcut_->SetVisible(visible); |
2153 UpdateBookmarksSeparatorVisibility(); | 2154 UpdateBookmarksSeparatorVisibility(); |
2154 LayoutAndPaint(); | 2155 LayoutAndPaint(); |
2155 } | 2156 } |
2156 | 2157 |
2157 void BookmarkBarView::OnShowManagedBookmarksPrefChanged() { | 2158 void BookmarkBarView::OnShowManagedBookmarksPrefChanged() { |
2158 if (UpdateOtherAndManagedButtonsVisibility()) | 2159 if (UpdateOtherAndManagedButtonsVisibility()) |
2159 LayoutAndPaint(); | 2160 LayoutAndPaint(); |
2160 } | 2161 } |
OLD | NEW |