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 715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
726 // TODO(sky): Figure out why we need the +1. | 726 // TODO(sky): Figure out why we need the +1. |
727 suggested_text_bounds.set_x(location_bounds.x() + 1); | 727 suggested_text_bounds.set_x(location_bounds.x() + 1); |
728 // Use a margin to prevent omnibox text from overlapping suggest text. | 728 // Use a margin to prevent omnibox text from overlapping suggest text. |
729 omnibox_view_margin = suggested_text_bounds.width(); | 729 omnibox_view_margin = suggested_text_bounds.width(); |
730 } | 730 } |
731 suggested_text_view_->SetBoundsRect(suggested_text_bounds); | 731 suggested_text_view_->SetBoundsRect(suggested_text_bounds); |
732 } | 732 } |
733 } | 733 } |
734 | 734 |
735 omnibox_view_->SetBorder( | 735 omnibox_view_->SetBorder( |
736 views::Border::CreateEmptyBorder(0, 0, 0, omnibox_view_margin)); | 736 views::CreateEmptyBorder(0, 0, 0, omnibox_view_margin)); |
737 | 737 |
738 // Layout |ime_inline_autocomplete_view_| next to the user input. | 738 // Layout |ime_inline_autocomplete_view_| next to the user input. |
739 if (ime_inline_autocomplete_view_->visible()) { | 739 if (ime_inline_autocomplete_view_->visible()) { |
740 int width = | 740 int width = |
741 gfx::GetStringWidth(ime_inline_autocomplete_view_->text(), | 741 gfx::GetStringWidth(ime_inline_autocomplete_view_->text(), |
742 ime_inline_autocomplete_view_->font_list()) + | 742 ime_inline_autocomplete_view_->font_list()) + |
743 ime_inline_autocomplete_view_->GetInsets().width(); | 743 ime_inline_autocomplete_view_->GetInsets().width(); |
744 // All the target languages (IMEs) are LTR, and we do not need to support | 744 // All the target languages (IMEs) are LTR, and we do not need to support |
745 // RTL so far. In other words, no testable RTL environment so far. | 745 // RTL so far. In other words, no testable RTL environment so far. |
746 int x = location_needed_width; | 746 int x = location_needed_width; |
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1351 // LocationBarView, private TemplateURLServiceObserver implementation: | 1351 // LocationBarView, private TemplateURLServiceObserver implementation: |
1352 | 1352 |
1353 void LocationBarView::OnTemplateURLServiceChanged() { | 1353 void LocationBarView::OnTemplateURLServiceChanged() { |
1354 template_url_service_->RemoveObserver(this); | 1354 template_url_service_->RemoveObserver(this); |
1355 template_url_service_ = nullptr; | 1355 template_url_service_ = nullptr; |
1356 // If the browser is no longer active, let's not show the info bubble, as this | 1356 // If the browser is no longer active, let's not show the info bubble, as this |
1357 // would make the browser the active window again. | 1357 // would make the browser the active window again. |
1358 if (omnibox_view_ && omnibox_view_->GetWidget()->IsActive()) | 1358 if (omnibox_view_ && omnibox_view_->GetWidget()->IsActive()) |
1359 ShowFirstRunBubble(); | 1359 ShowFirstRunBubble(); |
1360 } | 1360 } |
OLD | NEW |