| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <set> | 9 #include <set> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 1063 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1074 parent = node->parent(); | 1074 parent = node->parent(); |
| 1075 } else { | 1075 } else { |
| 1076 parent = model_->bookmark_bar_node(); | 1076 parent = model_->bookmark_bar_node(); |
| 1077 nodes.push_back(parent); | 1077 nodes.push_back(parent); |
| 1078 } | 1078 } |
| 1079 Profile* profile = browser_->profile(); | 1079 Profile* profile = browser_->profile(); |
| 1080 bool close_on_remove = | 1080 bool close_on_remove = |
| 1081 (parent == profile->GetBookmarkModel()->other_node()) && | 1081 (parent == profile->GetBookmarkModel()->other_node()) && |
| 1082 (parent->child_count() == 1); | 1082 (parent->child_count() == 1); |
| 1083 context_menu_.reset(new BookmarkContextMenu(GetWidget(), profile, | 1083 context_menu_.reset(new BookmarkContextMenu(GetWidget(), profile, |
| 1084 browser_->GetSelectedTabContents(), parent, nodes, close_on_remove)); | 1084 browser_->GetSelectedWebContents(), parent, nodes, close_on_remove)); |
| 1085 context_menu_->RunMenuAt(p); | 1085 context_menu_->RunMenuAt(p); |
| 1086 } | 1086 } |
| 1087 | 1087 |
| 1088 void BookmarkBarView::Observe(int type, | 1088 void BookmarkBarView::Observe(int type, |
| 1089 const content::NotificationSource& source, | 1089 const content::NotificationSource& source, |
| 1090 const content::NotificationDetails& details) { | 1090 const content::NotificationDetails& details) { |
| 1091 DCHECK(browser_->profile()); | 1091 DCHECK(browser_->profile()); |
| 1092 switch (type) { | 1092 switch (type) { |
| 1093 case chrome::NOTIFICATION_BOOKMARK_BUBBLE_SHOWN: { | 1093 case chrome::NOTIFICATION_BOOKMARK_BUBBLE_SHOWN: { |
| 1094 StopThrobbing(true); | 1094 StopThrobbing(true); |
| (...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1661 (1 - size_animation_->GetCurrentValue()))); | 1661 (1 - size_animation_->GetCurrentValue()))); |
| 1662 } else { | 1662 } else { |
| 1663 prefsize.set_height( | 1663 prefsize.set_height( |
| 1664 static_cast<int>( | 1664 static_cast<int>( |
| 1665 browser_defaults::kBookmarkBarHeight * | 1665 browser_defaults::kBookmarkBarHeight * |
| 1666 size_animation_->GetCurrentValue())); | 1666 size_animation_->GetCurrentValue())); |
| 1667 } | 1667 } |
| 1668 } | 1668 } |
| 1669 return prefsize; | 1669 return prefsize; |
| 1670 } | 1670 } |
| OLD | NEW |