| 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_view_win.h" | 5 #include "chrome/browser/autocomplete/autocomplete_edit_view_win.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/base_drop_target.h" | 10 #include "base/base_drop_target.h" |
| (...skipping 1808 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1819 // scenarios. This way, all clicks that can move the cursor will place it at | 1819 // scenarios. This way, all clicks that can move the cursor will place it at |
| 1820 // the end of the text, but triple-click will still work. | 1820 // the end of the text, but triple-click will still work. |
| 1821 return is_triple_click ? (right_bound - 1) : right_bound; | 1821 return is_triple_click ? (right_bound - 1) : right_bound; |
| 1822 } | 1822 } |
| 1823 | 1823 |
| 1824 void AutocompleteEditViewWin::EmphasizeURLComponents() { | 1824 void AutocompleteEditViewWin::EmphasizeURLComponents() { |
| 1825 ITextDocument* const text_object_model = GetTextObjectModel(); | 1825 ITextDocument* const text_object_model = GetTextObjectModel(); |
| 1826 ScopedFreeze freeze(this, text_object_model); | 1826 ScopedFreeze freeze(this, text_object_model); |
| 1827 ScopedSuspendUndo suspend_undo(text_object_model); | 1827 ScopedSuspendUndo suspend_undo(text_object_model); |
| 1828 | 1828 |
| 1829 // Save the selection. | 1829 // Save the selection. Bug 8314: Purify started reporting uninitialized |
| 1830 CHARRANGE saved_sel; | 1830 // memory access in saved_sel. This would suggest that GetSelection(), which |
| 1831 // is calling the rich edit's GetSel() is failing. I'm not sure how or why |
| 1832 // this would happen. For now just initialize the CHARRANGE to be safe. |
| 1833 CHARRANGE saved_sel = {0, 0}; |
| 1831 GetSelection(saved_sel); | 1834 GetSelection(saved_sel); |
| 1832 | 1835 |
| 1833 // See whether the contents are a URL with a non-empty host portion, which we | 1836 // See whether the contents are a URL with a non-empty host portion, which we |
| 1834 // should emphasize. To check for a URL, rather than using the type returned | 1837 // should emphasize. To check for a URL, rather than using the type returned |
| 1835 // by Parse(), ask the model, which will check the desired page transition for | 1838 // by Parse(), ask the model, which will check the desired page transition for |
| 1836 // this input. This can tell us whether an UNKNOWN input string is going to | 1839 // this input. This can tell us whether an UNKNOWN input string is going to |
| 1837 // be treated as a search or a navigation, and is the same method the Paste | 1840 // be treated as a search or a navigation, and is the same method the Paste |
| 1838 // And Go system uses. | 1841 // And Go system uses. |
| 1839 url_parse::Parsed parts; | 1842 url_parse::Parsed parts; |
| 1840 AutocompleteInput::Parse(GetText(), model_->GetDesiredTLD(), &parts, NULL); | 1843 AutocompleteInput::Parse(GetText(), model_->GetDesiredTLD(), &parts, NULL); |
| (...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2175 } | 2178 } |
| 2176 | 2179 |
| 2177 void AutocompleteEditViewWin::RepaintDropHighlight(int position) { | 2180 void AutocompleteEditViewWin::RepaintDropHighlight(int position) { |
| 2178 if ((position != -1) && (position <= GetTextLength())) { | 2181 if ((position != -1) && (position <= GetTextLength())) { |
| 2179 const POINT min_loc(PosFromChar(position)); | 2182 const POINT min_loc(PosFromChar(position)); |
| 2180 const RECT highlight_bounds = {min_loc.x - 1, font_y_adjustment_, | 2183 const RECT highlight_bounds = {min_loc.x - 1, font_y_adjustment_, |
| 2181 min_loc.x + 2, font_ascent_ + font_descent_ + font_y_adjustment_}; | 2184 min_loc.x + 2, font_ascent_ + font_descent_ + font_y_adjustment_}; |
| 2182 InvalidateRect(&highlight_bounds, false); | 2185 InvalidateRect(&highlight_bounds, false); |
| 2183 } | 2186 } |
| 2184 } | 2187 } |
| OLD | NEW |