OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 11 matching lines...) Expand all Loading... |
22 #include "app/win/drag_source.h" | 22 #include "app/win/drag_source.h" |
23 #include "app/win/drop_target.h" | 23 #include "app/win/drop_target.h" |
24 #include "app/win/iat_patch_function.h" | 24 #include "app/win/iat_patch_function.h" |
25 #include "base/auto_reset.h" | 25 #include "base/auto_reset.h" |
26 #include "base/basictypes.h" | 26 #include "base/basictypes.h" |
27 #include "base/i18n/rtl.h" | 27 #include "base/i18n/rtl.h" |
28 #include "base/lazy_instance.h" | 28 #include "base/lazy_instance.h" |
29 #include "base/ref_counted.h" | 29 #include "base/ref_counted.h" |
30 #include "base/string_util.h" | 30 #include "base/string_util.h" |
31 #include "base/utf_string_conversions.h" | 31 #include "base/utf_string_conversions.h" |
32 #include "chrome/app/chrome_dll_resource.h" | 32 #include "chrome/app/chrome_command_ids.h" |
33 #include "chrome/browser/autocomplete/autocomplete_accessibility.h" | 33 #include "chrome/browser/autocomplete/autocomplete_accessibility.h" |
34 #include "chrome/browser/autocomplete/autocomplete_match.h" | 34 #include "chrome/browser/autocomplete/autocomplete_match.h" |
35 #include "chrome/browser/autocomplete/autocomplete_popup_model.h" | 35 #include "chrome/browser/autocomplete/autocomplete_popup_model.h" |
36 #include "chrome/browser/autocomplete/keyword_provider.h" | 36 #include "chrome/browser/autocomplete/keyword_provider.h" |
37 #include "chrome/browser/browser_process.h" | 37 #include "chrome/browser/browser_process.h" |
38 #include "chrome/browser/command_updater.h" | 38 #include "chrome/browser/command_updater.h" |
39 #include "chrome/browser/metrics/user_metrics.h" | 39 #include "chrome/browser/metrics/user_metrics.h" |
40 #include "chrome/browser/net/url_fixer_upper.h" | 40 #include "chrome/browser/net/url_fixer_upper.h" |
41 #include "chrome/browser/profile.h" | 41 #include "chrome/browser/profile.h" |
42 #include "chrome/browser/search_engines/template_url.h" | 42 #include "chrome/browser/search_engines/template_url.h" |
(...skipping 2519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2562 return (rect.left - client_rect.left) + (client_rect.right - rect.right); | 2562 return (rect.left - client_rect.left) + (client_rect.right - rect.right); |
2563 } | 2563 } |
2564 | 2564 |
2565 int AutocompleteEditViewWin::WidthNeededToDisplay(const std::wstring& text) { | 2565 int AutocompleteEditViewWin::WidthNeededToDisplay(const std::wstring& text) { |
2566 // Use font_.GetStringWidth() instead of | 2566 // Use font_.GetStringWidth() instead of |
2567 // PosFromChar(location_entry_->GetTextLength()) because PosFromChar() is | 2567 // PosFromChar(location_entry_->GetTextLength()) because PosFromChar() is |
2568 // apparently buggy. In both LTR UI and RTL UI with left-to-right layout, | 2568 // apparently buggy. In both LTR UI and RTL UI with left-to-right layout, |
2569 // PosFromChar(i) might return 0 when i is greater than 1. | 2569 // PosFromChar(i) might return 0 when i is greater than 1. |
2570 return font_.GetStringWidth(text) + GetHorizontalMargin(); | 2570 return font_.GetStringWidth(text) + GetHorizontalMargin(); |
2571 } | 2571 } |
OLD | NEW |