OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/views/bookmark_bar_view.h" | 5 #include "chrome/browser/views/bookmark_bar_view.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "base/base_drag_source.h" | 10 #include "base/base_drag_source.h" |
(...skipping 1204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1215 // bottom right corner of the bookmark item. | 1215 // bottom right corner of the bookmark item. |
1216 if (UILayoutIsRightToLeft()) | 1216 if (UILayoutIsRightToLeft()) |
1217 anchor_point = MenuItemView::TOPRIGHT; | 1217 anchor_point = MenuItemView::TOPRIGHT; |
1218 else | 1218 else |
1219 anchor_point = MenuItemView::TOPLEFT; | 1219 anchor_point = MenuItemView::TOPLEFT; |
1220 } | 1220 } |
1221 gfx::Point screen_loc(x, 0); | 1221 gfx::Point screen_loc(x, 0); |
1222 View::ConvertPointToScreen(this, &screen_loc); | 1222 View::ConvertPointToScreen(this, &screen_loc); |
1223 bookmark_menu_ = new BookmarkMenuController( | 1223 bookmark_menu_ = new BookmarkMenuController( |
1224 browser_, profile_, page_navigator_, GetWidget()->GetNativeView(), | 1224 browser_, profile_, page_navigator_, GetWidget()->GetNativeView(), |
1225 node, start_index); | 1225 node, start_index, false); |
1226 bookmark_menu_->set_observer(this); | 1226 bookmark_menu_->set_observer(this); |
1227 bookmark_menu_->RunMenuAt(gfx::Rect(screen_loc.x(), screen_loc.y(), | 1227 bookmark_menu_->RunMenuAt(gfx::Rect(screen_loc.x(), screen_loc.y(), |
1228 view->width(), bar_height), | 1228 view->width(), bar_height), |
1229 anchor_point, false); | 1229 anchor_point, false); |
1230 } | 1230 } |
1231 | 1231 |
1232 void BookmarkBarView::ButtonPressed(views::Button* sender) { | 1232 void BookmarkBarView::ButtonPressed(views::Button* sender) { |
1233 BookmarkNode* node; | 1233 BookmarkNode* node; |
1234 if (sender->tag() == kOtherFolderButtonTag) { | 1234 if (sender->tag() == kOtherFolderButtonTag) { |
1235 node = model_->other_node(); | 1235 node = model_->other_node(); |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1439 if (index == -1) | 1439 if (index == -1) |
1440 return; | 1440 return; |
1441 view_to_position_menu_from = GetBookmarkButton(index); | 1441 view_to_position_menu_from = GetBookmarkButton(index); |
1442 if (UILayoutIsRightToLeft()) | 1442 if (UILayoutIsRightToLeft()) |
1443 anchor = MenuItemView::TOPRIGHT; | 1443 anchor = MenuItemView::TOPRIGHT; |
1444 } | 1444 } |
1445 | 1445 |
1446 drop_info_->is_menu_showing = true; | 1446 drop_info_->is_menu_showing = true; |
1447 bookmark_drop_menu_ = new BookmarkMenuController( | 1447 bookmark_drop_menu_ = new BookmarkMenuController( |
1448 browser_, profile_, page_navigator_, GetWidget()->GetNativeView(), | 1448 browser_, profile_, page_navigator_, GetWidget()->GetNativeView(), |
1449 node, start_index); | 1449 node, start_index, false); |
1450 bookmark_drop_menu_->set_observer(this); | 1450 bookmark_drop_menu_->set_observer(this); |
1451 gfx::Point screen_loc; | 1451 gfx::Point screen_loc; |
1452 View::ConvertPointToScreen(view_to_position_menu_from, &screen_loc); | 1452 View::ConvertPointToScreen(view_to_position_menu_from, &screen_loc); |
1453 bookmark_drop_menu_->RunMenuAt( | 1453 bookmark_drop_menu_->RunMenuAt( |
1454 gfx::Rect(screen_loc.x(), screen_loc.y(), | 1454 gfx::Rect(screen_loc.x(), screen_loc.y(), |
1455 view_to_position_menu_from->width(), | 1455 view_to_position_menu_from->width(), |
1456 view_to_position_menu_from->height()), | 1456 view_to_position_menu_from->height()), |
1457 anchor, true); | 1457 anchor, true); |
1458 } | 1458 } |
1459 | 1459 |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1642 } | 1642 } |
1643 | 1643 |
1644 void BookmarkBarView::StopThrobbing(bool immediate) { | 1644 void BookmarkBarView::StopThrobbing(bool immediate) { |
1645 if (!throbbing_view_) | 1645 if (!throbbing_view_) |
1646 return; | 1646 return; |
1647 | 1647 |
1648 // If not immediate, cycle through 2 more complete cycles. | 1648 // If not immediate, cycle through 2 more complete cycles. |
1649 throbbing_view_->StartThrobbing(immediate ? 0 : 4); | 1649 throbbing_view_->StartThrobbing(immediate ? 0 : 4); |
1650 throbbing_view_ = NULL; | 1650 throbbing_view_ = NULL; |
1651 } | 1651 } |
OLD | NEW |