OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_menu_button.h" | 5 #include "chrome/browser/views/bookmark_menu_button.h" |
6 | 6 |
7 #include "app/resource_bundle.h" | 7 #include "app/resource_bundle.h" |
8 #include "app/os_exchange_data.h" | 8 #include "app/os_exchange_data.h" |
9 #include "chrome/browser/bookmarks/bookmark_model.h" | 9 #include "chrome/browser/bookmarks/bookmark_model.h" |
10 #include "chrome/browser/bookmarks/bookmark_utils.h" | 10 #include "chrome/browser/bookmarks/bookmark_utils.h" |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 return bookmark_utils::PerformBookmarkDrop( | 86 return bookmark_utils::PerformBookmarkDrop( |
87 browser_->profile(), data, parent, parent->GetChildCount()); | 87 browser_->profile(), data, parent, parent->GetChildCount()); |
88 } | 88 } |
89 | 89 |
90 void BookmarkMenuButton::BookmarkMenuDeleted( | 90 void BookmarkMenuButton::BookmarkMenuDeleted( |
91 BookmarkMenuController* controller) { | 91 BookmarkMenuController* controller) { |
92 bookmark_drop_menu_ = NULL; | 92 bookmark_drop_menu_ = NULL; |
93 } | 93 } |
94 | 94 |
95 void BookmarkMenuButton::RunMenu(views::View* source, | 95 void BookmarkMenuButton::RunMenu(views::View* source, |
96 const CPoint& pt, | 96 const gfx::Point& pt, |
97 gfx::NativeView hwnd) { | 97 gfx::NativeView hwnd) { |
98 RunMenu(source, pt, hwnd, false); | 98 RunMenu(source, pt, hwnd, false); |
99 } | 99 } |
100 | 100 |
101 void BookmarkMenuButton::RunMenu(views::View* source, | 101 void BookmarkMenuButton::RunMenu(views::View* source, |
102 const CPoint& pt, | 102 const gfx::Point& pt, |
103 gfx::NativeView hwnd, | 103 gfx::NativeView hwnd, |
104 bool for_drop) { | 104 bool for_drop) { |
105 Profile* profile = browser_->profile(); | 105 Profile* profile = browser_->profile(); |
106 BookmarkMenuController* menu = new BookmarkMenuController( | 106 BookmarkMenuController* menu = new BookmarkMenuController( |
107 browser_, profile, browser_->GetSelectedTabContents(), hwnd, | 107 browser_, profile, browser_->GetSelectedTabContents(), hwnd, |
108 GetBookmarkModel()->GetBookmarkBarNode(), 0, true); | 108 GetBookmarkModel()->GetBookmarkBarNode(), 0, true); |
109 | 109 |
110 views::MenuItemView::AnchorPosition anchor = views::MenuItemView::TOPRIGHT; | 110 views::MenuItemView::AnchorPosition anchor = views::MenuItemView::TOPRIGHT; |
111 if (UILayoutIsRightToLeft()) | 111 if (UILayoutIsRightToLeft()) |
112 anchor = views::MenuItemView::TOPLEFT; | 112 anchor = views::MenuItemView::TOPLEFT; |
(...skipping 21 matching lines...) Expand all Loading... |
134 delay = 400; | 134 delay = 400; |
135 show_drop_menu_timer_.Start(base::TimeDelta::FromMilliseconds(delay), | 135 show_drop_menu_timer_.Start(base::TimeDelta::FromMilliseconds(delay), |
136 this, &BookmarkMenuButton::ShowDropMenu); | 136 this, &BookmarkMenuButton::ShowDropMenu); |
137 } | 137 } |
138 | 138 |
139 void BookmarkMenuButton::StopShowFolderDropMenuTimer() { | 139 void BookmarkMenuButton::StopShowFolderDropMenuTimer() { |
140 show_drop_menu_timer_.Stop(); | 140 show_drop_menu_timer_.Stop(); |
141 } | 141 } |
142 | 142 |
143 void BookmarkMenuButton::ShowDropMenu() { | 143 void BookmarkMenuButton::ShowDropMenu() { |
144 RunMenu(NULL, CPoint(), GetWidget()->GetNativeView(), true); | 144 RunMenu(NULL, gfx::Point(), GetWidget()->GetNativeView(), true); |
145 } | 145 } |
OLD | NEW |