| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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.h" | 5 #include "chrome/browser/autocomplete/autocomplete_edit.h" |
| 6 | 6 |
| 7 #include <locale> | 7 #include <locale> |
| 8 | 8 |
| 9 #include "base/base_drag_source.h" | 9 #include "base/base_drag_source.h" |
| 10 #include "base/clipboard.h" | 10 #include "base/clipboard.h" |
| (...skipping 927 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 938 return IsSelectAllForRange(selection); | 938 return IsSelectAllForRange(selection); |
| 939 } | 939 } |
| 940 | 940 |
| 941 void AutocompleteEditView::SelectAll(bool reversed) { | 941 void AutocompleteEditView::SelectAll(bool reversed) { |
| 942 if (reversed) | 942 if (reversed) |
| 943 SetSelection(GetTextLength(), 0); | 943 SetSelection(GetTextLength(), 0); |
| 944 else | 944 else |
| 945 SetSelection(0, GetTextLength()); | 945 SetSelection(0, GetTextLength()); |
| 946 } | 946 } |
| 947 | 947 |
| 948 void AutocompleteEditView::DeSelectAll() { |
| 949 SetSelection(0, 0); |
| 950 } |
| 951 |
| 948 void AutocompleteEditView::RevertAll() { | 952 void AutocompleteEditView::RevertAll() { |
| 949 ScopedFreeze freeze(this, GetTextObjectModel()); | 953 ScopedFreeze freeze(this, GetTextObjectModel()); |
| 950 ClosePopup(); | 954 ClosePopup(); |
| 951 model_->Revert(); | 955 model_->Revert(); |
| 952 saved_selection_for_focus_change_.cpMin = -1; | 956 saved_selection_for_focus_change_.cpMin = -1; |
| 953 TextChanged(); | 957 TextChanged(); |
| 954 } | 958 } |
| 955 | 959 |
| 956 void AutocompleteEditView::UpdatePopup() { | 960 void AutocompleteEditView::UpdatePopup() { |
| 957 ScopedFreeze freeze(this, GetTextObjectModel()); | 961 ScopedFreeze freeze(this, GetTextObjectModel()); |
| (...skipping 1497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2455 } | 2459 } |
| 2456 | 2460 |
| 2457 void AutocompleteEditView::RepaintDropHighlight(int position) { | 2461 void AutocompleteEditView::RepaintDropHighlight(int position) { |
| 2458 if ((position != -1) && (position <= GetTextLength())) { | 2462 if ((position != -1) && (position <= GetTextLength())) { |
| 2459 const POINT min_loc(PosFromChar(position)); | 2463 const POINT min_loc(PosFromChar(position)); |
| 2460 const RECT highlight_bounds = {min_loc.x - 1, font_y_adjustment_, | 2464 const RECT highlight_bounds = {min_loc.x - 1, font_y_adjustment_, |
| 2461 min_loc.x + 2, font_ascent_ + font_descent_ + font_y_adjustment_}; | 2465 min_loc.x + 2, font_ascent_ + font_descent_ + font_y_adjustment_}; |
| 2462 InvalidateRect(&highlight_bounds, false); | 2466 InvalidateRect(&highlight_bounds, false); |
| 2463 } | 2467 } |
| 2464 } | 2468 } |
| OLD | NEW |