| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 997 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1008 if (!model_ || !model_->loaded() || | 1008 if (!model_ || !model_->loaded() || |
| 1009 !browser_->profile()->GetPrefs()->GetBoolean( | 1009 !browser_->profile()->GetPrefs()->GetBoolean( |
| 1010 bookmarks::prefs::kEditBookmarksEnabled)) | 1010 bookmarks::prefs::kEditBookmarksEnabled)) |
| 1011 return false; | 1011 return false; |
| 1012 | 1012 |
| 1013 if (!drop_info_.get()) | 1013 if (!drop_info_.get()) |
| 1014 drop_info_.reset(new DropInfo()); | 1014 drop_info_.reset(new DropInfo()); |
| 1015 | 1015 |
| 1016 // Only accept drops of 1 node, which is the case for all data dragged from | 1016 // Only accept drops of 1 node, which is the case for all data dragged from |
| 1017 // bookmark bar and menus. | 1017 // bookmark bar and menus. |
| 1018 return drop_info_->data.Read(data) && drop_info_->data.size() == 1; | 1018 return drop_info_->data.Read(data) && drop_info_->data.num_elements() == 1; |
| 1019 } | 1019 } |
| 1020 | 1020 |
| 1021 void BookmarkBarView::OnDragEntered(const DropTargetEvent& event) { | 1021 void BookmarkBarView::OnDragEntered(const DropTargetEvent& event) { |
| 1022 } | 1022 } |
| 1023 | 1023 |
| 1024 int BookmarkBarView::OnDragUpdated(const DropTargetEvent& event) { | 1024 int BookmarkBarView::OnDragUpdated(const DropTargetEvent& event) { |
| 1025 if (!drop_info_.get()) | 1025 if (!drop_info_.get()) |
| 1026 return 0; | 1026 return 0; |
| 1027 | 1027 |
| 1028 if (drop_info_->valid && | 1028 if (drop_info_->valid && |
| (...skipping 968 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1997 return; | 1997 return; |
| 1998 apps_page_shortcut_->SetVisible(visible); | 1998 apps_page_shortcut_->SetVisible(visible); |
| 1999 UpdateBookmarksSeparatorVisibility(); | 1999 UpdateBookmarksSeparatorVisibility(); |
| 2000 LayoutAndPaint(); | 2000 LayoutAndPaint(); |
| 2001 } | 2001 } |
| 2002 | 2002 |
| 2003 void BookmarkBarView::OnShowManagedBookmarksPrefChanged() { | 2003 void BookmarkBarView::OnShowManagedBookmarksPrefChanged() { |
| 2004 if (UpdateOtherAndManagedButtonsVisibility()) | 2004 if (UpdateOtherAndManagedButtonsVisibility()) |
| 2005 LayoutAndPaint(); | 2005 LayoutAndPaint(); |
| 2006 } | 2006 } |
| OLD | NEW |