OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/location_bar/location_bar_view.h" | 5 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 888 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
899 base::i18n::LEFT_TO_RIGHT : base::i18n::RIGHT_TO_LEFT)) { | 899 base::i18n::LEFT_TO_RIGHT : base::i18n::RIGHT_TO_LEFT)) { |
900 // TODO(sky): Figure out why we need the +1. | 900 // TODO(sky): Figure out why we need the +1. |
901 suggested_text_bounds.set_x(location_bounds.x() + 1); | 901 suggested_text_bounds.set_x(location_bounds.x() + 1); |
902 // Use a margin to prevent omnibox text from overlapping suggest text. | 902 // Use a margin to prevent omnibox text from overlapping suggest text. |
903 omnibox_view_margin = suggested_text_bounds.width(); | 903 omnibox_view_margin = suggested_text_bounds.width(); |
904 } | 904 } |
905 suggested_text_view_->SetBoundsRect(suggested_text_bounds); | 905 suggested_text_view_->SetBoundsRect(suggested_text_bounds); |
906 } | 906 } |
907 } | 907 } |
908 | 908 |
909 omnibox_view_->SetHorizontalMargins(0, omnibox_view_margin); | 909 const gfx::Insets insets = omnibox_view_->GetInsets(); |
| 910 omnibox_view_->set_border(views::Border::CreateEmptyBorder( |
| 911 insets.top(), insets.left(), insets.bottom(), omnibox_view_margin)); |
910 | 912 |
911 // Layout |ime_inline_autocomplete_view_| next to the user input. | 913 // Layout |ime_inline_autocomplete_view_| next to the user input. |
912 if (ime_inline_autocomplete_view_->visible()) { | 914 if (ime_inline_autocomplete_view_->visible()) { |
913 int width = | 915 int width = |
914 gfx::GetStringWidth(ime_inline_autocomplete_view_->text(), | 916 gfx::GetStringWidth(ime_inline_autocomplete_view_->text(), |
915 ime_inline_autocomplete_view_->font_list()) + | 917 ime_inline_autocomplete_view_->font_list()) + |
916 ime_inline_autocomplete_view_->GetInsets().width(); | 918 ime_inline_autocomplete_view_->GetInsets().width(); |
917 // All the target languages (IMEs) are LTR, and we do not need to support | 919 // All the target languages (IMEs) are LTR, and we do not need to support |
918 // RTL so far. In other words, no testable RTL environment so far. | 920 // RTL so far. In other words, no testable RTL environment so far. |
919 int x = location_needed_width; | 921 int x = location_needed_width; |
(...skipping 666 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1586 bounds.Inset(-(horizontal_padding + 1) / 2, 0); | 1588 bounds.Inset(-(horizontal_padding + 1) / 2, 0); |
1587 location_bar_util::PaintExtensionActionBackground( | 1589 location_bar_util::PaintExtensionActionBackground( |
1588 *(*page_action_view)->image_view()->page_action(), | 1590 *(*page_action_view)->image_view()->page_action(), |
1589 tab_id, canvas, bounds, text_color, background_color); | 1591 tab_id, canvas, bounds, text_color, background_color); |
1590 } | 1592 } |
1591 } | 1593 } |
1592 | 1594 |
1593 void LocationBarView::AccessibilitySetValue(const base::string16& new_value) { | 1595 void LocationBarView::AccessibilitySetValue(const base::string16& new_value) { |
1594 omnibox_view_->SetUserText(new_value, new_value, true); | 1596 omnibox_view_->SetUserText(new_value, new_value, true); |
1595 } | 1597 } |
OLD | NEW |