Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(313)

Side by Side Diff: chrome/browser/ui/views/omnibox/omnibox_view_win.cc

Issue 11305002: Support TSF related event handling on NativeTextField (Closed) Base URL: http://git.chromium.org/chromium/src.git@findbar_fix
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/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 899 matching lines...) Expand 10 before | Expand all | Expand 10 after
910 native_view_host_, 910 native_view_host_,
911 ui::AccessibilityTypes::EVENT_SELECTION_CHANGED, 911 ui::AccessibilityTypes::EVENT_SELECTION_CHANGED,
912 true); 912 true);
913 } else if (delete_at_end_pressed_) { 913 } else if (delete_at_end_pressed_) {
914 model()->OnChanged(); 914 model()->OnChanged();
915 } 915 }
916 916
917 return something_changed; 917 return something_changed;
918 } 918 }
919 919
920 void OmniboxViewWin::OnTextUpdated() { 920 void OmniboxViewWin::OnTextUpdated(const ui::Range& /*composition_range*/) {
921 if (ignore_ime_messages_) 921 if (ignore_ime_messages_)
922 return; 922 return;
923 OnAfterPossibleChangeInternal(true); 923 OnAfterPossibleChangeInternal(true);
924 // Call OnBeforePossibleChange function here to get correct diff in next IME 924 // Call OnBeforePossibleChange function here to get correct diff in next IME
925 // update. The Text Services Framework does not provide any notification 925 // update. The Text Services Framework does not provide any notification
926 // before entering edit session, therefore we don't have good place to call 926 // before entering edit session, therefore we don't have good place to call
927 // OnBeforePossibleChange. 927 // OnBeforePossibleChange.
928 OnBeforePossibleChange(); 928 OnBeforePossibleChange();
929 } 929 }
930 930
931 void OmniboxViewWin::OnTsfStartComposition() {}
Peter Kasting 2012/10/27 19:00:46 Does this message give us what we need in order to
Seigo Nonaka 2012/10/27 22:20:18 Unfortunately no, because OnTsfstartComosition is
932
933 void OmniboxViewWin::OnTsfEndComposition() {}
934
931 void OmniboxViewWin::OnCandidateWindowCountChanged(size_t window_count) { 935 void OmniboxViewWin::OnCandidateWindowCountChanged(size_t window_count) {
932 ime_candidate_window_open_ = (window_count != 0); 936 ime_candidate_window_open_ = (window_count != 0);
933 if (ime_candidate_window_open_) { 937 if (ime_candidate_window_open_) {
934 CloseOmniboxPopup(); 938 CloseOmniboxPopup();
935 } else if (model()->user_input_in_progress()) { 939 } else if (model()->user_input_in_progress()) {
936 // UpdatePopup assumes user input is in progress, so only call it if 940 // UpdatePopup assumes user input is in progress, so only call it if
937 // that's the case. Otherwise, autocomplete may run on an empty user 941 // that's the case. Otherwise, autocomplete may run on an empty user
938 // text. 942 // text.
939 UpdatePopup(); 943 UpdatePopup();
940 } 944 }
(...skipping 1809 matching lines...) Expand 10 before | Expand all | Expand 10 after
2750 return (rect.left - client_rect.left) + (client_rect.right - rect.right); 2754 return (rect.left - client_rect.left) + (client_rect.right - rect.right);
2751 } 2755 }
2752 2756
2753 int OmniboxViewWin::WidthNeededToDisplay(const string16& text) const { 2757 int OmniboxViewWin::WidthNeededToDisplay(const string16& text) const {
2754 // Use font_.GetStringWidth() instead of 2758 // Use font_.GetStringWidth() instead of
2755 // PosFromChar(location_entry_->GetTextLength()) because PosFromChar() is 2759 // PosFromChar(location_entry_->GetTextLength()) because PosFromChar() is
2756 // apparently buggy. In both LTR UI and RTL UI with left-to-right layout, 2760 // apparently buggy. In both LTR UI and RTL UI with left-to-right layout,
2757 // PosFromChar(i) might return 0 when i is greater than 1. 2761 // PosFromChar(i) might return 0 when i is greater than 1.
2758 return font_.GetStringWidth(text) + GetHorizontalMargin(); 2762 return font_.GetStringWidth(text) + GetHorizontalMargin();
2759 } 2763 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698