| 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 17 matching lines...) Expand all Loading... |
| 28 #include "chrome/browser/command_updater.h" | 28 #include "chrome/browser/command_updater.h" |
| 29 #include "chrome/browser/metrics/user_metrics.h" | 29 #include "chrome/browser/metrics/user_metrics.h" |
| 30 #include "chrome/browser/net/url_fixer_upper.h" | 30 #include "chrome/browser/net/url_fixer_upper.h" |
| 31 #include "chrome/browser/profiles/profile.h" | 31 #include "chrome/browser/profiles/profile.h" |
| 32 #include "chrome/browser/search_engines/template_url.h" | 32 #include "chrome/browser/search_engines/template_url.h" |
| 33 #include "chrome/browser/search_engines/template_url_model.h" | 33 #include "chrome/browser/search_engines/template_url_model.h" |
| 34 #include "chrome/browser/tab_contents/tab_contents.h" | 34 #include "chrome/browser/tab_contents/tab_contents.h" |
| 35 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" | 35 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" |
| 36 #include "chrome/common/notification_service.h" | 36 #include "chrome/common/notification_service.h" |
| 37 #include "googleurl/src/url_util.h" | 37 #include "googleurl/src/url_util.h" |
| 38 #include "gfx/canvas.h" | |
| 39 #include "gfx/canvas_skia.h" | |
| 40 #include "grit/generated_resources.h" | 38 #include "grit/generated_resources.h" |
| 41 #include "net/base/escape.h" | 39 #include "net/base/escape.h" |
| 42 #include "skia/ext/skia_utils_win.h" | 40 #include "skia/ext/skia_utils_win.h" |
| 43 #include "ui/base/clipboard/clipboard.h" | 41 #include "ui/base/clipboard/clipboard.h" |
| 44 #include "ui/base/clipboard/scoped_clipboard_writer.h" | 42 #include "ui/base/clipboard/scoped_clipboard_writer.h" |
| 45 #include "ui/base/dragdrop/drag_source.h" | 43 #include "ui/base/dragdrop/drag_source.h" |
| 46 #include "ui/base/dragdrop/drop_target.h" | 44 #include "ui/base/dragdrop/drop_target.h" |
| 47 #include "ui/base/dragdrop/os_exchange_data.h" | 45 #include "ui/base/dragdrop/os_exchange_data.h" |
| 48 #include "ui/base/dragdrop/os_exchange_data_provider_win.h" | 46 #include "ui/base/dragdrop/os_exchange_data_provider_win.h" |
| 49 #include "ui/base/keycodes/keyboard_codes.h" | 47 #include "ui/base/keycodes/keyboard_codes.h" |
| 50 #include "ui/base/l10n/l10n_util.h" | 48 #include "ui/base/l10n/l10n_util.h" |
| 51 #include "ui/base/l10n/l10n_util_win.h" | 49 #include "ui/base/l10n/l10n_util_win.h" |
| 50 #include "ui/gfx/canvas.h" |
| 51 #include "ui/gfx/canvas_skia.h" |
| 52 #include "views/controls/textfield/native_textfield_win.h" | 52 #include "views/controls/textfield/native_textfield_win.h" |
| 53 #include "views/drag_utils.h" | 53 #include "views/drag_utils.h" |
| 54 #include "views/focus/focus_util_win.h" | 54 #include "views/focus/focus_util_win.h" |
| 55 #include "views/widget/widget.h" | 55 #include "views/widget/widget.h" |
| 56 | 56 |
| 57 #pragma comment(lib, "oleacc.lib") // Needed for accessibility support. | 57 #pragma comment(lib, "oleacc.lib") // Needed for accessibility support. |
| 58 #pragma comment(lib, "riched20.lib") // Needed for the richedit control. | 58 #pragma comment(lib, "riched20.lib") // Needed for the richedit control. |
| 59 | 59 |
| 60 /////////////////////////////////////////////////////////////////////////////// | 60 /////////////////////////////////////////////////////////////////////////////// |
| 61 // AutocompleteEditModel | 61 // AutocompleteEditModel |
| (...skipping 2520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2582 // PosFromChar(i) might return 0 when i is greater than 1. | 2582 // PosFromChar(i) might return 0 when i is greater than 1. |
| 2583 return font_.GetStringWidth(text) + GetHorizontalMargin(); | 2583 return font_.GetStringWidth(text) + GetHorizontalMargin(); |
| 2584 } | 2584 } |
| 2585 | 2585 |
| 2586 bool AutocompleteEditViewWin::IsCaretAtEnd() const { | 2586 bool AutocompleteEditViewWin::IsCaretAtEnd() const { |
| 2587 long length = GetTextLength(); | 2587 long length = GetTextLength(); |
| 2588 CHARRANGE sel; | 2588 CHARRANGE sel; |
| 2589 GetSelection(sel); | 2589 GetSelection(sel); |
| 2590 return sel.cpMin == sel.cpMax && sel.cpMin == length; | 2590 return sel.cpMin == sel.cpMax && sel.cpMin == length; |
| 2591 } | 2591 } |
| OLD | NEW |