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/toolbar_view.h" | 5 #include "chrome/browser/views/toolbar_view.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
865 event_utils::DispositionFromEventFlags(sender->mouse_event_flags())); | 865 event_utils::DispositionFromEventFlags(sender->mouse_event_flags())); |
866 } | 866 } |
867 | 867 |
868 gfx::Rect BrowserToolbarView::GetPopupBounds() const { | 868 gfx::Rect BrowserToolbarView::GetPopupBounds() const { |
869 gfx::Point origin; | 869 gfx::Point origin; |
870 views::View::ConvertPointToScreen(star_, &origin); | 870 views::View::ConvertPointToScreen(star_, &origin); |
871 origin.set_y(origin.y() + star_->height() + kOmniboxPopupVerticalSpacing); | 871 origin.set_y(origin.y() + star_->height() + kOmniboxPopupVerticalSpacing); |
872 gfx::Rect popup_bounds(origin.x(), origin.y(), | 872 gfx::Rect popup_bounds(origin.x(), origin.y(), |
873 star_->width() + location_bar_->width() + go_->width(), | 873 star_->width() + location_bar_->width() + go_->width(), |
874 0); | 874 0); |
875 popup_bounds.set_x(popup_bounds.x()); | 875 if (UILayoutIsRightToLeft()) |
| 876 popup_bounds.set_x(popup_bounds.x() - location_bar_->width() - go_->width())
; |
| 877 else |
| 878 popup_bounds.set_x(popup_bounds.x()); |
876 popup_bounds.set_y(popup_bounds.y()); | 879 popup_bounds.set_y(popup_bounds.y()); |
877 popup_bounds.set_width(popup_bounds.width()); | 880 popup_bounds.set_width(popup_bounds.width()); |
878 // Inset the bounds a little, since the buttons on either edge of the omnibox | 881 // Inset the bounds a little, since the buttons on either edge of the omnibox |
879 // have invisible padding that makes the popup appear too wide. | 882 // have invisible padding that makes the popup appear too wide. |
880 popup_bounds.Inset(kOmniboxButtonsHorizontalMargin, 0); | 883 popup_bounds.Inset(kOmniboxButtonsHorizontalMargin, 0); |
881 return popup_bounds; | 884 return popup_bounds; |
882 } | 885 } |
883 | 886 |
884 // static | 887 // static |
885 int BrowserToolbarView::PopupTopSpacing() { | 888 int BrowserToolbarView::PopupTopSpacing() { |
(...skipping 25 matching lines...) Expand all Loading... |
911 case IDC_COPY: | 914 case IDC_COPY: |
912 *accel = views::Accelerator(L'C', false, true, false); | 915 *accel = views::Accelerator(L'C', false, true, false); |
913 return true; | 916 return true; |
914 case IDC_PASTE: | 917 case IDC_PASTE: |
915 *accel = views::Accelerator(L'V', false, true, false); | 918 *accel = views::Accelerator(L'V', false, true, false); |
916 return true; | 919 return true; |
917 } | 920 } |
918 // Else, we retrieve the accelerator information from the frame. | 921 // Else, we retrieve the accelerator information from the frame. |
919 return GetWidget()->GetAccelerator(id, accel); | 922 return GetWidget()->GetAccelerator(id, accel); |
920 } | 923 } |
OLD | NEW |