| 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 963 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 974 | 974 |
| 975 if (selection_differs) | 975 if (selection_differs) |
| 976 controller()->OnSelectionBoundsChanged(); | 976 controller()->OnSelectionBoundsChanged(); |
| 977 | 977 |
| 978 if (something_changed && text_differs) | 978 if (something_changed && text_differs) |
| 979 TextChanged(); | 979 TextChanged(); |
| 980 | 980 |
| 981 if (text_differs) { | 981 if (text_differs) { |
| 982 // Note that a TEXT_CHANGED event implies that the cursor/selection | 982 // Note that a TEXT_CHANGED event implies that the cursor/selection |
| 983 // probably changed too, so we don't need to send both. | 983 // probably changed too, so we don't need to send both. |
| 984 native_view_host_->GetWidget()->NotifyAccessibilityEvent( | 984 native_view_host_->NotifyAccessibilityEvent( |
| 985 native_view_host_, ui::AccessibilityTypes::EVENT_TEXT_CHANGED, true); | 985 ui::AccessibilityTypes::EVENT_TEXT_CHANGED, true); |
| 986 } else if (selection_differs) { | 986 } else if (selection_differs) { |
| 987 // Notify assistive technology that the cursor or selection changed. | 987 // Notify assistive technology that the cursor or selection changed. |
| 988 native_view_host_->GetWidget()->NotifyAccessibilityEvent( | 988 native_view_host_->NotifyAccessibilityEvent( |
| 989 native_view_host_, | 989 ui::AccessibilityTypes::EVENT_SELECTION_CHANGED, true); |
| 990 ui::AccessibilityTypes::EVENT_SELECTION_CHANGED, | |
| 991 true); | |
| 992 } else if (delete_at_end_pressed_) { | 990 } else if (delete_at_end_pressed_) { |
| 993 model()->OnChanged(); | 991 model()->OnChanged(); |
| 994 } | 992 } |
| 995 | 993 |
| 996 return something_changed; | 994 return something_changed; |
| 997 } | 995 } |
| 998 | 996 |
| 999 void OmniboxViewWin::OnCandidateWindowCountChanged(size_t window_count) { | 997 void OmniboxViewWin::OnCandidateWindowCountChanged(size_t window_count) { |
| 1000 ime_candidate_window_open_ = (window_count != 0); | 998 ime_candidate_window_open_ = (window_count != 0); |
| 1001 if (ime_candidate_window_open_) { | 999 if (ime_candidate_window_open_) { |
| (...skipping 1855 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2857 return (rect.left - client_rect.left) + (client_rect.right - rect.right); | 2855 return (rect.left - client_rect.left) + (client_rect.right - rect.right); |
| 2858 } | 2856 } |
| 2859 | 2857 |
| 2860 int OmniboxViewWin::WidthNeededToDisplay(const string16& text) const { | 2858 int OmniboxViewWin::WidthNeededToDisplay(const string16& text) const { |
| 2861 // Use font_.GetStringWidth() instead of | 2859 // Use font_.GetStringWidth() instead of |
| 2862 // PosFromChar(location_entry_->GetTextLength()) because PosFromChar() is | 2860 // PosFromChar(location_entry_->GetTextLength()) because PosFromChar() is |
| 2863 // apparently buggy. In both LTR UI and RTL UI with left-to-right layout, | 2861 // apparently buggy. In both LTR UI and RTL UI with left-to-right layout, |
| 2864 // PosFromChar(i) might return 0 when i is greater than 1. | 2862 // PosFromChar(i) might return 0 when i is greater than 1. |
| 2865 return font_.GetStringWidth(text) + GetHorizontalMargin(); | 2863 return font_.GetStringWidth(text) + GetHorizontalMargin(); |
| 2866 } | 2864 } |
| OLD | NEW |