OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 |
11 #include <richedit.h> | 11 #include <richedit.h> |
12 #include <textserv.h> | 12 #include <textserv.h> |
13 | 13 |
14 #include "base/auto_reset.h" | 14 #include "base/auto_reset.h" |
15 #include "base/basictypes.h" | 15 #include "base/basictypes.h" |
16 #include "base/bind.h" | 16 #include "base/bind.h" |
17 #include "base/i18n/rtl.h" | 17 #include "base/i18n/rtl.h" |
18 #include "base/lazy_instance.h" | 18 #include "base/lazy_instance.h" |
19 #include "base/memory/ref_counted.h" | 19 #include "base/memory/ref_counted.h" |
20 #include "base/string_util.h" | 20 #include "base/string_util.h" |
21 #include "base/utf_string_conversions.h" | 21 #include "base/strings/utf_string_conversions.h" |
22 #include "base/win/iat_patch_function.h" | 22 #include "base/win/iat_patch_function.h" |
23 #include "base/win/metro.h" | 23 #include "base/win/metro.h" |
24 #include "base/win/scoped_hdc.h" | 24 #include "base/win/scoped_hdc.h" |
25 #include "base/win/scoped_select_object.h" | 25 #include "base/win/scoped_select_object.h" |
26 #include "base/win/windows_version.h" | 26 #include "base/win/windows_version.h" |
27 #include "chrome/app/chrome_command_ids.h" | 27 #include "chrome/app/chrome_command_ids.h" |
28 #include "chrome/browser/autocomplete/autocomplete_input.h" | 28 #include "chrome/browser/autocomplete/autocomplete_input.h" |
29 #include "chrome/browser/autocomplete/autocomplete_match.h" | 29 #include "chrome/browser/autocomplete/autocomplete_match.h" |
30 #include "chrome/browser/autocomplete/keyword_provider.h" | 30 #include "chrome/browser/autocomplete/keyword_provider.h" |
31 #include "chrome/browser/bookmarks/bookmark_node_data.h" | 31 #include "chrome/browser/bookmarks/bookmark_node_data.h" |
(...skipping 2799 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2831 return (rect.left - client_rect.left) + (client_rect.right - rect.right); | 2831 return (rect.left - client_rect.left) + (client_rect.right - rect.right); |
2832 } | 2832 } |
2833 | 2833 |
2834 int OmniboxViewWin::WidthNeededToDisplay(const string16& text) const { | 2834 int OmniboxViewWin::WidthNeededToDisplay(const string16& text) const { |
2835 // Use font_.GetStringWidth() instead of PosFromChar(GetTextLength()) because | 2835 // Use font_.GetStringWidth() instead of PosFromChar(GetTextLength()) because |
2836 // PosFromChar() is apparently buggy. In both LTR UI and RTL UI with | 2836 // PosFromChar() is apparently buggy. In both LTR UI and RTL UI with |
2837 // left-to-right layout, PosFromChar(i) might return 0 when i is greater than | 2837 // left-to-right layout, PosFromChar(i) might return 0 when i is greater than |
2838 // 1. | 2838 // 1. |
2839 return font_.GetStringWidth(text) + GetHorizontalMargin(); | 2839 return font_.GetStringWidth(text) + GetHorizontalMargin(); |
2840 } | 2840 } |
OLD | NEW |