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_bar_view.h" | 5 #include "chrome/browser/views/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 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 if (BookmarkBarView::testing_) { | 220 if (BookmarkBarView::testing_) { |
221 // For some reason during testing the events generated by animating | 221 // For some reason during testing the events generated by animating |
222 // throw off the test. So, don't animate while testing. | 222 // throw off the test. So, don't animate while testing. |
223 show_animation_->Reset(1); | 223 show_animation_->Reset(1); |
224 } else { | 224 } else { |
225 show_animation_->Show(); | 225 show_animation_->Show(); |
226 } | 226 } |
227 } | 227 } |
228 | 228 |
229 virtual bool IsTriggerableEvent(const views::MouseEvent& e) { | 229 virtual bool IsTriggerableEvent(const views::MouseEvent& e) { |
230 // This is hard coded to avoid potential notification on left mouse down, | 230 // Left clicks should show the menu contents and right clicks should show |
231 // which we want to show the menu. | 231 // the context menu. They should not trigger the opening of underlying urls. |
232 return e.IsMiddleMouseButton(); | 232 if (e.GetFlags() == views::MouseEvent::EF_LEFT_BUTTON_DOWN || |
| 233 e.GetFlags() == views::MouseEvent::EF_RIGHT_BUTTON_DOWN) |
| 234 return false; |
| 235 |
| 236 WindowOpenDisposition disposition( |
| 237 event_utils::DispositionFromEventFlags(e.GetFlags())); |
| 238 return disposition != CURRENT_TAB; |
233 } | 239 } |
234 | 240 |
235 virtual void Paint(gfx::Canvas *canvas) { | 241 virtual void Paint(gfx::Canvas *canvas) { |
236 views::MenuButton::Paint(canvas, false); | 242 views::MenuButton::Paint(canvas, false); |
237 } | 243 } |
238 | 244 |
239 private: | 245 private: |
240 scoped_ptr<SlideAnimation> show_animation_; | 246 scoped_ptr<SlideAnimation> show_animation_; |
241 | 247 |
242 DISALLOW_COPY_AND_ASSIGN(BookmarkFolderButton); | 248 DISALLOW_COPY_AND_ASSIGN(BookmarkFolderButton); |
(...skipping 1490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1733 sync_error_button->SetTooltipText( | 1739 sync_error_button->SetTooltipText( |
1734 l10n_util::GetString(IDS_SYNC_BOOKMARK_BAR_ERROR_DESC)); | 1740 l10n_util::GetString(IDS_SYNC_BOOKMARK_BAR_ERROR_DESC)); |
1735 sync_error_button->SetAccessibleName( | 1741 sync_error_button->SetAccessibleName( |
1736 l10n_util::GetString(IDS_ACCNAME_SYNC_ERROR_BUTTON)); | 1742 l10n_util::GetString(IDS_ACCNAME_SYNC_ERROR_BUTTON)); |
1737 sync_error_button->SetIcon( | 1743 sync_error_button->SetIcon( |
1738 *ResourceBundle::GetSharedInstance().GetBitmapNamed(IDR_WARNING)); | 1744 *ResourceBundle::GetSharedInstance().GetBitmapNamed(IDR_WARNING)); |
1739 return sync_error_button; | 1745 return sync_error_button; |
1740 } | 1746 } |
1741 #endif | 1747 #endif |
1742 | 1748 |
OLD | NEW |