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

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

Issue 7115005: Reverse menu anchor position provided to views::MenuItemView for RTL languages. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed BrowserActionOverflowMenuController. Created 9 years, 6 months 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/ui/views/extensions/browser_action_overflow_menu_controller.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) 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 510 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 return static_cast<views::MenuButton*>(GetChildViewAt(index)); 521 return static_cast<views::MenuButton*>(GetChildViewAt(index));
522 } 522 }
523 523
524 void BookmarkBarView::GetAnchorPositionForButton( 524 void BookmarkBarView::GetAnchorPositionForButton(
525 views::MenuButton* button, 525 views::MenuButton* button,
526 MenuItemView::AnchorPosition* anchor) { 526 MenuItemView::AnchorPosition* anchor) {
527 if (button == other_bookmarked_button_ || button == overflow_button_) 527 if (button == other_bookmarked_button_ || button == overflow_button_)
528 *anchor = MenuItemView::TOPRIGHT; 528 *anchor = MenuItemView::TOPRIGHT;
529 else 529 else
530 *anchor = MenuItemView::TOPLEFT; 530 *anchor = MenuItemView::TOPLEFT;
531
532 // Invert orientation if right to left.
533 if (base::i18n::IsRTL()) {
534 if (*anchor == MenuItemView::TOPRIGHT)
535 *anchor = MenuItemView::TOPLEFT;
536 else
537 *anchor = MenuItemView::TOPRIGHT;
538 }
539 } 531 }
540 532
541 views::MenuItemView* BookmarkBarView::GetMenu() { 533 views::MenuItemView* BookmarkBarView::GetMenu() {
542 return bookmark_menu_ ? bookmark_menu_->menu() : NULL; 534 return bookmark_menu_ ? bookmark_menu_->menu() : NULL;
543 } 535 }
544 536
545 views::MenuItemView* BookmarkBarView::GetContextMenu() { 537 views::MenuItemView* BookmarkBarView::GetContextMenu() {
546 return bookmark_menu_ ? bookmark_menu_->context_menu() : NULL; 538 return bookmark_menu_ ? bookmark_menu_->context_menu() : NULL;
547 } 539 }
548 540
(...skipping 1224 matching lines...) Expand 10 before | Expand all | Expand 10 after
1773 prefsize.set_height(kBarHeight + 1765 prefsize.set_height(kBarHeight +
1774 static_cast<int>((kNewtabBarHeight - kBarHeight) * 1766 static_cast<int>((kNewtabBarHeight - kBarHeight) *
1775 (1 - size_animation_->GetCurrentValue()))); 1767 (1 - size_animation_->GetCurrentValue())));
1776 } else { 1768 } else {
1777 prefsize.set_height( 1769 prefsize.set_height(
1778 static_cast<int>(kBarHeight * size_animation_->GetCurrentValue())); 1770 static_cast<int>(kBarHeight * size_animation_->GetCurrentValue()));
1779 } 1771 }
1780 } 1772 }
1781 return prefsize; 1773 return prefsize;
1782 } 1774 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/extensions/browser_action_overflow_menu_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698