OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/autocomplete/autocomplete_edit_view_win.h" | 5 #include "chrome/browser/autocomplete/autocomplete_edit_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 910 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
921 } | 921 } |
922 | 922 |
923 gfx::NativeView AutocompleteEditViewWin::GetNativeView() const { | 923 gfx::NativeView AutocompleteEditViewWin::GetNativeView() const { |
924 return m_hWnd; | 924 return m_hWnd; |
925 } | 925 } |
926 | 926 |
927 CommandUpdater* AutocompleteEditViewWin::GetCommandUpdater() { | 927 CommandUpdater* AutocompleteEditViewWin::GetCommandUpdater() { |
928 return command_updater_; | 928 return command_updater_; |
929 } | 929 } |
930 | 930 |
931 void AutocompleteEditViewWin::SetInstantSuggestion(const string16& suggestion) { | 931 void AutocompleteEditViewWin::SetInstantSuggestion(const string16& suggestion, |
932 // On Windows, we shows the suggestion in LocationBarView. | 932 bool animate_to_complete) { |
933 NOTREACHED(); | 933 parent_view_->SetInstantSuggestion(suggestion, animate_to_complete); |
934 } | 934 } |
935 | 935 |
936 int AutocompleteEditViewWin::TextWidth() const { | 936 int AutocompleteEditViewWin::TextWidth() const { |
937 return WidthNeededToDisplay(GetText()); | 937 return WidthNeededToDisplay(GetText()); |
938 } | 938 } |
939 | 939 |
940 string16 AutocompleteEditViewWin::GetInstantSuggestion() const { | 940 string16 AutocompleteEditViewWin::GetInstantSuggestion() const { |
941 return parent_view_->GetInstantSuggestion(); | 941 return parent_view_->GetInstantSuggestion(); |
942 } | 942 } |
943 | 943 |
(...skipping 1675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2619 // PosFromChar(i) might return 0 when i is greater than 1. | 2619 // PosFromChar(i) might return 0 when i is greater than 1. |
2620 return font_.GetStringWidth(text) + GetHorizontalMargin(); | 2620 return font_.GetStringWidth(text) + GetHorizontalMargin(); |
2621 } | 2621 } |
2622 | 2622 |
2623 bool AutocompleteEditViewWin::IsCaretAtEnd() const { | 2623 bool AutocompleteEditViewWin::IsCaretAtEnd() const { |
2624 long length = GetTextLength(); | 2624 long length = GetTextLength(); |
2625 CHARRANGE sel; | 2625 CHARRANGE sel; |
2626 GetSelection(sel); | 2626 GetSelection(sel); |
2627 return sel.cpMin == sel.cpMax && sel.cpMin == length; | 2627 return sel.cpMin == sel.cpMax && sel.cpMin == length; |
2628 } | 2628 } |
OLD | NEW |