OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/omnibox/omnibox_view_win.h" | 5 #include "chrome/browser/ui/views/omnibox/omnibox_view_win.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <locale> | 8 #include <locale> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 940 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
951 if (ime_candidate_window_open_) { | 951 if (ime_candidate_window_open_) { |
952 CloseOmniboxPopup(); | 952 CloseOmniboxPopup(); |
953 } else if (model()->user_input_in_progress()) { | 953 } else if (model()->user_input_in_progress()) { |
954 // UpdatePopup assumes user input is in progress, so only call it if | 954 // UpdatePopup assumes user input is in progress, so only call it if |
955 // that's the case. Otherwise, autocomplete may run on an empty user | 955 // that's the case. Otherwise, autocomplete may run on an empty user |
956 // text. | 956 // text. |
957 UpdatePopup(); | 957 UpdatePopup(); |
958 } | 958 } |
959 } | 959 } |
960 | 960 |
961 void OmniboxViewWin::OnTextUpdated(const ui::Range& /*composition_range*/) { | 961 void OmniboxViewWin::OnTextUpdated(const gfx::Range& /*composition_range*/) { |
962 if (ignore_ime_messages_) | 962 if (ignore_ime_messages_) |
963 return; | 963 return; |
964 OnAfterPossibleChangeInternal(true); | 964 OnAfterPossibleChangeInternal(true); |
965 // Call OnBeforePossibleChange function here to get correct diff in next IME | 965 // Call OnBeforePossibleChange function here to get correct diff in next IME |
966 // update. The Text Services Framework does not provide any notification | 966 // update. The Text Services Framework does not provide any notification |
967 // before entering edit session, therefore we don't have good place to call | 967 // before entering edit session, therefore we don't have good place to call |
968 // OnBeforePossibleChange. | 968 // OnBeforePossibleChange. |
969 OnBeforePossibleChange(); | 969 OnBeforePossibleChange(); |
970 } | 970 } |
971 | 971 |
(...skipping 1831 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2803 } | 2803 } |
2804 | 2804 |
2805 int OmniboxViewWin::WidthNeededToDisplay(const string16& text) const { | 2805 int OmniboxViewWin::WidthNeededToDisplay(const string16& text) const { |
2806 // Use font_list_.GetPrimaryFont().GetStringWidth() instead of | 2806 // Use font_list_.GetPrimaryFont().GetStringWidth() instead of |
2807 // PosFromChar(GetTextLength()) because PosFromChar() is apparently buggy. | 2807 // PosFromChar(GetTextLength()) because PosFromChar() is apparently buggy. |
2808 // In both LTR UI and RTL UI with left-to-right layout, PosFromChar(i) might | 2808 // In both LTR UI and RTL UI with left-to-right layout, PosFromChar(i) might |
2809 // return 0 when i is greater than 1. | 2809 // return 0 when i is greater than 1. |
2810 return font_list_.GetPrimaryFont().GetStringWidth(text) + | 2810 return font_list_.GetPrimaryFont().GetStringWidth(text) + |
2811 GetHorizontalMargin(); | 2811 GetHorizontalMargin(); |
2812 } | 2812 } |
OLD | NEW |