| 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/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 744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 755 CHARRANGE sel; | 755 CHARRANGE sel; |
| 756 GetSel(sel); | 756 GetSel(sel); |
| 757 model()->StartAutocomplete(sel.cpMax != sel.cpMin, | 757 model()->StartAutocomplete(sel.cpMax != sel.cpMin, |
| 758 (sel.cpMax < GetTextLength()) || IsImeComposing()); | 758 (sel.cpMax < GetTextLength()) || IsImeComposing()); |
| 759 } | 759 } |
| 760 | 760 |
| 761 void OmniboxViewWin::SetFocus() { | 761 void OmniboxViewWin::SetFocus() { |
| 762 ::SetFocus(m_hWnd); | 762 ::SetFocus(m_hWnd); |
| 763 } | 763 } |
| 764 | 764 |
| 765 void OmniboxViewWin::SetInvisibleFocus() { |
| 766 // TODO(mathp): implement for Windows. |
| 767 NOTIMPLEMENTED(); |
| 768 } |
| 769 |
| 765 void OmniboxViewWin::SetDropHighlightPosition(int position) { | 770 void OmniboxViewWin::SetDropHighlightPosition(int position) { |
| 766 if (drop_highlight_position_ != position) { | 771 if (drop_highlight_position_ != position) { |
| 767 RepaintDropHighlight(drop_highlight_position_); | 772 RepaintDropHighlight(drop_highlight_position_); |
| 768 drop_highlight_position_ = position; | 773 drop_highlight_position_ = position; |
| 769 RepaintDropHighlight(drop_highlight_position_); | 774 RepaintDropHighlight(drop_highlight_position_); |
| 770 } | 775 } |
| 771 } | 776 } |
| 772 | 777 |
| 773 void OmniboxViewWin::MoveSelectedText(int new_position) { | 778 void OmniboxViewWin::MoveSelectedText(int new_position) { |
| 774 const string16 selected_text(GetSelectedText()); | 779 const string16 selected_text(GetSelectedText()); |
| (...skipping 1971 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2746 return (rect.left - client_rect.left) + (client_rect.right - rect.right); | 2751 return (rect.left - client_rect.left) + (client_rect.right - rect.right); |
| 2747 } | 2752 } |
| 2748 | 2753 |
| 2749 int OmniboxViewWin::WidthNeededToDisplay(const string16& text) const { | 2754 int OmniboxViewWin::WidthNeededToDisplay(const string16& text) const { |
| 2750 // Use font_.GetStringWidth() instead of | 2755 // Use font_.GetStringWidth() instead of |
| 2751 // PosFromChar(location_entry_->GetTextLength()) because PosFromChar() is | 2756 // PosFromChar(location_entry_->GetTextLength()) because PosFromChar() is |
| 2752 // apparently buggy. In both LTR UI and RTL UI with left-to-right layout, | 2757 // apparently buggy. In both LTR UI and RTL UI with left-to-right layout, |
| 2753 // PosFromChar(i) might return 0 when i is greater than 1. | 2758 // PosFromChar(i) might return 0 when i is greater than 1. |
| 2754 return font_.GetStringWidth(text) + GetHorizontalMargin(); | 2759 return font_.GetStringWidth(text) + GetHorizontalMargin(); |
| 2755 } | 2760 } |
| OLD | NEW |