Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(74)

Side by Side Diff: chrome/browser/views/bookmark_bar_view.cc

Issue 291006: Control Click to all bookmarks in folder in background tabs. This currently w... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/views/bookmark_menu_controller_views.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/views/bookmark_menu_controller_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698