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 884 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
895 base::i18n::LEFT_TO_RIGHT : base::i18n::RIGHT_TO_LEFT)) { | 895 base::i18n::LEFT_TO_RIGHT : base::i18n::RIGHT_TO_LEFT)) { |
896 // TODO(sky): Figure out why we need the +1. | 896 // TODO(sky): Figure out why we need the +1. |
897 suggested_text_bounds.set_x(location_bounds.x() + 1); | 897 suggested_text_bounds.set_x(location_bounds.x() + 1); |
898 // Use a margin to prevent omnibox text from overlapping suggest text. | 898 // Use a margin to prevent omnibox text from overlapping suggest text. |
899 omnibox_view_margin = suggested_text_bounds.width(); | 899 omnibox_view_margin = suggested_text_bounds.width(); |
900 } | 900 } |
901 suggested_text_view_->SetBoundsRect(suggested_text_bounds); | 901 suggested_text_view_->SetBoundsRect(suggested_text_bounds); |
902 } | 902 } |
903 } | 903 } |
904 | 904 |
905 const gfx::Insets insets = omnibox_view_->GetInsets(); | 905 omnibox_view_->SetHorizontalMargins(0, omnibox_view_margin); |
906 omnibox_view_->set_border(views::Border::CreateEmptyBorder( | |
907 insets.top(), insets.left(), insets.bottom(), omnibox_view_margin)); | |
908 | 906 |
909 // Layout |ime_inline_autocomplete_view_| next to the user input. | 907 // Layout |ime_inline_autocomplete_view_| next to the user input. |
910 if (ime_inline_autocomplete_view_->visible()) { | 908 if (ime_inline_autocomplete_view_->visible()) { |
911 int width = | 909 int width = |
912 gfx::GetStringWidth(ime_inline_autocomplete_view_->text(), | 910 gfx::GetStringWidth(ime_inline_autocomplete_view_->text(), |
913 ime_inline_autocomplete_view_->font_list()) + | 911 ime_inline_autocomplete_view_->font_list()) + |
914 ime_inline_autocomplete_view_->GetInsets().width(); | 912 ime_inline_autocomplete_view_->GetInsets().width(); |
915 // All the target languages (IMEs) are LTR, and we do not need to support | 913 // All the target languages (IMEs) are LTR, and we do not need to support |
916 // RTL so far. In other words, no testable RTL environment so far. | 914 // RTL so far. In other words, no testable RTL environment so far. |
917 int x = location_needed_width; | 915 int x = location_needed_width; |
(...skipping 666 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1584 bounds.Inset(-(horizontal_padding + 1) / 2, 0); | 1582 bounds.Inset(-(horizontal_padding + 1) / 2, 0); |
1585 location_bar_util::PaintExtensionActionBackground( | 1583 location_bar_util::PaintExtensionActionBackground( |
1586 *(*page_action_view)->image_view()->page_action(), | 1584 *(*page_action_view)->image_view()->page_action(), |
1587 tab_id, canvas, bounds, text_color, background_color); | 1585 tab_id, canvas, bounds, text_color, background_color); |
1588 } | 1586 } |
1589 } | 1587 } |
1590 | 1588 |
1591 void LocationBarView::AccessibilitySetValue(const base::string16& new_value) { | 1589 void LocationBarView::AccessibilitySetValue(const base::string16& new_value) { |
1592 omnibox_view_->SetUserText(new_value, new_value, true); | 1590 omnibox_view_->SetUserText(new_value, new_value, true); |
1593 } | 1591 } |
OLD | NEW |